/* Generated by Cython 3.0.12 */

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

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

#include "Python.h"

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

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

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

#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #elif defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_DefaultClassType PyClass_Type
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
                                                    PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                                    PyObject *fv, PyObject *cell, PyObject* fn,
                                                    PyObject *name, int fline, PyObject *lnos) {
        PyObject *exception_table = NULL;
        PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
        #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
        PyObject *version_info;
        PyObject *py_minor_version = NULL;
        #endif
        long minor_version = 0;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
        minor_version = 11;
        #else
        if (!(version_info = PySys_GetObject("version_info"))) goto end;
        if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
        minor_version = PyLong_AsLong(py_minor_version);
        Py_DECREF(py_minor_version);
        if (minor_version == -1 && PyErr_Occurred()) goto end;
        #endif
        if (!(types_module = PyImport_ImportModule("types"))) goto end;
        if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
        if (minor_version <= 7) {
            (void)p;
            result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else if (minor_version <= 10) {
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else {
            if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
        }
    end:
        Py_XDECREF(code_type);
        Py_XDECREF(exception_table);
        Py_XDECREF(types_module);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return result;
    }
    #ifndef CO_OPTIMIZED
    #define CO_OPTIMIZED 0x0001
    #endif
    #ifndef CO_NEWLOCALS
    #define CO_NEWLOCALS 0x0002
    #endif
    #ifndef CO_VARARGS
    #define CO_VARARGS 0x0004
    #endif
    #ifndef CO_VARKEYWORDS
    #define CO_VARKEYWORDS 0x0008
    #endif
    #ifndef CO_ASYNC_GENERATOR
    #define CO_ASYNC_GENERATOR 0x0200
    #endif
    #ifndef CO_GENERATOR
    #define CO_GENERATOR 0x0020
    #endif
    #ifndef CO_COROUTINE
    #define CO_COROUTINE 0x0080
    #endif
#elif PY_VERSION_HEX >= 0x030B0000
  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
                                                    PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                                    PyObject *fv, PyObject *cell, PyObject* fn,
                                                    PyObject *name, int fline, PyObject *lnos) {
    PyCodeObject *result;
    PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
    if (!empty_bytes) return NULL;
    result =
      #if PY_VERSION_HEX >= 0x030C0000
        PyUnstable_Code_NewWithPosOnlyArgs
      #else
        PyCode_NewWithPosOnlyArgs
      #endif
        (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
    Py_DECREF(empty_bytes);
    return result;
  }
#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
#endif
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
  #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
  #define __Pyx_Py_Is(x, y)  Py_Is(x, y)
#else
  #define __Pyx_Py_Is(x, y) ((x) == (y))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
  #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
#else
  #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
  #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
#else
  #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
  #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
#else
  #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
#endif
#define __Pyx_NoneAsNull(obj)  (__Pyx_Py_IsNone(obj) ? NULL : (obj))
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#else
  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#endif
#ifndef CO_COROUTINE
  #define CO_COROUTINE 0x80
#endif
#ifndef CO_ASYNC_GENERATOR
  #define CO_ASYNC_GENERATOR 0x200
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef Py_TPFLAGS_SEQUENCE
  #define Py_TPFLAGS_SEQUENCE 0
#endif
#ifndef Py_TPFLAGS_MAPPING
  #define Py_TPFLAGS_MAPPING 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #if PY_VERSION_HEX >= 0x030d00A4
  #  define __Pyx_PyCFunctionFast PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
  #else
  #  define __Pyx_PyCFunctionFast _PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  #endif
#endif
#if CYTHON_METH_FASTCALL
  #define __Pyx_METH_FASTCALL METH_FASTCALL
  #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
  #define __Pyx_METH_FASTCALL METH_VARARGS
  #define __Pyx_PyCFunction_FastCall PyCFunction
  #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
  #define __pyx_vectorcallfunc vectorcallfunc
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  PY_VECTORCALL_ARGUMENTS_OFFSET
  #define __Pyx_PyVectorcall_NARGS(n)  PyVectorcall_NARGS((size_t)(n))
#elif CYTHON_BACKPORT_VECTORCALL
  typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
                                            size_t nargsf, PyObject *kwnames);
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  ((size_t)1 << (8 * sizeof(size_t) - 1))
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#if PY_MAJOR_VERSION >= 0x030900B1
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_CheckExact(func)
#else
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_Check(func)
#endif
#define __Pyx_CyOrPyCFunction_Check(func)  PyCFunction_Check(func)
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  (((PyCFunctionObject*)(func))->m_ml->ml_meth)
#elif !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  PyCFunction_GET_FUNCTION(func)
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func)  (((PyCFunctionObject*)(func))->m_ml->ml_flags)
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
    return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
}
#endif
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
#if CYTHON_COMPILING_IN_LIMITED_API
    return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
    return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCFunction(func, cfunc)
#if __PYX_LIMITED_VERSION_HEX < 0x030900B1
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  ((void)m, PyType_FromSpecWithBases(s, b))
  typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  PyType_FromModuleAndSpec(m, s, b)
  #define __Pyx_PyCMethod  PyCMethod
#endif
#ifndef METH_METHOD
  #define METH_METHOD 0x200
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
{
    void *result;
    result = PyModule_GetState(op);
    if (!result)
        Py_FatalError("Couldn't find the module state");
    return result;
}
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if PY_MAJOR_VERSION < 3
    #if CYTHON_COMPILING_IN_PYPY
        #if PYPY_VERSION_NUM < 0x07030600
            #if defined(__cplusplus) && __cplusplus >= 201402L
                [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
            #elif defined(__GNUC__) || defined(__clang__)
                __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
            #elif defined(_MSC_VER)
                __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
            #endif
            static CYTHON_INLINE int PyGILState_Check(void) {
                return 0;
            }
        #else  // PYPY_VERSION_NUM < 0x07030600
        #endif  // PYPY_VERSION_NUM < 0x07030600
    #else
        static CYTHON_INLINE int PyGILState_Check(void) {
            PyThreadState * tstate = _PyThreadState_Current;
            return tstate && (tstate == PyGILState_GetThisThreadState());
        }
    #endif
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
    PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
    if (res == NULL) PyErr_Clear();
    return res;
}
#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
#define __Pyx_PyDict_GetItemStrWithError  PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
    return PyDict_GetItem(dict, name);
#else
    PyDictEntry *ep;
    PyDictObject *mp = (PyDictObject*) dict;
    long hash = ((PyStringObject *) name)->ob_shash;
    assert(hash != -1);
    ep = (mp->ma_lookup)(mp, name, hash);
    if (ep == NULL) {
        return NULL;
    }
    return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetFlags(tp)   (((PyTypeObject *)tp)->tp_flags)
  #define __Pyx_PyType_HasFeature(type, feature)  ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
  #define __Pyx_PyObject_GetIterNextFunc(obj)  (Py_TYPE(obj)->tp_iternext)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
  #define __Pyx_PyObject_GetIterNextFunc(obj)  PyIter_Next
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
#else
  #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
#endif
#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  {\
    PyTypeObject *type = Py_TYPE((PyObject*)obj);\
    assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
    PyObject_GC_Del(obj);\
    Py_DECREF(type);\
}
#else
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  PyObject_GC_Del(obj)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GetLength(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((void)u, (0))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)u)
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GetLength(u))
#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_READY(op)       (0)
  #else
    #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                                0 : _PyUnicode_Ready((PyObject *)(op)))
  #endif
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         ((int)PyUnicode_KIND(u))
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #else
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
    #else
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
    #endif
  #endif
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((int)sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #if !defined(PyUnicode_DecodeUnicodeEscape)
    #define PyUnicode_DecodeUnicodeEscape(s, size, errors)  PyUnicode_Decode(s, size, "unicode_escape", errors)
  #endif
  #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
    #undef PyUnicode_Contains
    #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  #endif
  #if !defined(PyByteArray_Check)
    #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  #endif
  #if !defined(PyObject_Format)
    #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  #endif
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#ifndef PyObject_Unicode
  #define PyObject_Unicode             PyObject_Str
#endif
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#if CYTHON_COMPILING_IN_CPYTHON
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
  #define __Pyx_PySequence_ListKeepNew(obj)  PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        __Pyx_IS_TYPE(obj, &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
#else
  #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define __Pyx_Py3Int_Check(op)       PyLong_Check(op)
  #define __Pyx_Py3Int_CheckExact(op)  PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#else
  #define __Pyx_Py3Int_Check(op)       (PyLong_Check(op) || PyInt_Check(op))
  #define __Pyx_Py3Int_CheckExact(op)  (PyLong_CheckExact(op) || PyInt_CheckExact(op))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsHash_t
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsSsize_t
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
  #if !defined(_USE_MATH_DEFINES)
    #define _USE_MATH_DEFINES
  #endif
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#define __PYX_MARK_ERR_POS(f_index, lineno) \
    { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__;  (void)__pyx_clineno; }
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

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

#define __PYX_HAVE__cytimes__utils
#define __PYX_HAVE_API__cytimes__utils
/* 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 <stdlib.h>
#include <stddef.h>
#include <time.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 <stdint.h>

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

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

    #if PY_VERSION_HEX >= 0x030d00b1 || defined(PyTime_AsSecondsDouble)
        #define __Pyx_PyTime_AsSecondsDouble(t)  PyTime_AsSecondsDouble(t)
    #else
        #define __Pyx_PyTime_AsSecondsDouble(t)  _PyTime_AsSecondsDouble(t)
    #endif
    
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s)    ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#define __Pyx_PyUnicode_FromOrdinal(o)       PyUnicode_FromOrdinal((int)o)
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_VERSION_HEX >= 0x030C00A7
  #ifndef _PyLong_SIGN_MASK
    #define _PyLong_SIGN_MASK 3
  #endif
  #ifndef _PyLong_NON_SIZE_BITS
    #define _PyLong_NON_SIZE_BITS 3
  #endif
  #define __Pyx_PyLong_Sign(x)  (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
  #define __Pyx_PyLong_IsNeg(x)  ((__Pyx_PyLong_Sign(x) & 2) != 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (!__Pyx_PyLong_IsNeg(x))
  #define __Pyx_PyLong_IsZero(x)  (__Pyx_PyLong_Sign(x) & 1)
  #define __Pyx_PyLong_IsPos(x)  (__Pyx_PyLong_Sign(x) == 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  (__Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
  #define __Pyx_PyLong_SignedDigitCount(x)\
        ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
  #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
    #define __Pyx_PyLong_IsCompact(x)     PyUnstable_Long_IsCompact((PyLongObject*) x)
    #define __Pyx_PyLong_CompactValue(x)  PyUnstable_Long_CompactValue((PyLongObject*) x)
  #else
    #define __Pyx_PyLong_IsCompact(x)     (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
    #define __Pyx_PyLong_CompactValue(x)  ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  #endif
  typedef Py_ssize_t  __Pyx_compact_pylong;
  typedef size_t  __Pyx_compact_upylong;
  #else
  #define __Pyx_PyLong_IsNeg(x)  (Py_SIZE(x) < 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (Py_SIZE(x) >= 0)
  #define __Pyx_PyLong_IsZero(x)  (Py_SIZE(x) == 0)
  #define __Pyx_PyLong_IsPos(x)  (Py_SIZE(x) > 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  __Pyx_sst_abs(Py_SIZE(x))
  #define __Pyx_PyLong_SignedDigitCount(x)  Py_SIZE(x)
  #define __Pyx_PyLong_IsCompact(x)  (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
  #define __Pyx_PyLong_CompactValue(x)\
        ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
  typedef sdigit  __Pyx_compact_pylong;
  typedef digit  __Pyx_compact_upylong;
  #endif
  #if PY_VERSION_HEX >= 0x030C00A5
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->long_value.ob_digit)
  #else
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->ob_digit)
  #endif
#endif
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
#include <string.h>
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = (char) c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#include <string.h>
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }

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

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

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

static const char *__pyx_f[] = {
  "src/cytimes/utils.pxd",
  "src/cytimes/utils.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-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":787
 * # in Cython to enable them only on the right systems.
 * 
 * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 */
typedef npy_int8 __pyx_t_5numpy_int8_t;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/*--- Type declarations ---*/
struct __pyx_opt_args_7cpython_11contextvars_get_value;
struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default;

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

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

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

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

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

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

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

/* "datetime.pxd":312
 * 
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.DateTime_FromTimestamp(
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
 */
struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp {
  int __pyx_n;
  PyObject *tz;
};
struct __pyx_t_7cytimes_5utils_ymd;
typedef struct __pyx_t_7cytimes_5utils_ymd __pyx_t_7cytimes_5utils_ymd;
struct __pyx_t_7cytimes_5utils_hmsf;
typedef struct __pyx_t_7cytimes_5utils_hmsf __pyx_t_7cytimes_5utils_hmsf;
struct __pyx_t_7cytimes_5utils_iso;
typedef struct __pyx_t_7cytimes_5utils_iso __pyx_t_7cytimes_5utils_iso;
struct __pyx_opt_args_7cytimes_5utils_math_mod;
struct __pyx_opt_args_7cytimes_5utils_math_round_div;
struct __pyx_opt_args_7cytimes_5utils_math_ceil_div;
struct __pyx_opt_args_7cytimes_5utils_math_floor_div;
struct __pyx_opt_args_7cytimes_5utils_date_new;
struct __pyx_opt_args_7cytimes_5utils_date_now;
struct __pyx_opt_args_7cytimes_5utils_dt_new;
struct __pyx_opt_args_7cytimes_5utils_dt_now;
struct __pyx_opt_args_7cytimes_5utils_dt_to_tm;
struct __pyx_opt_args_7cytimes_5utils_dt_to_isoformat;
struct __pyx_opt_args_7cytimes_5utils_dt_to_us;
struct __pyx_opt_args_7cytimes_5utils_dt_to_seconds;
struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal;
struct __pyx_opt_args_7cytimes_5utils_dt_as_epoch;
struct __pyx_opt_args_7cytimes_5utils_dt_as_epoch_iso_W;
struct __pyx_opt_args_7cytimes_5utils_dt_fr_us;
struct __pyx_opt_args_7cytimes_5utils_dt_fr_seconds;
struct __pyx_opt_args_7cytimes_5utils_dt_fr_ordinal;
struct __pyx_opt_args_7cytimes_5utils_dt_fr_ts;
struct __pyx_opt_args_7cytimes_5utils_dt_combine;
struct __pyx_opt_args_7cytimes_5utils_dt_fr_date;
struct __pyx_opt_args_7cytimes_5utils_dt_add;
struct __pyx_opt_args_7cytimes_5utils_dt_astimezone;
struct __pyx_opt_args_7cytimes_5utils_time_new;
struct __pyx_opt_args_7cytimes_5utils_time_now;
struct __pyx_opt_args_7cytimes_5utils_time_to_isoformat;
struct __pyx_opt_args_7cytimes_5utils_time_to_us;
struct __pyx_opt_args_7cytimes_5utils_time_to_seconds;
struct __pyx_opt_args_7cytimes_5utils_time_fr_us;
struct __pyx_opt_args_7cytimes_5utils_time_fr_seconds;
struct __pyx_opt_args_7cytimes_5utils_td_new;
struct __pyx_opt_args_7cytimes_5utils_tz_new;
struct __pyx_opt_args_7cytimes_5utils_tz_local;
struct __pyx_opt_args_7cytimes_5utils_tz_local_seconds;
struct __pyx_opt_args_7cytimes_5utils_tz_name;
struct __pyx_opt_args_7cytimes_5utils_tz_dst;
struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset;
struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset_seconds;
struct __pyx_opt_args_7cytimes_5utils_tz_utcformat;
struct __pyx_opt_args_7cytimes_5utils_dt64_as_int64_us;
struct __pyx_opt_args_7cytimes_5utils__dt64_Y_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils__dt64_M_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils__dt64_W_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils_dt64_to_dt;
struct __pyx_opt_args_7cytimes_5utils__raise_dt64_as_int64_unit_error;
struct __pyx_opt_args_7cytimes_5utils_td64_as_int64_us;
struct __pyx_opt_args_7cytimes_5utils__td64_Y_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils__td64_M_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils__td64_W_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils_arr_clip;
struct __pyx_opt_args_7cytimes_5utils_arr_min;
struct __pyx_opt_args_7cytimes_5utils_arr_max;
struct __pyx_opt_args_7cytimes_5utils_arr_min_arr;
struct __pyx_opt_args_7cytimes_5utils_arr_max_arr;
struct __pyx_opt_args_7cytimes_5utils_arr_abs;
struct __pyx_opt_args_7cytimes_5utils_arr_mul;
struct __pyx_opt_args_7cytimes_5utils_arr_div;
struct __pyx_opt_args_7cytimes_5utils_arr_mod;
struct __pyx_opt_args_7cytimes_5utils_arr_round_div;
struct __pyx_opt_args_7cytimes_5utils_arr_ceil_div;
struct __pyx_opt_args_7cytimes_5utils_arr_floor_div;
struct __pyx_opt_args_7cytimes_5utils_arr_round_to_mul;
struct __pyx_opt_args_7cytimes_5utils_arr_ceil_to_mul;
struct __pyx_opt_args_7cytimes_5utils_arr_floor_to_mul;
struct __pyx_opt_args_7cytimes_5utils_arr_add_arr;
struct __pyx_opt_args_7cytimes_5utils_arr_sub_arr;
struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_year;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_quarter;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_month;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_weekday;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_day;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_hour;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_minute;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_second;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_millisecond;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_microsecond;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_nanosecond;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_times;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_isocalendar;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_is_leap_year;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_is_long_year;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_leap_bt_year;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_year;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_bf_year;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_of_year;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_quarter;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_bf_quarter;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_of_quarter;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_month;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_bf_month;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Q;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_W;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_h;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_m;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_s;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ms;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_us;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ns;
struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_iso_W;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_to_ordinal;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_to_ts;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_unit;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_round;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_ceil;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_floor;
struct __pyx_opt_args_7cytimes_5utils__raise_dt64arr_as_int64_unit_error;
struct __pyx_opt_args_7cytimes_5utils_td64arr_as_int64_us;
struct __pyx_opt_args_7cytimes_5utils__td64arr_Y_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils__td64arr_M_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils__td64arr_W_as_int64_D;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

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

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

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

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

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

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

/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif

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

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

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

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

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

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

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

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

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

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

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

/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

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

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

/* ObjectGetItem.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
#else
#define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
#endif

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

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

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

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

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

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

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

/* DictGetItem.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
    (likely(PyDict_CheckExact(obj)) ?\
     __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
#endif

/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

/* HasAttr.proto */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);

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

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

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

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

/* PyObjectFormatSimple.proto */
#if CYTHON_COMPILING_IN_PYPY
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#elif PY_MAJOR_VERSION < 3
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
        PyObject_Format(s, f))
#elif CYTHON_USE_TYPE_SLOTS
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
        likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
        PyObject_Format(s, f))
#else
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#endif

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

/* CBIntToPyUnicode.proto */
#define __Pyx_PyUnicode_FromBInt_bint(value)\
    ((value) ? __Pyx_NewRef(__pyx_n_u_True) : __Pyx_NewRef(__pyx_n_u_False))

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);

/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

/* PyIntCompare.proto */
static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

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

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

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

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

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

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2))
#endif

/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_TrueDivideObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2))
#endif

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

/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

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

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

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

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

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

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

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

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

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

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

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

static PyObject* __pyx_convert__to_py___pyx_t_7cytimes_5utils_ymd(__pyx_t_7cytimes_5utils_ymd s);
/* 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_int(int value);

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

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

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

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

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

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

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

/* 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_12(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 "cython" */

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

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

/* Module declarations from "__builtin__" */

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from "__builtin__" */

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

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

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

/* Module declarations from "__builtin__" */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from "cpython" */

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

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

/* Module declarations from "numpy" */

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

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

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

/* Module declarations from "datetime" */

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

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

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

/* Module declarations from "cytimes" */

/* 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_TIMEZONE = 0;
#define __pyx_v_7cytimes_7typeref_TIMEZONE (*__pyx_vp_7cytimes_7typeref_TIMEZONE)
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.utils" */
static int __pyx_v_7cytimes_5utils_DAYS_BR_MONTH[13];
static int __pyx_v_7cytimes_5utils_DAYS_IN_MONTH[13];
static int __pyx_v_7cytimes_5utils_DAYS_BR_QUARTER[5];
static int __pyx_v_7cytimes_5utils_DAYS_IN_QUARTER[5];
static int __pyx_v_7cytimes_5utils_ORDINAL_MAX;
static PyDateTime_DateTime *__pyx_v_7cytimes_5utils_EPOCH_DT = 0;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_EPOCH_YEAR;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_EPOCH_MONTH;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_EPOCH_DAY;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_EPOCH_HOUR;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_EPOCH_MINUTE;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_EPOCH_SECOND;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_EPOCH_MILLISECOND;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_EPOCH_MICROSECOND;
static PyDateTime_TZInfo *__pyx_v_7cytimes_5utils_UTC = 0;
static PyObject *__pyx_v_7cytimes_5utils__LOCAL_TZ = 0;
static PyObject *__pyx_v_7cytimes_5utils__TIMEZONE_MAP = 0;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_SS_MINUTE;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_SS_HOUR;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_SS_DAY;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_MS_SECOND;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_MS_MINUTE;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_MS_HOUR;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_MS_DAY;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_US_MILLISECOND;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_US_SECOND;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_US_MINUTE;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_US_HOUR;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_US_DAY;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_NS_MICROSECOND;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_NS_MILLISECOND;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_NS_SECOND;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_NS_MINUTE;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_NS_HOUR;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_NS_DAY;
static double __pyx_v_7cytimes_5utils_TD64_YY_DAY;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_TD64_YY_SECOND;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_TD64_YY_MILLISECOND;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_TD64_YY_MICROSECOND;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_TD64_YY_NANOSECOND;
static double __pyx_v_7cytimes_5utils_TD64_MM_DAY;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_TD64_MM_SECOND;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_TD64_MM_MILLISECOND;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_TD64_MM_MICROSECOND;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_TD64_MM_NANOSECOND;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_YY_MIN;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_MM_MIN;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_WW_MIN;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_DD_MIN;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_HH_MIN;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_MI_MIN;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_SS_MIN;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_MS_MIN;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_US_MIN;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_NS_MIN;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_YY_MAX;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_MM_MAX;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_WW_MAX;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_DD_MAX;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_HH_MAX;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_MI_MAX;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_SS_MAX;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_MS_MAX;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_US_MAX;
static PY_LONG_LONG __pyx_v_7cytimes_5utils_DT64_NS_NS_MAX;
static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_math_mod(PY_LONG_LONG, PY_LONG_LONG, struct __pyx_opt_args_7cytimes_5utils_math_mod *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_math_floor_div(PY_LONG_LONG, PY_LONG_LONG, struct __pyx_opt_args_7cytimes_5utils_math_floor_div *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_iso_sep(Py_UCS4); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_isodate_sep(Py_UCS4); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_isoweek_sep(Py_UCS4); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_isotime_sep(Py_UCS4); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_ascii_digit(Py_UCS4); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_ascii_alpha_upper(Py_UCS4); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_ascii_alpha_lower(Py_UCS4); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isoyear(PyObject *, Py_ssize_t, Py_ssize_t); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isomonth(PyObject *, Py_ssize_t, Py_ssize_t); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isoday(PyObject *, Py_ssize_t, Py_ssize_t); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isoweek(PyObject *, Py_ssize_t, Py_ssize_t); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isoweekday(PyObject *, Py_ssize_t, Py_ssize_t); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isoyearday(PyObject *, Py_ssize_t, Py_ssize_t); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isominute(PyObject *, Py_ssize_t, Py_ssize_t); /*proto*/
static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_tm_gmtime(double); /*proto*/
static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_tm_localtime(double); /*proto*/
static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_ts_localtime(double); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_from_errno(void); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tm_strftime(struct tm, PyObject *); /*proto*/
static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_tm_fr_us(PY_LONG_LONG); /*proto*/
static CYTHON_INLINE __pyx_t_7cytimes_5utils_hmsf __pyx_f_7cytimes_5utils_hmsf_fr_us(PY_LONG_LONG); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_leap_year(int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_long_year(int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_leap_bt_year(int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_in_year(int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_bf_year(int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_of_year(int, int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_quarter_of_month(int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_in_quarter(int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_bf_quarter(int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_of_quarter(int, int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_in_month(int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_bf_month(int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_ymd_weekday(int, int, int); /*proto*/
static CYTHON_INLINE __pyx_t_7cytimes_5utils_iso __pyx_f_7cytimes_5utils_ymd_isocalendar(int, int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_ymd_isoyear(int, int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_ymd_isoweek(int, int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_ymd_to_ordinal(int, int, int); /*proto*/
static CYTHON_INLINE __pyx_t_7cytimes_5utils_ymd __pyx_f_7cytimes_5utils_ymd_fr_ordinal(int); /*proto*/
static CYTHON_INLINE __pyx_t_7cytimes_5utils_ymd __pyx_f_7cytimes_5utils_ymd_fr_isocalendar(int, int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils__iso_1st_monday(int); /*proto*/
static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_new(struct __pyx_opt_args_7cytimes_5utils_date_new *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_now(struct __pyx_opt_args_7cytimes_5utils_date_now *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_date(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_date_exact(PyObject *); /*proto*/
static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_date_to_tm(PyDateTime_Date *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_date_to_strformat(PyDateTime_Date *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_date_to_isoformat(PyDateTime_Date *); /*proto*/
static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_date_to_us(PyDateTime_Date *); /*proto*/
static CYTHON_INLINE double __pyx_f_7cytimes_5utils_date_to_seconds(PyDateTime_Date *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_date_to_ordinal(PyDateTime_Date *); /*proto*/
static CYTHON_INLINE double __pyx_f_7cytimes_5utils_date_to_ts(PyDateTime_Date *); /*proto*/
static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_us(PY_LONG_LONG); /*proto*/
static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_seconds(double); /*proto*/
static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_ordinal(int); /*proto*/
static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_ts(double); /*proto*/
static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_date(PyDateTime_Date *); /*proto*/
static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_dt(PyDateTime_DateTime *); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_new(struct __pyx_opt_args_7cytimes_5utils_dt_new *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_now(struct __pyx_opt_args_7cytimes_5utils_dt_now *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_dt(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_dt_exact(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_dt_tzname(PyDateTime_DateTime *); /*proto*/
static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_dt_dst(PyDateTime_DateTime *); /*proto*/
static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_dt_utcoffset(PyDateTime_DateTime *); /*proto*/
static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_dt_to_tm(PyDateTime_DateTime *, struct __pyx_opt_args_7cytimes_5utils_dt_to_tm *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_dt_to_strformat(PyDateTime_DateTime *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_dt_to_isoformat(PyDateTime_DateTime *, struct __pyx_opt_args_7cytimes_5utils_dt_to_isoformat *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_dt_to_us(PyDateTime_DateTime *, struct __pyx_opt_args_7cytimes_5utils_dt_to_us *__pyx_optional_args); /*proto*/
static CYTHON_INLINE double __pyx_f_7cytimes_5utils_dt_to_seconds(PyDateTime_DateTime *, struct __pyx_opt_args_7cytimes_5utils_dt_to_seconds *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_dt_to_ordinal(PyDateTime_DateTime *, struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_dt_to_posix(PyDateTime_DateTime *); /*proto*/
static CYTHON_INLINE double __pyx_f_7cytimes_5utils_dt_to_ts(PyDateTime_DateTime *); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_us(PY_LONG_LONG, struct __pyx_opt_args_7cytimes_5utils_dt_fr_us *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_seconds(double, struct __pyx_opt_args_7cytimes_5utils_dt_fr_seconds *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_ordinal(int, struct __pyx_opt_args_7cytimes_5utils_dt_fr_ordinal *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_ts(double, struct __pyx_opt_args_7cytimes_5utils_dt_fr_ts *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_combine(struct __pyx_opt_args_7cytimes_5utils_dt_combine *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_date(PyDateTime_Date *, struct __pyx_opt_args_7cytimes_5utils_dt_fr_date *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_dt(PyDateTime_DateTime *); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_add(PyDateTime_DateTime *, struct __pyx_opt_args_7cytimes_5utils_dt_add *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_replace_tz(PyDateTime_DateTime *, PyObject *); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_replace_fold(PyDateTime_DateTime *, int); /*proto*/
static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_new(struct __pyx_opt_args_7cytimes_5utils_time_new *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_now(struct __pyx_opt_args_7cytimes_5utils_time_now *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_time(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_time_exact(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_time_tzname(PyDateTime_Time *); /*proto*/
static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_time_dst(PyDateTime_Time *); /*proto*/
static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_time_utcoffset(PyDateTime_Time *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_time_to_isoformat(PyDateTime_Time *, struct __pyx_opt_args_7cytimes_5utils_time_to_isoformat *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_time_to_us(PyDateTime_Time *, struct __pyx_opt_args_7cytimes_5utils_time_to_us *__pyx_optional_args); /*proto*/
static CYTHON_INLINE double __pyx_f_7cytimes_5utils_time_to_seconds(PyDateTime_Time *, struct __pyx_opt_args_7cytimes_5utils_time_to_seconds *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_fr_us(PY_LONG_LONG, struct __pyx_opt_args_7cytimes_5utils_time_fr_us *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_fr_seconds(double, struct __pyx_opt_args_7cytimes_5utils_time_fr_seconds *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_fr_time(PyDateTime_Time *); /*proto*/
static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_fr_dt(PyDateTime_DateTime *); /*proto*/
static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_td_new(struct __pyx_opt_args_7cytimes_5utils_td_new *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_td(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_td_exact(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_td_to_isoformat(PyDateTime_Delta *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_td_to_utcformat(PyDateTime_Delta *); /*proto*/
static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_td_to_us(PyDateTime_Delta *); /*proto*/
static CYTHON_INLINE double __pyx_f_7cytimes_5utils_td_to_seconds(PyDateTime_Delta *); /*proto*/
static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_td_fr_us(PY_LONG_LONG); /*proto*/
static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_td_fr_seconds(double); /*proto*/
static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_td_fr_td(PyDateTime_Delta *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tz_new(struct __pyx_opt_args_7cytimes_5utils_tz_new *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tz_local(struct __pyx_opt_args_7cytimes_5utils_tz_local *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_tz_local_seconds(struct __pyx_opt_args_7cytimes_5utils_tz_local_seconds *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7cytimes_5utils_tz_parse(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_tz(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_tz_exact(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tz_name(PyObject *, struct __pyx_opt_args_7cytimes_5utils_tz_name *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_tz_dst(PyObject *, struct __pyx_opt_args_7cytimes_5utils_tz_dst *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_tz_utcoffset(PyObject *, struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_tz_utcoffset_seconds(PyObject *, struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset_seconds *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tz_utcformat(PyObject *, struct __pyx_opt_args_7cytimes_5utils_tz_utcformat *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_map_nptime_unit_int2str(int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_get_arr_nptime_unit(PyArrayObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_arr_nptime_unit(PyArrayObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_dt64(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_validate_dt64(PyObject *); /*proto*/
static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils_dt64_as_int64_us(PyObject *, struct __pyx_opt_args_7cytimes_5utils_dt64_as_int64_us *__pyx_optional_args); /*proto*/
static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__dt64_Y_as_int64_D(npy_int64, struct __pyx_opt_args_7cytimes_5utils__dt64_Y_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__dt64_M_as_int64_D(npy_int64, struct __pyx_opt_args_7cytimes_5utils__dt64_M_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__dt64_W_as_int64_D(npy_int64, struct __pyx_opt_args_7cytimes_5utils__dt64_W_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt64_to_dt(PyObject *, struct __pyx_opt_args_7cytimes_5utils_dt64_to_dt *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_dt64_as_int64_unit_error(PyObject *, int, struct __pyx_opt_args_7cytimes_5utils__raise_dt64_as_int64_unit_error *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_td64(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_validate_td64(PyObject *); /*proto*/
static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils_td64_as_int64_us(PyObject *, struct __pyx_opt_args_7cytimes_5utils_td64_as_int64_us *__pyx_optional_args); /*proto*/
static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__td64_Y_as_int64_D(npy_int64, struct __pyx_opt_args_7cytimes_5utils__td64_Y_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__td64_M_as_int64_D(npy_int64, struct __pyx_opt_args_7cytimes_5utils__td64_M_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__td64_W_as_int64_D(npy_int64, struct __pyx_opt_args_7cytimes_5utils__td64_W_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_td64_to_td(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_arr(PyObject *); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_assure_int64(PyArrayObject *); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_assure_int64_like(PyArrayObject *); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_assure_float64(PyArrayObject *); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_zero_int64(npy_int64); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_full_int64(npy_int64, npy_int64); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_add(PyArrayObject *, npy_int64); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_mul(PyArrayObject *, npy_int64, struct __pyx_opt_args_7cytimes_5utils_arr_mul *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_div(PyArrayObject *, npy_float64, struct __pyx_opt_args_7cytimes_5utils_arr_div *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_mod(PyArrayObject *, npy_int64, struct __pyx_opt_args_7cytimes_5utils_arr_mod *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_round_div(PyArrayObject *, npy_int64, struct __pyx_opt_args_7cytimes_5utils_arr_round_div *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_ceil_div(PyArrayObject *, npy_int64, struct __pyx_opt_args_7cytimes_5utils_arr_ceil_div *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_floor_div(PyArrayObject *, npy_int64, struct __pyx_opt_args_7cytimes_5utils_arr_floor_div *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_round_to_mul(PyArrayObject *, npy_int64, struct __pyx_opt_args_7cytimes_5utils_arr_round_to_mul *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_ceil_to_mul(PyArrayObject *, npy_int64, struct __pyx_opt_args_7cytimes_5utils_arr_ceil_to_mul *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_floor_to_mul(PyArrayObject *, npy_int64, struct __pyx_opt_args_7cytimes_5utils_arr_floor_to_mul *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_dt64arr(PyArrayObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64(PyArrayObject *, PyObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_Q(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Q *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_W(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_W *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_h(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_h *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_m(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_m *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_s(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_s *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_ms(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ms *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_us(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_us *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_ns(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ns *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__dt64arr_Y_as_int64_D(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__dt64arr_M_as_int64_D(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__dt64arr_W_as_int64_D(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_unit(PyArrayObject *, PyObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_unit *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(PyObject *, int, struct __pyx_opt_args_7cytimes_5utils__raise_dt64arr_as_int64_unit_error *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(PyObject *, int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(PyArrayObject *, PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_td64arr(PyArrayObject *); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_td64arr_as_int64_us(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_td64arr_as_int64_us *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__td64arr_Y_as_int64_D(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils__td64arr_Y_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__td64arr_M_as_int64_D(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils__td64arr_M_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__td64arr_W_as_int64_D(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils__td64arr_W_as_int64_D *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7cytimes_5utils__get_localtimezone(void); /*proto*/
static PyObject *__pyx_f_7cytimes_5utils__prep_timezone_map(void); /*proto*/
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "cytimes.utils"
extern int __pyx_module_is_main_cytimes__utils;
int __pyx_module_is_main_cytimes__utils = 0;

/* Implementation of "cytimes.utils" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_ZeroDivisionError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_OverflowError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_AssertionError;
static PyObject *__pyx_builtin_print;
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_a[] = "a";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_h[] = "h";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_m[] = "m";
static const char __pyx_k_s[] = "s";
static const char __pyx_k_t[] = "t";
static const char __pyx_k_y[] = "y";
static const char __pyx_k_00[] = "-00:";
static const char __pyx_k_2d[] = "2d";
static const char __pyx_k__9[] = "-";
static const char __pyx_k_as[] = "as";
static const char __pyx_k_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_t1[] = "t1";
static const char __pyx_k_td[] = "td";
static const char __pyx_k_tm[] = "_tm";
static const char __pyx_k_to[] = "]]'> to '";
static const char __pyx_k_ts[] = "ts";
static const char __pyx_k_tz[] = "tz";
static const char __pyx_k_us[] = "us";
static const char __pyx_k_02d[] = "02d";
static const char __pyx_k_04d[] = "04d";
static const char __pyx_k_06d[] = "%06d";
static const char __pyx_k_Apr[] = "Apr";
static const char __pyx_k_Aug[] = "Aug";
static const char __pyx_k_CET[] = "CET";
static const char __pyx_k_CST[] = "CST";
static const char __pyx_k_Dec[] = "Dec";
static const char __pyx_k_Feb[] = "Feb";
static const char __pyx_k_Fri[] = "Fri";
static const char __pyx_k_GMT[] = "GMT";
static const char __pyx_k_Jan[] = "Jan";
static const char __pyx_k_Jul[] = "Jul";
static const char __pyx_k_Jun[] = "Jun";
static const char __pyx_k_Mar[] = "Mar";
static const char __pyx_k_May[] = "May";
static const char __pyx_k_Mon[] = "Mon";
static const char __pyx_k_Nov[] = "Nov";
static const char __pyx_k_Oct[] = "Oct";
static const char __pyx_k_Sat[] = "Sat";
static const char __pyx_k_Sep[] = "Sep";
static const char __pyx_k_Sun[] = "Sun";
static const char __pyx_k_Thu[] = "Thu";
static const char __pyx_k_Tue[] = "Tue";
static const char __pyx_k_UTC[] = "UTC";
static const char __pyx_k_Wed[] = "Wed";
static const char __pyx_k__10[] = " ";
static const char __pyx_k__11[] = ":";
static const char __pyx_k__12[] = "";
static const char __pyx_k__13[] = "%";
static const char __pyx_k__14[] = ".";
static const char __pyx_k__15[] = "+";
static const char __pyx_k__19[] = "[";
static const char __pyx_k__35[] = "' ";
static const char __pyx_k__37[] = "*";
static const char __pyx_k__38[] = " != ";
static const char __pyx_k__40[] = ": ";
static const char __pyx_k_all[] = "all";
static const char __pyx_k_arr[] = "arr";
static const char __pyx_k_cmp[] = "cmp";
static const char __pyx_k_day[] = "day";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_dst[] = "dst";
static const char __pyx_k_dt2[] = "dt2";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_min[] = "min";
static const char __pyx_k_now[] = "now";
static const char __pyx_k_qtr[] = "qtr";
static const char __pyx_k_str[] = "str";
static const char __pyx_k_t_c[] = "t_c";
static const char __pyx_k_t_n[] = "t_n";
static const char __pyx_k_td1[] = "td1";
static const char __pyx_k_td2[] = "td2";
static const char __pyx_k_td3[] = "td3";
static const char __pyx_k_td4[] = "td4";
static const char __pyx_k_td5[] = "td5";
static const char __pyx_k_td6[] = "td6";
static const char __pyx_k_td7[] = "td7";
static const char __pyx_k_td8[] = "td8";
static const char __pyx_k_tmp[] = "tmp";
static const char __pyx_k_tz1[] = "tz1";
static const char __pyx_k_tz2[] = "tz2";
static const char __pyx_k_tz3[] = "tz3";
static const char __pyx_k_tz4[] = "tz4";
static const char __pyx_k_utc[] = "utc";
static const char __pyx_k_val[] = "val";
static const char __pyx_k_0101[] = "+0101";
static const char __pyx_k_2359[] = "+2359";
static const char __pyx_k_GMT0[] = "GMT0";
static const char __pyx_k_None[] = "None";
static const char __pyx_k_True[] = "True";
static const char __pyx_k_Zulu[] = "Zulu";
static const char __pyx_k__117[] = "]";
static const char __pyx_k__205[] = "?";
static const char __pyx_k_ceil[] = "ceil";
static const char __pyx_k_date[] = "date";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_dt64[] = "dt64";
static const char __pyx_k_dt_2[] = "dt_";
static const char __pyx_k_dt_c[] = "dt_c";
static const char __pyx_k_dt_n[] = "dt_n";
static const char __pyx_k_fold[] = "fold";
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_secs[] = "secs";
static const char __pyx_k_spec[] = "__spec__";
static const char __pyx_k_td64[] = "td64";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_tmp1[] = "tmp1";
static const char __pyx_k_tmp2[] = "tmp2";
static const char __pyx_k_tmp3[] = "tmp3";
static const char __pyx_k_to_2[] = "]'> to ";
static const char __pyx_k_unit[] = "unit";
static const char __pyx_k_week[] = "week";
static const char __pyx_k_year[] = "year";
static const char __pyx_k_zone[] = "zone";
static const char __pyx_k_00_00[] = "-00:00:";
static const char __pyx_k_06d_2[] = "06d";
static const char __pyx_k_False[] = "False";
static const char __pyx_k_GMT_0[] = "GMT+0";
static const char __pyx_k_arr_i[] = "arr_i";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_count[] = "count";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_equal[] = "equal";
static const char __pyx_k_floor[] = "floor";
static const char __pyx_k_hours[] = "hours";
static const char __pyx_k_int64[] = "int64";
static const char __pyx_k_local[] = "local";
static const char __pyx_k_m_d_Y[] = "%m/%d/%Y";
static const char __pyx_k_month[] = "month";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_round[] = "round";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_t_tz1[] = "t_tz1";
static const char __pyx_k_time1[] = "time1";
static const char __pyx_k_time2[] = "time2";
static const char __pyx_k_today[] = "today";
static const char __pyx_k_units[] = "units";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_0101_2[] = "-0101";
static const char __pyx_k_2359_2[] = "-2359";
static const char __pyx_k_MS_DAY[] = "MS_DAY";
static const char __pyx_k_NS_DAY[] = "NS_DAY";
static const char __pyx_k_SS_DAY[] = "SS_DAY";
static const char __pyx_k_US_DAY[] = "US_DAY";
static const char __pyx_k_astype[] = "astype";
static const char __pyx_k_dt_str[] = "dt_str";
static const char __pyx_k_dt_tz1[] = "dt_tz1";
static const char __pyx_k_dt_tz2[] = "dt_tz2";
static const char __pyx_k_dt_tz3[] = "dt_tz3";
static const char __pyx_k_dt_tz4[] = "dt_tz4";
static const char __pyx_k_errors[] = "errors";
static const char __pyx_k_gmtime[] = "gmtime";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_minute[] = "minute";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_offset[] = "offset";
static const char __pyx_k_pandas[] = "pandas";
static const char __pyx_k_return[] = "return";
static const char __pyx_k_second[] = "second";
static const char __pyx_k_timetz[] = "timetz";
static const char __pyx_k_tm_min[] = "tm_min";
static const char __pyx_k_tm_mon[] = "tm_mon";
static const char __pyx_k_tm_sec[] = "tm_sec";
static const char __pyx_k_tz_str[] = "tz_str";
static const char __pyx_k_tzinfo[] = "tzinfo";
static const char __pyx_k_tzname[] = "tzname";
static const char __pyx_k_GMT_0_2[] = "GMT-0";
static const char __pyx_k_LOCALTZ[] = "LOCALTZ";
static const char __pyx_k_MS_HOUR[] = "MS_HOUR";
static const char __pyx_k_NS_HOUR[] = "NS_HOUR";
static const char __pyx_k_SS_HOUR[] = "SS_HOUR";
static const char __pyx_k_US_HOUR[] = "US_HOUR";
static const char __pyx_k_cytimes[] = "cytimes";
static const char __pyx_k_fromutc[] = "fromutc";
static const char __pyx_k_is_leap[] = "_is_leap";
static const char __pyx_k_minutes[] = "minutes";
static const char __pyx_k_my_unit[] = "my_unit";
static const char __pyx_k_ord2ymd[] = "_ord2ymd";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_tm_hour[] = "tm_hour";
static const char __pyx_k_tm_mday[] = "tm_mday";
static const char __pyx_k_tm_wday[] = "tm_wday";
static const char __pyx_k_tm_yday[] = "tm_yday";
static const char __pyx_k_tm_year[] = "tm_year";
static const char __pyx_k_to_unit[] = "to_unit";
static const char __pyx_k_typeref[] = "typeref";
static const char __pyx_k_weekday[] = "weekday";
static const char __pyx_k_ymd2ord[] = "_ymd2ord";
static const char __pyx_k_00_00_01[] = "00:00:01";
static const char __pyx_k_00_01_01[] = "00:01:01";
static const char __pyx_k_03_04_05[] = "03:04:05";
static const char __pyx_k_2021_000[] = "2021-000";
static const char __pyx_k_2021_365[] = "2021-365";
static const char __pyx_k_2021_367[] = "2021-367";
static const char __pyx_k_24_01_01[] = "24:01:01";
static const char __pyx_k_CustomTD[] = "CustomTD";
static const char __pyx_k_EPOCH_DT[] = "EPOCH_DT";
static const char __pyx_k_LOCAL_TZ[] = "_LOCAL_TZ";
static const char __pyx_k_ZoneInfo[] = "ZoneInfo";
static const char __pyx_k_datetime[] = "datetime";
static const char __pyx_k_iso_calr[] = "iso_calr";
static const char __pyx_k_iso_week[] = "iso_week";
static const char __pyx_k_iso_year[] = "iso_year";
static const char __pyx_k_localize[] = "localize";
static const char __pyx_k_pyx_capi[] = "__pyx_capi__";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_set_name[] = "__set_name__";
static const char __pyx_k_time_tz1[] = "time_tz1";
static const char __pyx_k_time_tz2[] = "time_tz2";
static const char __pyx_k_timezone[] = "timezone";
static const char __pyx_k_tm_isdst[] = "tm_isdst";
static const char __pyx_k_zoneinfo[] = "zoneinfo";
static const char __pyx_k_00_00_02d[] = "-00:00:%02d";
static const char __pyx_k_EPOCH_DAY[] = "EPOCH_DAY";
static const char __pyx_k_Greenwich[] = "Greenwich";
static const char __pyx_k_MS_MINUTE[] = "MS_MINUTE";
static const char __pyx_k_MS_SECOND[] = "MS_SECOND";
static const char __pyx_k_NS_MINUTE[] = "NS_MINUTE";
static const char __pyx_k_NS_SECOND[] = "NS_SECOND";
static const char __pyx_k_SS_MINUTE[] = "SS_MINUTE";
static const char __pyx_k_Timestamp[] = "Timestamp";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_US_MINUTE[] = "US_MINUTE";
static const char __pyx_k_US_SECOND[] = "US_SECOND";
static const char __pyx_k_Universal[] = "Universal";
static const char __pyx_k_localtime[] = "localtime";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_timedelta[] = "timedelta";
static const char __pyx_k_timestamp[] = "timestamp";
static const char __pyx_k_timetuple[] = "timetuple";
static const char __pyx_k_toordinal[] = "toordinal";
static const char __pyx_k_utcoffset[] = "utcoffset";
static const char __pyx_k_00_00_01_2[] = "-00:00:01";
static const char __pyx_k_00_01_01_2[] = "-00:01:01";
static const char __pyx_k_01_02_2021[] = "01/02/2021";
static const char __pyx_k_2021_01_02[] = "2021-01-02";
static const char __pyx_k_2021_W52_6[] = "2021-W52-6";
static const char __pyx_k_24_01_01_2[] = "-24:01:01";
static const char __pyx_k_CustomDate[] = "CustomDate";
static const char __pyx_k_CustomTime[] = "CustomTime";
static const char __pyx_k_EPOCH_HOUR[] = "EPOCH_HOUR";
static const char __pyx_k_EPOCH_YEAR[] = "EPOCH_YEAR";
static const char __pyx_k_MAXORDINAL[] = "_MAXORDINAL";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_datetime64[] = "datetime64";
static const char __pyx_k_pydatetime[] = "_pydatetime";
static const char __pyx_k_resolution[] = "' resolution.\n";
static const char __pyx_k_test_utils[] = "_test_utils";
static const char __pyx_k_EPOCH_MONTH[] = "EPOCH_MONTH";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_MemoryError[] = "MemoryError";
static const char __pyx_k_ORDINAL_MAX[] = "ORDINAL_MAX";
static const char __pyx_k_TD64_MM_DAY[] = "TD64_MM_DAY";
static const char __pyx_k_TD64_YY_DAY[] = "TD64_YY_DAY";
static const char __pyx_k_babel_dates[] = "babel.dates";
static const char __pyx_k_cannot_cast[] = "cannot cast ";
static const char __pyx_k_isocalendar[] = "isocalendar";
static const char __pyx_k_microsecond[] = "microsecond";
static const char __pyx_k_mro_entries[] = "__mro_entries__";
static const char __pyx_k_test_parser[] = "_test_parser";
static const char __pyx_k_timedelta64[] = "timedelta64";
static const char __pyx_k_00_00_00_06d[] = "-00:00:00.%06d";
static const char __pyx_k_EPOCH_MINUTE[] = "EPOCH_MINUTE";
static const char __pyx_k_EPOCH_SECOND[] = "EPOCH_SECOND";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_TIMEZONE_MAP[] = "_TIMEZONE_MAP";
static const char __pyx_k_datetime64_2[] = "datetime64[";
static const char __pyx_k_datetime64_D[] = "datetime64[D]";
static const char __pyx_k_datetime64_M[] = "datetime64[M]";
static const char __pyx_k_datetime64_W[] = "datetime64[W]";
static const char __pyx_k_datetime64_Y[] = "datetime64[Y]";
static const char __pyx_k_datetime64_h[] = "datetime64[h]";
static const char __pyx_k_datetime64_m[] = "datetime64[m]";
static const char __pyx_k_datetime64_s[] = "datetime64[%s]";
static const char __pyx_k_initializing[] = "_initializing";
static const char __pyx_k_is_coroutine[] = "_is_coroutine";
static const char __pyx_k_microseconds[] = "microseconds";
static const char __pyx_k_milliseconds[] = "milliseconds";
static const char __pyx_k_test_weekday[] = "_test_weekday";
static const char __pyx_k_utctimetuple[] = "utctimetuple";
static const char __pyx_k_03_04_05_0101[] = "03:04:05+0101";
static const char __pyx_k_Asia_Shanghai[] = "Asia/Shanghai";
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_Passed_parser[] = "Passed: parser";
static const char __pyx_k_class_getitem[] = "__class_getitem__";
static const char __pyx_k_cytimes_utils[] = "cytimes.utils";
static const char __pyx_k_datetime64_ms[] = "datetime64[ms]";
static const char __pyx_k_datetime64_ns[] = "datetime64[ns]";
static const char __pyx_k_datetime64_us[] = "datetime64[us]";
static const char __pyx_k_days_in_month[] = "_days_in_month";
static const char __pyx_k_fromtimestamp[] = "fromtimestamp";
static const char __pyx_k_init_subclass[] = "__init_subclass__";
static const char __pyx_k_m_d_Y_f_S_M_H[] = "%m/%d/%Y %f.%S-%M-%H";
static const char __pyx_k_timedelta64_2[] = "timedelta64[";
static const char __pyx_k_timedelta64_s[] = "timedelta64[%s]";
static const char __pyx_k_to_datetime64[] = "] to datetime64[";
static const char __pyx_k_total_seconds[] = "total_seconds";
static const char __pyx_k_AssertionError[] = "AssertionError";
static const char __pyx_k_CustomDateTime[] = "CustomDateTime";
static const char __pyx_k_DT64_NS_DD_MAX[] = "DT64_NS_DD_MAX";
static const char __pyx_k_DT64_NS_DD_MIN[] = "DT64_NS_DD_MIN";
static const char __pyx_k_DT64_NS_HH_MAX[] = "DT64_NS_HH_MAX";
static const char __pyx_k_DT64_NS_HH_MIN[] = "DT64_NS_HH_MIN";
static const char __pyx_k_DT64_NS_MI_MAX[] = "DT64_NS_MI_MAX";
static const char __pyx_k_DT64_NS_MI_MIN[] = "DT64_NS_MI_MIN";
static const char __pyx_k_DT64_NS_MM_MAX[] = "DT64_NS_MM_MAX";
static const char __pyx_k_DT64_NS_MM_MIN[] = "DT64_NS_MM_MIN";
static const char __pyx_k_DT64_NS_MS_MAX[] = "DT64_NS_MS_MAX";
static const char __pyx_k_DT64_NS_MS_MIN[] = "DT64_NS_MS_MIN";
static const char __pyx_k_DT64_NS_NS_MAX[] = "DT64_NS_NS_MAX";
static const char __pyx_k_DT64_NS_NS_MIN[] = "DT64_NS_NS_MIN";
static const char __pyx_k_DT64_NS_SS_MAX[] = "DT64_NS_SS_MAX";
static const char __pyx_k_DT64_NS_SS_MIN[] = "DT64_NS_SS_MIN";
static const char __pyx_k_DT64_NS_US_MAX[] = "DT64_NS_US_MAX";
static const char __pyx_k_DT64_NS_US_MIN[] = "DT64_NS_US_MIN";
static const char __pyx_k_DT64_NS_WW_MAX[] = "DT64_NS_WW_MAX";
static const char __pyx_k_DT64_NS_WW_MIN[] = "DT64_NS_WW_MIN";
static const char __pyx_k_DT64_NS_YY_MAX[] = "DT64_NS_YY_MAX";
static const char __pyx_k_DT64_NS_YY_MIN[] = "DT64_NS_YY_MIN";
static const char __pyx_k_NS_MICROSECOND[] = "NS_MICROSECOND";
static const char __pyx_k_NS_MILLISECOND[] = "NS_MILLISECOND";
static const char __pyx_k_Passed_weekday[] = "Passed: weekday";
static const char __pyx_k_TD64_MM_SECOND[] = "TD64_MM_SECOND";
static const char __pyx_k_TD64_YY_SECOND[] = "TD64_YY_SECOND";
static const char __pyx_k_US_MILLISECOND[] = "US_MILLISECOND";
static const char __pyx_k_datetime64_s_2[] = "datetime64[s]";
static const char __pyx_k_isoweek1monday[] = "_isoweek1monday";
static const char __pyx_k_test_dt_tzinfo[] = "_test_dt_tzinfo";
static const char __pyx_k_timedelta64_ns[] = "timedelta64[ns]";
static const char __pyx_k_timedelta64_us[] = "timedelta64[us]";
static const char __pyx_k_to_int64_under[] = "]'> to int64 under '";
static const char __pyx_k_03_04_05_000006[] = "03:04:05.000006";
static const char __pyx_k_24_01_01_000001[] = "24:01:01.000001";
static const char __pyx_k_24_01_01_001000[] = "24:01:01.001000";
static const char __pyx_k_24_01_01_001001[] = "24:01:01.001001";
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_m_d_Y_f_S_M_H_Z[] = "%m/%d/%Y %f.%S-%M-%H%Z";
static const char __pyx_k_m_d_Y_f_S_M_H_z[] = "%m/%d/%Y %f.%S-%M-%H%z";
static const char __pyx_k_Passed_dt_tzinfo[] = "Passed: dt_tzinfo";
static const char __pyx_k_days_before_year[] = "_days_before_year";
static const char __pyx_k_invalid_timezone[] = "invalid timezone '";
static const char __pyx_k_is_not_supported[] = "' is not supported.";
static const char __pyx_k_test_dt_generate[] = "_test_dt_generate";
static const char __pyx_k_test_isocalendar[] = "_test_isocalendar";
static const char __pyx_k_test_numpy_share[] = "_test_numpy_share";
static const char __pyx_k_test_time_tzinfo[] = "_test_time_tzinfo";
static const char __pyx_k_to_int64_under_2[] = "]] to int64 under '";
static const char __pyx_k_to_int64_under_3[] = "] to int64 under '";
static const char __pyx_k_24_01_01_000001_2[] = "-24:01:01.000001";
static const char __pyx_k_24_01_01_001000_2[] = "-24:01:01.001000";
static const char __pyx_k_24_01_01_001001_2[] = "-24:01:01.001001";
static const char __pyx_k_EPOCH_MICROSECOND[] = "EPOCH_MICROSECOND";
static const char __pyx_k_EPOCH_MILLISECOND[] = "EPOCH_MILLISECOND";
static const char __pyx_k_ZeroDivisionError[] = "ZeroDivisionError";
static const char __pyx_k_days_before_month[] = "_days_before_month";
static const char __pyx_k_test_days_bf_year[] = "_test_days_bf_year";
static const char __pyx_k_test_is_leap_year[] = "_test_is_leap_year";
static const char __pyx_k_Passed_dt_generate[] = "Passed: dt_generate";
static const char __pyx_k_Passed_isocalendar[] = "Passed: isocalendar";
static const char __pyx_k_Passed_numpy_share[] = "Passed: numpy_share";
static const char __pyx_k_Passed_time_tzinfo[] = "Passed: time_tzinfo";
static const char __pyx_k_TD64_MM_NANOSECOND[] = "TD64_MM_NANOSECOND";
static const char __pyx_k_TD64_YY_NANOSECOND[] = "TD64_YY_NANOSECOND";
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_is_not_supported_2[] = "]' is not supported";
static const char __pyx_k_is_not_supported_3[] = "]' is not supported.";
static const char __pyx_k_test_date_generate[] = "_test_date_generate";
static const char __pyx_k_test_days_bf_month[] = "_test_days_bf_month";
static const char __pyx_k_test_days_in_month[] = "_test_days_in_month";
static const char __pyx_k_test_dt_arithmetic[] = "_test_dt_arithmetic";
static const char __pyx_k_test_dt_conversion[] = "_test_dt_conversion";
static const char __pyx_k_test_dt_type_check[] = "_test_dt_type_check";
static const char __pyx_k_test_time_generate[] = "_test_time_generate";
static const char __pyx_k_test_tzinfo_access[] = "_test_tzinfo_access";
static const char __pyx_k_with_datetime_unit[] = " with datetime unit '";
static const char __pyx_k_2021_01_02T03_04_05[] = "2021-01-02T03:04:05";
static const char __pyx_k_Passed_days_bf_year[] = "Passed: days_bf_year";
static const char __pyx_k_Passed_is_leap_year[] = "Passed: is_leap_year";
static const char __pyx_k_TD64_MM_MICROSECOND[] = "TD64_MM_MICROSECOND";
static const char __pyx_k_TD64_MM_MILLISECOND[] = "TD64_MM_MILLISECOND";
static const char __pyx_k_TD64_YY_MICROSECOND[] = "TD64_YY_MICROSECOND";
static const char __pyx_k_TD64_YY_MILLISECOND[] = "TD64_YY_MILLISECOND";
static const char __pyx_k_available_timezones[] = "available_timezones";
static const char __pyx_k_cannot_cast_ndarray[] = "cannot cast <'ndarray[";
static const char __pyx_k_test_dt_mainipulate[] = "_test_dt_mainipulate";
static const char __pyx_k_test_iso_1st_monday[] = "_test_iso_1st_monday";
static const char __pyx_k_test_ymd_fr_ordinal[] = "_test_ymd_fr_ordinal";
static const char __pyx_k_test_ymd_to_ordinal[] = "_test_ymd_to_ordinal";
static const char __pyx_k_to_an_integer_under[] = "] to an integer under '";
static const char __pyx_k_03_04_05_000006_0101[] = "03:04:05.000006+0101";
static const char __pyx_k_InvalidTimezoneError[] = "InvalidTimezoneError";
static const char __pyx_k_Passed_date_generate[] = "Passed: date_generate";
static const char __pyx_k_Passed_days_bf_month[] = "Passed: days_bf_month";
static const char __pyx_k_Passed_days_in_month[] = "Passed: days_in_month";
static const char __pyx_k_Passed_dt_conversion[] = "Passed: dt_conversion";
static const char __pyx_k_Passed_dt_manipulate[] = "Passed: dt_manipulate";
static const char __pyx_k_Passed_dt_type_check[] = "Passed: dt_type_check";
static const char __pyx_k_Passed_time_generate[] = "Passed: time_generate";
static const char __pyx_k_Passed_tzinfo_access[] = "Passed: tzinfo_access";
static const char __pyx_k_cannot_check_ndarray[] = "cannot check <'ndarray[";
static const char __pyx_k_isoweek_to_gregorian[] = "_isoweek_to_gregorian";
static const char __pyx_k_src_cytimes_utils_py[] = "src/cytimes/utils.py";
static const char __pyx_k_test_date_conversion[] = "_test_date_conversion";
static const char __pyx_k_test_date_type_check[] = "_test_date_type_check";
static const char __pyx_k_test_days_in_quarter[] = "_test_days_in_quarter";
static const char __pyx_k_test_time_conversion[] = "_test_time_conversion";
static const char __pyx_k_test_time_type_check[] = "_test_time_type_check";
static const char __pyx_k_test_tzinfo_generate[] = "_test_tzinfo_generate";
static const char __pyx_k_Passed_iso_1st_monday[] = "Passed: iso_1st_monday";
static const char __pyx_k_Passed_ymd_fr_ordinal[] = "Passed: ymd_fr_ordinal";
static const char __pyx_k_Passed_ymd_to_ordinal[] = "Passed: ymd_to_ordinal";
static const char __pyx_k_cannot_cast_ndarray_2[] = "cannot cast ndarray[";
static const char __pyx_k_test_quarter_of_month[] = "_test_quarter_of_month";
static const char __pyx_k_to_an_integer_under_2[] = " to an integer under '";
static const char __pyx_k_Passed_date_arithmetic[] = "Passed: date_arithmetic";
static const char __pyx_k_Passed_date_conversion[] = "Passed: date_conversion";
static const char __pyx_k_Passed_date_type_check[] = "Passed: date_type_check";
static const char __pyx_k_Passed_days_in_quarter[] = "Passed: days_in_quarter";
static const char __pyx_k_Passed_time_conversion[] = "Passed: time_conversion";
static const char __pyx_k_Passed_time_type_check[] = "Passed: time_type_check";
static const char __pyx_k_Passed_tzinfo_generate[] = "Passed: tzinfo_generate";
static const char __pyx_k_cannot_convert_ndarray[] = "cannot convert <'ndarray[";
static const char __pyx_k_test_tzinfo_type_check[] = "_test_tzinfo_type_check";
static const char __pyx_k_Passed_localtime_gmtime[] = "Passed: localtime & gmtime";
static const char __pyx_k_Passed_quarter_of_month[] = "Passed: quarter_of_month";
static const char __pyx_k_datetime_s_is_ambiguous[] = "datetime '%s' is ambiguous.";
static const char __pyx_k_test_localtime_n_gmtime[] = "_test_localtime_n_gmtime";
static const char __pyx_k_test_ndarray_type_check[] = "_test_ndarray_type_check";
static const char __pyx_k_test_timedelta_generate[] = "_test_timedelta_generate";
static const char __pyx_k_test_ymd_fr_isocalendar[] = "_test_ymd_fr_isocalendar";
static const char __pyx_k_unknown_datetime_unit_d[] = "unknown datetime unit '%d'.";
static const char __pyx_k_unknown_datetime_unit_s[] = "unknown datetime unit '%s'.";
static const char __pyx_k_2021_01_02_03_04_05_0101[] = "2021-01-02 03:04:05+0101";
static const char __pyx_k_Passed_tzinfo_type_check[] = "Passed: tzinfo_type_check";
static const char __pyx_k_int64_under_D_resolution[] = "int64 under 'D' resolution";
static const char __pyx_k_int64_under_M_resolution[] = "int64 under 'M' resolution";
static const char __pyx_k_int64_under_Y_resolution[] = "int64 under 'Y' resolution";
static const char __pyx_k_int64_under_h_resolution[] = "int64 under 'h' resolution";
static const char __pyx_k_int64_under_m_resolution[] = "int64 under 'm' resolution";
static const char __pyx_k_int64_under_s_resolution[] = "int64 under 's' resolution";
static const char __pyx_k_Passed_ndarray_type_check[] = "Passed: ndarray_type_check";
static const char __pyx_k_Passed_timedelta_generate[] = "Passed: timedelta_generate";
static const char __pyx_k_Passed_ymd_fr_isocalendar[] = "Passed: ymd_fr_isocalendar";
static const char __pyx_k_cannot_ceil_to_multiple_0[] = "cannot ceil to multiple 0.";
static const char __pyx_k_int64_under_ms_resolution[] = "int64 under 'ms' resolution";
static const char __pyx_k_int64_under_ns_resolution[] = "int64 under 'ns' resolution";
static const char __pyx_k_int64_under_us_resolution[] = "int64 under 'us' resolution";
static const char __pyx_k_test_timedelta_conversion[] = "_test_timedelta_conversion";
static const char __pyx_k_test_timedelta_type_check[] = "_test_timedelta_type_check";
static const char __pyx_k_01_02_2021_000006_05_04_03[] = "01/02/2021 000006.05-04-03";
static const char __pyx_k_2021_01_02T03_04_05_000006[] = "2021-01-02T03:04:05.000006";
static const char __pyx_k_2021_01_02T03_04_05_006007[] = "2021-01-02T03:04:05.006007";
static const char __pyx_k_cannot_floor_to_multiple_0[] = "cannot floor to multiple 0.";
static const char __pyx_k_cannot_round_to_multiple_0[] = "cannot round to multiple 0.";
static const char __pyx_k_test_datetime64_conversion[] = "_test_datetime64_conversion";
static const char __pyx_k_test_datetime64_type_check[] = "_test_datetime64_type_check";
static const char __pyx_k_Passed_timedelta_conversion[] = "Passed: timedelta_conversion";
static const char __pyx_k_Passed_timedelta_type_chech[] = "Passed: timedelta_type_chech";
static const char __pyx_k_division_by_zero_in_arr_mod[] = "division by zero in 'arr_mod()'.";
static const char __pyx_k_expects_np_datetime64_got_s[] = "expects 'np.datetime64', got %s.";
static const char __pyx_k_resolution_is_not_supported[] = "' resolution is not supported.";
static const char __pyx_k_test_timedelta64_conversion[] = "_test_timedelta64_conversion";
static const char __pyx_k_test_timedelta64_type_check[] = "_test_timedelta64_type_check";
static const char __pyx_k_unsupported_datetime_unit_s[] = "unsupported datetime unit '%s'.";
static const char __pyx_k_Failed_datetime64_type_check[] = "Failed: datetime64_type_check";
static const char __pyx_k_Passed_datetime64_conversion[] = "Passed: datetime64_conversion";
static const char __pyx_k_Passed_datetime64_type_check[] = "Passed: datetime64_type_check";
static const char __pyx_k_expects_np_timedelta64_got_s[] = "expects 'np.timedelta64', got %s.";
static const char __pyx_k_test_ndarray_dt64_conversion[] = "_test_ndarray_dt64_conversion";
static const char __pyx_k_test_ndarray_dt64_type_check[] = "_test_ndarray_dt64_type_check";
static const char __pyx_k_test_ndarray_td64_conversion[] = "_test_ndarray_td64_conversion";
static const char __pyx_k_test_ndarray_td64_type_check[] = "_test_ndarray_td64_type_check";
static const char __pyx_k_Failed_timedelta64_type_check[] = "Failed: timedelta64_type_check";
static const char __pyx_k_Passed_timedelta64_conversion[] = "Passed: timedelta64_conversion";
static const char __pyx_k_Passed_timedelta64_type_check[] = "Passed: timedelta64_type_check";
static const char __pyx_k_expects_datetime_tzinfo_got_s[] = "expects 'datetime.tzinfo', got %s.";
static const char __pyx_k_strftime_format_is_too_long_s[] = "strftime format is too long:\n'%s'";
static const char __pyx_k_Array_with_dtype_of_datetime64[] = "]].\nArray with dtype of 'datetime64[";
static const char __pyx_k_Passed_ndarray_dt64_conversion[] = "Passed: ndarray_dt64_conversion";
static const char __pyx_k_Passed_ndarray_dt64_type_check[] = "Passed: ndarray_dt64_type_check";
static const char __pyx_k_Passed_ndarray_td64_conversion[] = "Passed: ndarray_td64_conversion";
static const char __pyx_k_Passed_ndarray_td64_type_check[] = "Passed: ndarray_td64_type_check";
static const char __pyx_k_resolution_Array_with_datetime[] = "' resolution.\nArray with datetime unit '";
static const char __pyx_k_resolution_Array_with_dtype_of[] = "' resolution.\nArray with dtype of '";
static const char __pyx_k_01_02_2021_000006_05_04_03_0101[] = "01/02/2021 000006.05-04-03+0101";
static const char __pyx_k_2021_01_02_03_04_05_000006_0101[] = "2021-01-02 03:04:05.000006+0101";
static const char __pyx_k_Conversion_limits_to_datetime_u[] = "].\nConversion limits to datetime units between ['s', 'ms', 'us', 'ns'].";
static const char __pyx_k_For_comparision_array_size_must[] = "For comparision, array size must be > 0.";
static const char __pyx_k_array_size_must_be_greater_than[] = "array size must be greater than 0.";
static const char __pyx_k_division_by_zero_for_utils_math[] = "division by zero for 'utils.math_mod()'.";
static const char __pyx_k_nanosecond_conversion_range_dat[] = "]'> nanosecond conversion range, datetime unit '";
static const char __pyx_k_ndarray_size_must_be_an_integer[] = "ndarray size must be an integer greater than 0.";
static const char __pyx_k_operation_on_ndarray_datetime64[] = " operation on <'ndarray[datetime64[";
static const char __pyx_k_resolution_Supported_resolution[] = "' resolution.\nSupported resolutions: ['Y', 'M', 'D', 'h', 'm', 's', 'ms', 'us', 'ns'].";
static const char __pyx_k_test_date_conversion_locals_Cus[] = "_test_date_conversion.<locals>.CustomDate";
static const char __pyx_k_test_date_type_check_locals_Cus[] = "_test_date_type_check.<locals>.CustomDate";
static const char __pyx_k_test_dt_type_check_locals_Custo[] = "_test_dt_type_check.<locals>.CustomDateTime";
static const char __pyx_k_test_time_conversion_locals_Cus[] = "_test_time_conversion.<locals>.CustomTime";
static const char __pyx_k_test_time_type_check_locals_Cus[] = "_test_time_type_check.<locals>.CustomTime";
static const char __pyx_k_test_timedelta_conversion_local[] = "_test_timedelta_conversion.<locals>.CustomTD";
static const char __pyx_k_test_timedelta_type_check_local[] = "_test_timedelta_type_check.<locals>.CustomTD";
static const char __pyx_k_without_specifying_the_array_da[] = " without specifying the array datetime unit.";
static const char __pyx_k_01_02_2021_000006_05_04_03UTC_01[] = "01/02/2021 000006.05-04-03UTC+01:01";
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_cannot_access_the_time_value_fro[] = "cannot access the time value from ndarray[datetime64[";
static const char __pyx_k_cannot_check_if_ndarray_s_is_wit[] = "cannot check if <'ndarray[%s]'> is within nanosecond conversion range without specifying the array datetime unit.";
static const char __pyx_k_cannot_compare_ndarrays_with_dif[] = "cannot compare ndarrays with different shapes.";
static const char __pyx_k_cannot_convert_ndarray_from_date[] = "cannot convert ndarray from datetime64[";
static const char __pyx_k_cannot_perform_addition_on_ndarr[] = "cannot perform addition on ndarrays with different shapes.";
static const char __pyx_k_cannot_perform_comparison_on_nda[] = "cannot perform comparison on ndarrays with different shapes.";
static const char __pyx_k_cannot_perform_subtraction_on_nd[] = "cannot perform subtraction on ndarrays with different shapes.";
static const char __pyx_k_division_by_zero_for_utils_arr_c[] = "division by zero for 'utils.arr_ceil_div()'.";
static const char __pyx_k_division_by_zero_for_utils_arr_f[] = "division by zero for 'utils.arr_floor_div()'.";
static const char __pyx_k_division_by_zero_for_utils_arr_r[] = "division by zero for 'utils.arr_round_div()'.";
static const char __pyx_k_expects_np_ndarray_datetime64_go[] = "expects np.ndarray[datetime64], got '%s'.";
static const char __pyx_k_expects_np_ndarray_datetime64_ti[] = "expects np.ndarray[datetime64/timedelta64], got '%s'.";
static const char __pyx_k_expects_np_ndarray_timedelta64_g[] = "expects np.ndarray[timedelta64], got '%s'.";
static const char __pyx_k_failed_to_allocate_memory_for_st[] = "failed to allocate memory for string slice.";
static const char __pyx_k_invalid_character_s_as_an_intege[] = "invalid character '%s' as an integer.";
static const char __pyx_k_numpy__core_multiarray_failed_to[] = "numpy._core.multiarray failed to import";
static const char __pyx_k_numpy__core_umath_failed_to_impo[] = "numpy._core.umath failed to import";
static const char __pyx_k_support_ndarray_with_1_4_dimensi[] = "support <'ndarray'> with 1-4 dimensions, got ndim '%d'.";
static const char __pyx_k_timezone_offset_s_seconds_out_of[] = "timezone offset '%s' (seconds) out of range, must between -86340 and 86340.";
static const char __pyx_k_unable_to_parse_datetime_unit_fr[] = "unable to parse datetime unit from '%s'.";
static const char __pyx_k_unsupported_factor_d_for_timedel[] = "unsupported factor '%d' for timedelta unit 'Y' conversion.";
static const char __pyx_k_division_by_zero_for_utils_math_2[] = "division by zero for 'utils.math_round_div()'.";
static const char __pyx_k_division_by_zero_for_utils_math_3[] = "division by zero for 'utils.math_ceil_div()'.";
static const char __pyx_k_division_by_zero_for_utils_math_4[] = "division by zero for 'utils.math_floor_div()'.";
static const char __pyx_k_expects_np_ndarray_datetime64_ti_2[] = "expects 'np.ndarray[datetime64/timedelta64]', got '%s'.";
static const char __pyx_k_unsupported_factor_d_for_timedel_2[] = "unsupported factor '%d' for timedelta unit 'M' conversion.";
/* #### Code section: decls ### */
static PyObject *__pyx_pf_7cytimes_5utils__test_utils(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_2_test_parser(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_4_test_localtime_n_gmtime(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_6_test_is_leap_year(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_8_test_days_bf_year(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_10_test_quarter_of_month(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_12_test_days_in_quarter(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_14_test_days_in_month(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_16_test_days_bf_month(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_18_test_weekday(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_20_test_isocalendar(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_22_test_iso_1st_monday(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_24_test_ymd_to_ordinal(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_26_test_ymd_fr_ordinal(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_28_test_ymd_fr_isocalendar(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_30_test_date_generate(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_32_test_date_type_check(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_34_test_date_conversion(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_36_test_dt_generate(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_38_test_dt_type_check(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_40_test_dt_tzinfo(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_42_test_dt_conversion(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_44_test_dt_mainipulate(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_46_test_dt_arithmetic(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_48_test_time_generate(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_50_test_time_type_check(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_52_test_time_tzinfo(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_54_test_time_conversion(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_56_test_timedelta_generate(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_58_test_timedelta_type_check(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_60_test_timedelta_conversion(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_62_test_tzinfo_generate(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_64_test_tzinfo_type_check(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_66_test_tzinfo_access(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_68_test_numpy_share(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_70_test_datetime64_type_check(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_72_test_datetime64_conversion(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_74_test_timedelta64_type_check(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_76_test_timedelta64_conversion(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_78_test_ndarray_type_check(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_80_test_ndarray_dt64_type_check(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_82_test_ndarray_dt64_conversion(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_84_test_ndarray_td64_type_check(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7cytimes_5utils_86_test_ndarray_td64_conversion(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  #ifdef __Pyx_CyFunction_USED
  PyTypeObject *__pyx_CyFunctionType;
  #endif
  #ifdef __Pyx_FusedFunction_USED
  PyTypeObject *__pyx_FusedFunctionType;
  #endif
  #ifdef __Pyx_Generator_USED
  PyTypeObject *__pyx_GeneratorType;
  #endif
  #ifdef __Pyx_IterableCoroutine_USED
  PyTypeObject *__pyx_IterableCoroutineType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineAwaitType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineType;
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_7cpython_4type_type;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_7cpython_4bool_bool;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_7cpython_7complex_complex;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_5numpy_dtype;
  PyTypeObject *__pyx_ptype_5numpy_flatiter;
  PyTypeObject *__pyx_ptype_5numpy_broadcast;
  PyTypeObject *__pyx_ptype_5numpy_ndarray;
  PyTypeObject *__pyx_ptype_5numpy_generic;
  PyTypeObject *__pyx_ptype_5numpy_number;
  PyTypeObject *__pyx_ptype_5numpy_integer;
  PyTypeObject *__pyx_ptype_5numpy_signedinteger;
  PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
  PyTypeObject *__pyx_ptype_5numpy_inexact;
  PyTypeObject *__pyx_ptype_5numpy_floating;
  PyTypeObject *__pyx_ptype_5numpy_complexfloating;
  PyTypeObject *__pyx_ptype_5numpy_flexible;
  PyTypeObject *__pyx_ptype_5numpy_character;
  PyTypeObject *__pyx_ptype_5numpy_ufunc;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #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
  PyObject *__pyx_kp_u_00;
  PyObject *__pyx_kp_u_00_00;
  PyObject *__pyx_kp_u_00_00_00_06d;
  PyObject *__pyx_kp_u_00_00_01;
  PyObject *__pyx_kp_u_00_00_01_2;
  PyObject *__pyx_kp_u_00_00_02d;
  PyObject *__pyx_kp_u_00_01_01;
  PyObject *__pyx_kp_u_00_01_01_2;
  PyObject *__pyx_kp_u_0101;
  PyObject *__pyx_kp_u_0101_2;
  PyObject *__pyx_kp_u_01_02_2021;
  PyObject *__pyx_kp_u_01_02_2021_000006_05_04_03;
  PyObject *__pyx_kp_u_01_02_2021_000006_05_04_03UTC_01;
  PyObject *__pyx_kp_u_01_02_2021_000006_05_04_03_0101;
  PyObject *__pyx_kp_u_02d;
  PyObject *__pyx_kp_u_03_04_05;
  PyObject *__pyx_kp_u_03_04_05_000006;
  PyObject *__pyx_kp_u_03_04_05_000006_0101;
  PyObject *__pyx_kp_u_03_04_05_0101;
  PyObject *__pyx_kp_u_04d;
  PyObject *__pyx_kp_u_06d;
  PyObject *__pyx_kp_u_06d_2;
  PyObject *__pyx_kp_u_2021_000;
  PyObject *__pyx_kp_u_2021_01_02;
  PyObject *__pyx_kp_u_2021_01_02T03_04_05;
  PyObject *__pyx_kp_u_2021_01_02T03_04_05_000006;
  PyObject *__pyx_kp_u_2021_01_02T03_04_05_006007;
  PyObject *__pyx_kp_u_2021_01_02_03_04_05_000006_0101;
  PyObject *__pyx_kp_u_2021_01_02_03_04_05_0101;
  PyObject *__pyx_kp_u_2021_365;
  PyObject *__pyx_kp_u_2021_367;
  PyObject *__pyx_kp_u_2021_W52_6;
  PyObject *__pyx_kp_u_2359;
  PyObject *__pyx_kp_u_2359_2;
  PyObject *__pyx_kp_u_24_01_01;
  PyObject *__pyx_kp_u_24_01_01_000001;
  PyObject *__pyx_kp_u_24_01_01_000001_2;
  PyObject *__pyx_kp_u_24_01_01_001000;
  PyObject *__pyx_kp_u_24_01_01_001000_2;
  PyObject *__pyx_kp_u_24_01_01_001001;
  PyObject *__pyx_kp_u_24_01_01_001001_2;
  PyObject *__pyx_kp_u_24_01_01_2;
  PyObject *__pyx_kp_u_2d;
  PyObject *__pyx_n_u_Apr;
  PyObject *__pyx_kp_u_Array_with_dtype_of_datetime64;
  PyObject *__pyx_kp_u_Asia_Shanghai;
  PyObject *__pyx_n_s_AssertionError;
  PyObject *__pyx_n_u_Aug;
  PyObject *__pyx_n_u_CET;
  PyObject *__pyx_n_u_CST;
  PyObject *__pyx_kp_u_Conversion_limits_to_datetime_u;
  PyObject *__pyx_n_s_CustomDate;
  PyObject *__pyx_n_s_CustomDateTime;
  PyObject *__pyx_n_s_CustomTD;
  PyObject *__pyx_n_s_CustomTime;
  PyObject *__pyx_n_u_D;
  PyObject *__pyx_n_s_DAYS_BR_MONTH;
  PyObject *__pyx_n_s_DAYS_BR_QUARTER;
  PyObject *__pyx_n_s_DAYS_IN_MONTH;
  PyObject *__pyx_n_s_DAYS_IN_QUARTER;
  PyObject *__pyx_n_s_DT64_NS_DD_MAX;
  PyObject *__pyx_n_s_DT64_NS_DD_MIN;
  PyObject *__pyx_n_s_DT64_NS_HH_MAX;
  PyObject *__pyx_n_s_DT64_NS_HH_MIN;
  PyObject *__pyx_n_s_DT64_NS_MI_MAX;
  PyObject *__pyx_n_s_DT64_NS_MI_MIN;
  PyObject *__pyx_n_s_DT64_NS_MM_MAX;
  PyObject *__pyx_n_s_DT64_NS_MM_MIN;
  PyObject *__pyx_n_s_DT64_NS_MS_MAX;
  PyObject *__pyx_n_s_DT64_NS_MS_MIN;
  PyObject *__pyx_n_s_DT64_NS_NS_MAX;
  PyObject *__pyx_n_s_DT64_NS_NS_MIN;
  PyObject *__pyx_n_s_DT64_NS_SS_MAX;
  PyObject *__pyx_n_s_DT64_NS_SS_MIN;
  PyObject *__pyx_n_s_DT64_NS_US_MAX;
  PyObject *__pyx_n_s_DT64_NS_US_MIN;
  PyObject *__pyx_n_s_DT64_NS_WW_MAX;
  PyObject *__pyx_n_s_DT64_NS_WW_MIN;
  PyObject *__pyx_n_s_DT64_NS_YY_MAX;
  PyObject *__pyx_n_s_DT64_NS_YY_MIN;
  PyObject *__pyx_n_u_Dec;
  PyObject *__pyx_n_s_EPOCH_DAY;
  PyObject *__pyx_n_s_EPOCH_DT;
  PyObject *__pyx_n_s_EPOCH_HOUR;
  PyObject *__pyx_n_s_EPOCH_MICROSECOND;
  PyObject *__pyx_n_s_EPOCH_MILLISECOND;
  PyObject *__pyx_n_s_EPOCH_MINUTE;
  PyObject *__pyx_n_s_EPOCH_MONTH;
  PyObject *__pyx_n_s_EPOCH_SECOND;
  PyObject *__pyx_n_s_EPOCH_YEAR;
  PyObject *__pyx_kp_u_Failed_datetime64_type_check;
  PyObject *__pyx_kp_u_Failed_timedelta64_type_check;
  PyObject *__pyx_n_u_False;
  PyObject *__pyx_n_u_Feb;
  PyObject *__pyx_kp_u_For_comparision_array_size_must;
  PyObject *__pyx_n_u_Fri;
  PyObject *__pyx_n_u_GMT;
  PyObject *__pyx_n_u_GMT0;
  PyObject *__pyx_kp_u_GMT_0;
  PyObject *__pyx_kp_u_GMT_0_2;
  PyObject *__pyx_n_u_Greenwich;
  PyObject *__pyx_n_s_ImportError;
  PyObject *__pyx_n_s_InvalidTimezoneError;
  PyObject *__pyx_n_u_Jan;
  PyObject *__pyx_n_u_Jul;
  PyObject *__pyx_n_u_Jun;
  PyObject *__pyx_n_s_LOCALTZ;
  PyObject *__pyx_n_s_LOCAL_TZ;
  PyObject *__pyx_n_u_M;
  PyObject *__pyx_n_s_MAXORDINAL;
  PyObject *__pyx_n_s_MS_DAY;
  PyObject *__pyx_n_s_MS_HOUR;
  PyObject *__pyx_n_s_MS_MINUTE;
  PyObject *__pyx_n_s_MS_SECOND;
  PyObject *__pyx_n_u_Mar;
  PyObject *__pyx_n_u_May;
  PyObject *__pyx_n_s_MemoryError;
  PyObject *__pyx_n_u_Mon;
  PyObject *__pyx_n_s_NS_DAY;
  PyObject *__pyx_n_s_NS_HOUR;
  PyObject *__pyx_n_s_NS_MICROSECOND;
  PyObject *__pyx_n_s_NS_MILLISECOND;
  PyObject *__pyx_n_s_NS_MINUTE;
  PyObject *__pyx_n_s_NS_SECOND;
  PyObject *__pyx_n_s_None;
  PyObject *__pyx_kp_u_None;
  PyObject *__pyx_n_u_Nov;
  PyObject *__pyx_n_s_ORDINAL_MAX;
  PyObject *__pyx_n_u_Oct;
  PyObject *__pyx_n_s_OverflowError;
  PyObject *__pyx_kp_u_Passed_date_arithmetic;
  PyObject *__pyx_kp_u_Passed_date_conversion;
  PyObject *__pyx_kp_u_Passed_date_generate;
  PyObject *__pyx_kp_u_Passed_date_type_check;
  PyObject *__pyx_kp_u_Passed_datetime64_conversion;
  PyObject *__pyx_kp_u_Passed_datetime64_type_check;
  PyObject *__pyx_kp_u_Passed_days_bf_month;
  PyObject *__pyx_kp_u_Passed_days_bf_year;
  PyObject *__pyx_kp_u_Passed_days_in_month;
  PyObject *__pyx_kp_u_Passed_days_in_quarter;
  PyObject *__pyx_kp_u_Passed_dt_conversion;
  PyObject *__pyx_kp_u_Passed_dt_generate;
  PyObject *__pyx_kp_u_Passed_dt_manipulate;
  PyObject *__pyx_kp_u_Passed_dt_type_check;
  PyObject *__pyx_kp_u_Passed_dt_tzinfo;
  PyObject *__pyx_kp_u_Passed_is_leap_year;
  PyObject *__pyx_kp_u_Passed_iso_1st_monday;
  PyObject *__pyx_kp_u_Passed_isocalendar;
  PyObject *__pyx_kp_u_Passed_localtime_gmtime;
  PyObject *__pyx_kp_u_Passed_ndarray_dt64_conversion;
  PyObject *__pyx_kp_u_Passed_ndarray_dt64_type_check;
  PyObject *__pyx_kp_u_Passed_ndarray_td64_conversion;
  PyObject *__pyx_kp_u_Passed_ndarray_td64_type_check;
  PyObject *__pyx_kp_u_Passed_ndarray_type_check;
  PyObject *__pyx_kp_u_Passed_numpy_share;
  PyObject *__pyx_kp_u_Passed_parser;
  PyObject *__pyx_kp_u_Passed_quarter_of_month;
  PyObject *__pyx_kp_u_Passed_time_conversion;
  PyObject *__pyx_kp_u_Passed_time_generate;
  PyObject *__pyx_kp_u_Passed_time_type_check;
  PyObject *__pyx_kp_u_Passed_time_tzinfo;
  PyObject *__pyx_kp_u_Passed_timedelta64_conversion;
  PyObject *__pyx_kp_u_Passed_timedelta64_type_check;
  PyObject *__pyx_kp_u_Passed_timedelta_conversion;
  PyObject *__pyx_kp_u_Passed_timedelta_generate;
  PyObject *__pyx_kp_u_Passed_timedelta_type_chech;
  PyObject *__pyx_kp_u_Passed_tzinfo_access;
  PyObject *__pyx_kp_u_Passed_tzinfo_generate;
  PyObject *__pyx_kp_u_Passed_tzinfo_type_check;
  PyObject *__pyx_kp_u_Passed_weekday;
  PyObject *__pyx_kp_u_Passed_ymd_fr_isocalendar;
  PyObject *__pyx_kp_u_Passed_ymd_fr_ordinal;
  PyObject *__pyx_kp_u_Passed_ymd_to_ordinal;
  PyObject *__pyx_n_s_RuntimeError;
  PyObject *__pyx_n_s_SS_DAY;
  PyObject *__pyx_n_s_SS_HOUR;
  PyObject *__pyx_n_s_SS_MINUTE;
  PyObject *__pyx_n_u_Sat;
  PyObject *__pyx_n_u_Sep;
  PyObject *__pyx_n_u_Sun;
  PyObject *__pyx_n_u_T;
  PyObject *__pyx_n_s_TD64_MM_DAY;
  PyObject *__pyx_n_s_TD64_MM_MICROSECOND;
  PyObject *__pyx_n_s_TD64_MM_MILLISECOND;
  PyObject *__pyx_n_s_TD64_MM_NANOSECOND;
  PyObject *__pyx_n_s_TD64_MM_SECOND;
  PyObject *__pyx_n_s_TD64_YY_DAY;
  PyObject *__pyx_n_s_TD64_YY_MICROSECOND;
  PyObject *__pyx_n_s_TD64_YY_MILLISECOND;
  PyObject *__pyx_n_s_TD64_YY_NANOSECOND;
  PyObject *__pyx_n_s_TD64_YY_SECOND;
  PyObject *__pyx_n_s_TIMEZONE_MAP;
  PyObject *__pyx_n_u_Thu;
  PyObject *__pyx_kp_u_Time_zones_are_not_available_fro;
  PyObject *__pyx_n_s_Timestamp;
  PyObject *__pyx_n_u_True;
  PyObject *__pyx_n_u_Tue;
  PyObject *__pyx_n_s_TypeError;
  PyObject *__pyx_n_s_US_DAY;
  PyObject *__pyx_n_s_US_HOUR;
  PyObject *__pyx_n_s_US_MILLISECOND;
  PyObject *__pyx_n_s_US_MINUTE;
  PyObject *__pyx_n_s_US_SECOND;
  PyObject *__pyx_n_s_UTC;
  PyObject *__pyx_n_u_UTC;
  PyObject *__pyx_n_u_Universal;
  PyObject *__pyx_n_s_ValueError;
  PyObject *__pyx_n_u_W;
  PyObject *__pyx_n_u_Wed;
  PyObject *__pyx_n_u_Y;
  PyObject *__pyx_n_s_ZeroDivisionError;
  PyObject *__pyx_n_s_ZoneInfo;
  PyObject *__pyx_n_u_Zulu;
  PyObject *__pyx_kp_u__10;
  PyObject *__pyx_kp_u__11;
  PyObject *__pyx_kp_u__117;
  PyObject *__pyx_kp_u__12;
  PyObject *__pyx_kp_u__13;
  PyObject *__pyx_kp_u__14;
  PyObject *__pyx_kp_u__15;
  PyObject *__pyx_kp_u__19;
  PyObject *__pyx_n_s__205;
  PyObject *__pyx_kp_u__35;
  PyObject *__pyx_n_s__37;
  PyObject *__pyx_kp_u__38;
  PyObject *__pyx_kp_u__40;
  PyObject *__pyx_kp_u__9;
  PyObject *__pyx_n_u_a;
  PyObject *__pyx_n_s_all;
  PyObject *__pyx_n_s_arr;
  PyObject *__pyx_n_s_arr_i;
  PyObject *__pyx_n_s_array;
  PyObject *__pyx_kp_u_array_size_must_be_greater_than;
  PyObject *__pyx_n_u_as;
  PyObject *__pyx_n_s_astype;
  PyObject *__pyx_n_s_asyncio_coroutines;
  PyObject *__pyx_n_s_available_timezones;
  PyObject *__pyx_n_s_babel_dates;
  PyObject *__pyx_kp_u_cannot_access_the_time_value_fro;
  PyObject *__pyx_kp_u_cannot_cast;
  PyObject *__pyx_kp_u_cannot_cast_ndarray;
  PyObject *__pyx_kp_u_cannot_cast_ndarray_2;
  PyObject *__pyx_kp_u_cannot_ceil_to_multiple_0;
  PyObject *__pyx_kp_u_cannot_check_if_ndarray_s_is_wit;
  PyObject *__pyx_kp_u_cannot_check_ndarray;
  PyObject *__pyx_kp_u_cannot_compare_ndarrays_with_dif;
  PyObject *__pyx_kp_u_cannot_convert_ndarray;
  PyObject *__pyx_kp_u_cannot_convert_ndarray_from_date;
  PyObject *__pyx_kp_u_cannot_floor_to_multiple_0;
  PyObject *__pyx_kp_u_cannot_perform_addition_on_ndarr;
  PyObject *__pyx_kp_u_cannot_perform_comparison_on_nda;
  PyObject *__pyx_kp_u_cannot_perform_subtraction_on_nd;
  PyObject *__pyx_kp_u_cannot_round_to_multiple_0;
  PyObject *__pyx_n_u_ceil;
  PyObject *__pyx_n_s_class_getitem;
  PyObject *__pyx_n_s_cline_in_traceback;
  PyObject *__pyx_n_s_cmp;
  PyObject *__pyx_n_s_count;
  PyObject *__pyx_n_s_cytimes;
  PyObject *__pyx_n_s_cytimes_utils;
  PyObject *__pyx_n_s_d;
  PyObject *__pyx_n_u_d;
  PyObject *__pyx_n_s_date;
  PyObject *__pyx_n_s_datetime;
  PyObject *__pyx_n_s_datetime64;
  PyObject *__pyx_n_u_datetime64;
  PyObject *__pyx_kp_u_datetime64_2;
  PyObject *__pyx_kp_u_datetime64_D;
  PyObject *__pyx_kp_u_datetime64_M;
  PyObject *__pyx_kp_u_datetime64_W;
  PyObject *__pyx_kp_u_datetime64_Y;
  PyObject *__pyx_kp_u_datetime64_h;
  PyObject *__pyx_kp_u_datetime64_m;
  PyObject *__pyx_kp_u_datetime64_ms;
  PyObject *__pyx_kp_u_datetime64_ns;
  PyObject *__pyx_kp_u_datetime64_s;
  PyObject *__pyx_kp_u_datetime64_s_2;
  PyObject *__pyx_kp_u_datetime64_us;
  PyObject *__pyx_kp_u_datetime_s_is_ambiguous;
  PyObject *__pyx_n_s_day;
  PyObject *__pyx_n_s_days_before_month;
  PyObject *__pyx_n_s_days_before_year;
  PyObject *__pyx_n_s_days_in_month;
  PyObject *__pyx_n_s_dict;
  PyObject *__pyx_kp_u_division_by_zero_for_utils_arr_c;
  PyObject *__pyx_kp_u_division_by_zero_for_utils_arr_f;
  PyObject *__pyx_kp_u_division_by_zero_for_utils_arr_r;
  PyObject *__pyx_kp_u_division_by_zero_for_utils_math;
  PyObject *__pyx_kp_u_division_by_zero_for_utils_math_2;
  PyObject *__pyx_kp_u_division_by_zero_for_utils_math_3;
  PyObject *__pyx_kp_u_division_by_zero_for_utils_math_4;
  PyObject *__pyx_kp_u_division_by_zero_in_arr_mod;
  PyObject *__pyx_n_s_doc;
  PyObject *__pyx_n_s_dst;
  PyObject *__pyx_n_s_dt;
  PyObject *__pyx_n_s_dt2;
  PyObject *__pyx_n_s_dt64;
  PyObject *__pyx_n_s_dt_2;
  PyObject *__pyx_n_s_dt_c;
  PyObject *__pyx_n_s_dt_n;
  PyObject *__pyx_n_s_dt_str;
  PyObject *__pyx_n_s_dt_tz1;
  PyObject *__pyx_n_s_dt_tz2;
  PyObject *__pyx_n_s_dt_tz3;
  PyObject *__pyx_n_s_dt_tz4;
  PyObject *__pyx_n_s_dtype;
  PyObject *__pyx_n_s_equal;
  PyObject *__pyx_n_s_errors;
  PyObject *__pyx_kp_u_expects_datetime_tzinfo_got_s;
  PyObject *__pyx_kp_u_expects_np_datetime64_got_s;
  PyObject *__pyx_kp_u_expects_np_ndarray_datetime64_go;
  PyObject *__pyx_kp_u_expects_np_ndarray_datetime64_ti;
  PyObject *__pyx_kp_u_expects_np_ndarray_datetime64_ti_2;
  PyObject *__pyx_kp_u_expects_np_ndarray_timedelta64_g;
  PyObject *__pyx_kp_u_expects_np_timedelta64_got_s;
  PyObject *__pyx_kp_u_failed_to_allocate_memory_for_st;
  PyObject *__pyx_n_u_floor;
  PyObject *__pyx_n_s_fold;
  PyObject *__pyx_n_s_fromtimestamp;
  PyObject *__pyx_n_s_fromutc;
  PyObject *__pyx_n_u_fs;
  PyObject *__pyx_n_s_gmtime;
  PyObject *__pyx_n_s_h;
  PyObject *__pyx_n_u_h;
  PyObject *__pyx_n_s_hour;
  PyObject *__pyx_n_s_hours;
  PyObject *__pyx_n_s_i;
  PyObject *__pyx_n_s_import;
  PyObject *__pyx_n_s_init_subclass;
  PyObject *__pyx_n_s_initializing;
  PyObject *__pyx_n_u_int64;
  PyObject *__pyx_kp_u_int64_under_D_resolution;
  PyObject *__pyx_kp_u_int64_under_M_resolution;
  PyObject *__pyx_kp_u_int64_under_Y_resolution;
  PyObject *__pyx_kp_u_int64_under_h_resolution;
  PyObject *__pyx_kp_u_int64_under_m_resolution;
  PyObject *__pyx_kp_u_int64_under_ms_resolution;
  PyObject *__pyx_kp_u_int64_under_ns_resolution;
  PyObject *__pyx_kp_u_int64_under_s_resolution;
  PyObject *__pyx_kp_u_int64_under_us_resolution;
  PyObject *__pyx_kp_u_invalid_character_s_as_an_intege;
  PyObject *__pyx_kp_u_invalid_timezone;
  PyObject *__pyx_n_s_is_coroutine;
  PyObject *__pyx_n_s_is_leap;
  PyObject *__pyx_kp_u_is_not_supported;
  PyObject *__pyx_kp_u_is_not_supported_2;
  PyObject *__pyx_kp_u_is_not_supported_3;
  PyObject *__pyx_n_s_iso_calr;
  PyObject *__pyx_n_s_iso_week;
  PyObject *__pyx_n_s_iso_year;
  PyObject *__pyx_n_s_isocalendar;
  PyObject *__pyx_n_s_isoweek1monday;
  PyObject *__pyx_n_s_isoweek_to_gregorian;
  PyObject *__pyx_n_s_key;
  PyObject *__pyx_n_u_local;
  PyObject *__pyx_n_u_localize;
  PyObject *__pyx_n_s_localtime;
  PyObject *__pyx_n_s_m;
  PyObject *__pyx_n_u_m;
  PyObject *__pyx_kp_u_m_d_Y;
  PyObject *__pyx_kp_u_m_d_Y_f_S_M_H;
  PyObject *__pyx_kp_u_m_d_Y_f_S_M_H_Z;
  PyObject *__pyx_kp_u_m_d_Y_f_S_M_H_z;
  PyObject *__pyx_n_s_main;
  PyObject *__pyx_n_s_metaclass;
  PyObject *__pyx_n_s_microsecond;
  PyObject *__pyx_n_s_microseconds;
  PyObject *__pyx_n_s_milliseconds;
  PyObject *__pyx_n_u_min;
  PyObject *__pyx_n_s_minute;
  PyObject *__pyx_n_s_minutes;
  PyObject *__pyx_n_s_module;
  PyObject *__pyx_n_s_month;
  PyObject *__pyx_n_s_mro_entries;
  PyObject *__pyx_n_u_ms;
  PyObject *__pyx_n_s_my_unit;
  PyObject *__pyx_n_s_name;
  PyObject *__pyx_kp_u_nanosecond_conversion_range_dat;
  PyObject *__pyx_kp_u_ndarray_size_must_be_an_integer;
  PyObject *__pyx_n_s_now;
  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_offset;
  PyObject *__pyx_kp_u_operation_on_ndarray_datetime64;
  PyObject *__pyx_n_s_ord2ymd;
  PyObject *__pyx_n_s_pandas;
  PyObject *__pyx_n_s_prepare;
  PyObject *__pyx_n_s_print;
  PyObject *__pyx_n_u_ps;
  PyObject *__pyx_n_s_pydatetime;
  PyObject *__pyx_n_s_pyx_capi;
  PyObject *__pyx_n_s_qtr;
  PyObject *__pyx_n_s_qualname;
  PyObject *__pyx_n_s_range;
  PyObject *__pyx_n_s_replace;
  PyObject *__pyx_kp_u_resolution;
  PyObject *__pyx_kp_u_resolution_Array_with_datetime;
  PyObject *__pyx_kp_u_resolution_Array_with_dtype_of;
  PyObject *__pyx_kp_u_resolution_Supported_resolution;
  PyObject *__pyx_kp_u_resolution_is_not_supported;
  PyObject *__pyx_n_s_return;
  PyObject *__pyx_n_u_round;
  PyObject *__pyx_n_u_s;
  PyObject *__pyx_n_s_second;
  PyObject *__pyx_n_s_secs;
  PyObject *__pyx_n_s_set_name;
  PyObject *__pyx_n_s_spec;
  PyObject *__pyx_kp_s_src_cytimes_utils_py;
  PyObject *__pyx_n_s_str;
  PyObject *__pyx_kp_u_strftime_format_is_too_long_s;
  PyObject *__pyx_n_s_super;
  PyObject *__pyx_kp_u_support_ndarray_with_1_4_dimensi;
  PyObject *__pyx_n_s_t;
  PyObject *__pyx_n_s_t1;
  PyObject *__pyx_n_s_t_c;
  PyObject *__pyx_n_s_t_n;
  PyObject *__pyx_n_s_t_tz1;
  PyObject *__pyx_n_s_td;
  PyObject *__pyx_n_s_td1;
  PyObject *__pyx_n_s_td2;
  PyObject *__pyx_n_s_td3;
  PyObject *__pyx_n_s_td4;
  PyObject *__pyx_n_s_td5;
  PyObject *__pyx_n_s_td6;
  PyObject *__pyx_n_s_td64;
  PyObject *__pyx_n_s_td7;
  PyObject *__pyx_n_s_td8;
  PyObject *__pyx_n_s_test;
  PyObject *__pyx_n_s_test_date_conversion;
  PyObject *__pyx_n_s_test_date_conversion_locals_Cus;
  PyObject *__pyx_n_s_test_date_generate;
  PyObject *__pyx_n_s_test_date_type_check;
  PyObject *__pyx_n_s_test_date_type_check_locals_Cus;
  PyObject *__pyx_n_s_test_datetime64_conversion;
  PyObject *__pyx_n_s_test_datetime64_type_check;
  PyObject *__pyx_n_s_test_days_bf_month;
  PyObject *__pyx_n_s_test_days_bf_year;
  PyObject *__pyx_n_s_test_days_in_month;
  PyObject *__pyx_n_s_test_days_in_quarter;
  PyObject *__pyx_n_s_test_dt_arithmetic;
  PyObject *__pyx_n_s_test_dt_conversion;
  PyObject *__pyx_n_s_test_dt_generate;
  PyObject *__pyx_n_s_test_dt_mainipulate;
  PyObject *__pyx_n_s_test_dt_type_check;
  PyObject *__pyx_n_s_test_dt_type_check_locals_Custo;
  PyObject *__pyx_n_s_test_dt_tzinfo;
  PyObject *__pyx_n_s_test_is_leap_year;
  PyObject *__pyx_n_s_test_iso_1st_monday;
  PyObject *__pyx_n_s_test_isocalendar;
  PyObject *__pyx_n_s_test_localtime_n_gmtime;
  PyObject *__pyx_n_s_test_ndarray_dt64_conversion;
  PyObject *__pyx_n_s_test_ndarray_dt64_type_check;
  PyObject *__pyx_n_s_test_ndarray_td64_conversion;
  PyObject *__pyx_n_s_test_ndarray_td64_type_check;
  PyObject *__pyx_n_s_test_ndarray_type_check;
  PyObject *__pyx_n_s_test_numpy_share;
  PyObject *__pyx_n_s_test_parser;
  PyObject *__pyx_n_s_test_quarter_of_month;
  PyObject *__pyx_n_s_test_time_conversion;
  PyObject *__pyx_n_s_test_time_conversion_locals_Cus;
  PyObject *__pyx_n_s_test_time_generate;
  PyObject *__pyx_n_s_test_time_type_check;
  PyObject *__pyx_n_s_test_time_type_check_locals_Cus;
  PyObject *__pyx_n_s_test_time_tzinfo;
  PyObject *__pyx_n_s_test_timedelta64_conversion;
  PyObject *__pyx_n_s_test_timedelta64_type_check;
  PyObject *__pyx_n_s_test_timedelta_conversion;
  PyObject *__pyx_n_s_test_timedelta_conversion_local;
  PyObject *__pyx_n_s_test_timedelta_generate;
  PyObject *__pyx_n_s_test_timedelta_type_check;
  PyObject *__pyx_n_s_test_timedelta_type_check_local;
  PyObject *__pyx_n_s_test_tzinfo_access;
  PyObject *__pyx_n_s_test_tzinfo_generate;
  PyObject *__pyx_n_s_test_tzinfo_type_check;
  PyObject *__pyx_n_s_test_utils;
  PyObject *__pyx_n_s_test_weekday;
  PyObject *__pyx_n_s_test_ymd_fr_isocalendar;
  PyObject *__pyx_n_s_test_ymd_fr_ordinal;
  PyObject *__pyx_n_s_test_ymd_to_ordinal;
  PyObject *__pyx_n_s_time;
  PyObject *__pyx_n_s_time1;
  PyObject *__pyx_n_s_time2;
  PyObject *__pyx_n_s_time_tz1;
  PyObject *__pyx_n_s_time_tz2;
  PyObject *__pyx_n_s_timedelta;
  PyObject *__pyx_n_s_timedelta64;
  PyObject *__pyx_n_u_timedelta64;
  PyObject *__pyx_kp_u_timedelta64_2;
  PyObject *__pyx_kp_u_timedelta64_ns;
  PyObject *__pyx_kp_u_timedelta64_s;
  PyObject *__pyx_kp_u_timedelta64_us;
  PyObject *__pyx_n_s_timestamp;
  PyObject *__pyx_n_s_timetuple;
  PyObject *__pyx_n_s_timetz;
  PyObject *__pyx_n_s_timezone;
  PyObject *__pyx_kp_u_timezone_offset_s_seconds_out_of;
  PyObject *__pyx_n_s_tm;
  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_tmp;
  PyObject *__pyx_n_s_tmp1;
  PyObject *__pyx_n_s_tmp2;
  PyObject *__pyx_n_s_tmp3;
  PyObject *__pyx_kp_u_to;
  PyObject *__pyx_kp_u_to_2;
  PyObject *__pyx_kp_u_to_an_integer_under;
  PyObject *__pyx_kp_u_to_an_integer_under_2;
  PyObject *__pyx_kp_u_to_datetime64;
  PyObject *__pyx_kp_u_to_int64_under;
  PyObject *__pyx_kp_u_to_int64_under_2;
  PyObject *__pyx_kp_u_to_int64_under_3;
  PyObject *__pyx_n_s_to_unit;
  PyObject *__pyx_n_s_today;
  PyObject *__pyx_n_s_toordinal;
  PyObject *__pyx_n_s_total_seconds;
  PyObject *__pyx_n_s_ts;
  PyObject *__pyx_n_s_typeref;
  PyObject *__pyx_n_s_tz;
  PyObject *__pyx_n_s_tz1;
  PyObject *__pyx_n_s_tz2;
  PyObject *__pyx_n_s_tz3;
  PyObject *__pyx_n_s_tz4;
  PyObject *__pyx_n_s_tz_str;
  PyObject *__pyx_n_s_tzinfo;
  PyObject *__pyx_n_s_tzname;
  PyObject *__pyx_kp_u_unable_to_parse_datetime_unit_fr;
  PyObject *__pyx_n_s_unit;
  PyObject *__pyx_n_s_units;
  PyObject *__pyx_kp_u_unknown_datetime_unit_d;
  PyObject *__pyx_kp_u_unknown_datetime_unit_s;
  PyObject *__pyx_kp_u_unsupported_datetime_unit_s;
  PyObject *__pyx_kp_u_unsupported_factor_d_for_timedel;
  PyObject *__pyx_kp_u_unsupported_factor_d_for_timedel_2;
  PyObject *__pyx_n_s_us;
  PyObject *__pyx_n_u_us;
  PyObject *__pyx_n_s_utc;
  PyObject *__pyx_n_s_utcoffset;
  PyObject *__pyx_n_s_utctimetuple;
  PyObject *__pyx_n_s_val;
  PyObject *__pyx_n_s_value;
  PyObject *__pyx_n_s_week;
  PyObject *__pyx_n_s_weekday;
  PyObject *__pyx_kp_u_with_datetime_unit;
  PyObject *__pyx_kp_u_without_specifying_the_array_da;
  PyObject *__pyx_n_s_y;
  PyObject *__pyx_n_s_year;
  PyObject *__pyx_n_s_ymd2ord;
  PyObject *__pyx_n_s_zone;
  PyObject *__pyx_n_s_zoneinfo;
  PyObject *__pyx_int_0;
  PyObject *__pyx_int_1;
  PyObject *__pyx_int_2;
  PyObject *__pyx_int_3;
  PyObject *__pyx_int_4;
  PyObject *__pyx_int_5;
  PyObject *__pyx_int_6;
  PyObject *__pyx_int_8;
  PyObject *__pyx_int_23;
  PyObject *__pyx_int_59;
  PyObject *__pyx_int_60;
  PyObject *__pyx_int_1000;
  PyObject *__pyx_int_1970;
  PyObject *__pyx_int_2021;
  PyObject *__pyx_int_3600;
  PyObject *__pyx_int_10000;
  PyObject *__pyx_int_86399;
  PyObject *__pyx_int_86400;
  PyObject *__pyx_int_100000;
  PyObject *__pyx_int_1000000;
  PyObject *__pyx_int_86400000000;
  PyObject *__pyx_int_neg_1;
  PyObject *__pyx_int_neg_2;
  PyObject *__pyx_int_neg_3;
  PyObject *__pyx_int_neg_23;
  PyObject *__pyx_int_neg_59;
  PyObject *__pyx_int_neg_60;
  PyObject *__pyx_int_neg_1000;
  PyObject *__pyx_int_neg_86399;
  PyObject *__pyx_int_neg_86400;
  PyObject *__pyx_int_neg_100000;
  PyObject *__pyx_tuple_;
  PyObject *__pyx_tuple__2;
  PyObject *__pyx_tuple__3;
  PyObject *__pyx_tuple__4;
  PyObject *__pyx_tuple__5;
  PyObject *__pyx_tuple__6;
  PyObject *__pyx_tuple__7;
  PyObject *__pyx_tuple__8;
  PyObject *__pyx_slice__99;
  PyObject *__pyx_tuple__16;
  PyObject *__pyx_tuple__17;
  PyObject *__pyx_tuple__18;
  PyObject *__pyx_tuple__20;
  PyObject *__pyx_tuple__21;
  PyObject *__pyx_tuple__22;
  PyObject *__pyx_tuple__23;
  PyObject *__pyx_tuple__24;
  PyObject *__pyx_tuple__25;
  PyObject *__pyx_tuple__26;
  PyObject *__pyx_tuple__27;
  PyObject *__pyx_tuple__28;
  PyObject *__pyx_tuple__29;
  PyObject *__pyx_tuple__30;
  PyObject *__pyx_tuple__31;
  PyObject *__pyx_tuple__32;
  PyObject *__pyx_tuple__33;
  PyObject *__pyx_tuple__34;
  PyObject *__pyx_tuple__36;
  PyObject *__pyx_tuple__39;
  PyObject *__pyx_tuple__41;
  PyObject *__pyx_tuple__42;
  PyObject *__pyx_tuple__43;
  PyObject *__pyx_tuple__44;
  PyObject *__pyx_tuple__45;
  PyObject *__pyx_tuple__46;
  PyObject *__pyx_tuple__47;
  PyObject *__pyx_tuple__48;
  PyObject *__pyx_tuple__49;
  PyObject *__pyx_tuple__50;
  PyObject *__pyx_tuple__51;
  PyObject *__pyx_tuple__52;
  PyObject *__pyx_tuple__53;
  PyObject *__pyx_tuple__54;
  PyObject *__pyx_tuple__55;
  PyObject *__pyx_tuple__56;
  PyObject *__pyx_tuple__57;
  PyObject *__pyx_tuple__58;
  PyObject *__pyx_tuple__59;
  PyObject *__pyx_tuple__60;
  PyObject *__pyx_tuple__61;
  PyObject *__pyx_tuple__62;
  PyObject *__pyx_tuple__63;
  PyObject *__pyx_tuple__64;
  PyObject *__pyx_tuple__65;
  PyObject *__pyx_tuple__66;
  PyObject *__pyx_tuple__67;
  PyObject *__pyx_tuple__68;
  PyObject *__pyx_tuple__69;
  PyObject *__pyx_tuple__70;
  PyObject *__pyx_tuple__71;
  PyObject *__pyx_tuple__72;
  PyObject *__pyx_tuple__73;
  PyObject *__pyx_tuple__74;
  PyObject *__pyx_tuple__75;
  PyObject *__pyx_tuple__76;
  PyObject *__pyx_tuple__77;
  PyObject *__pyx_tuple__78;
  PyObject *__pyx_tuple__79;
  PyObject *__pyx_tuple__80;
  PyObject *__pyx_tuple__81;
  PyObject *__pyx_tuple__82;
  PyObject *__pyx_tuple__83;
  PyObject *__pyx_tuple__84;
  PyObject *__pyx_tuple__85;
  PyObject *__pyx_tuple__86;
  PyObject *__pyx_tuple__87;
  PyObject *__pyx_tuple__88;
  PyObject *__pyx_tuple__89;
  PyObject *__pyx_tuple__90;
  PyObject *__pyx_tuple__91;
  PyObject *__pyx_tuple__92;
  PyObject *__pyx_tuple__93;
  PyObject *__pyx_tuple__94;
  PyObject *__pyx_tuple__95;
  PyObject *__pyx_tuple__96;
  PyObject *__pyx_tuple__97;
  PyObject *__pyx_tuple__98;
  PyObject *__pyx_slice__100;
  PyObject *__pyx_tuple__101;
  PyObject *__pyx_tuple__102;
  PyObject *__pyx_tuple__103;
  PyObject *__pyx_tuple__104;
  PyObject *__pyx_tuple__105;
  PyObject *__pyx_tuple__106;
  PyObject *__pyx_tuple__107;
  PyObject *__pyx_tuple__108;
  PyObject *__pyx_tuple__109;
  PyObject *__pyx_tuple__110;
  PyObject *__pyx_tuple__111;
  PyObject *__pyx_tuple__112;
  PyObject *__pyx_tuple__113;
  PyObject *__pyx_tuple__114;
  PyObject *__pyx_tuple__115;
  PyObject *__pyx_tuple__116;
  PyObject *__pyx_tuple__118;
  PyObject *__pyx_tuple__119;
  PyObject *__pyx_tuple__120;
  PyObject *__pyx_tuple__122;
  PyObject *__pyx_tuple__124;
  PyObject *__pyx_tuple__126;
  PyObject *__pyx_tuple__128;
  PyObject *__pyx_tuple__130;
  PyObject *__pyx_tuple__132;
  PyObject *__pyx_tuple__134;
  PyObject *__pyx_tuple__136;
  PyObject *__pyx_tuple__138;
  PyObject *__pyx_tuple__140;
  PyObject *__pyx_tuple__142;
  PyObject *__pyx_tuple__144;
  PyObject *__pyx_tuple__146;
  PyObject *__pyx_tuple__148;
  PyObject *__pyx_tuple__150;
  PyObject *__pyx_tuple__152;
  PyObject *__pyx_tuple__154;
  PyObject *__pyx_tuple__156;
  PyObject *__pyx_tuple__158;
  PyObject *__pyx_tuple__160;
  PyObject *__pyx_tuple__162;
  PyObject *__pyx_tuple__164;
  PyObject *__pyx_tuple__166;
  PyObject *__pyx_tuple__168;
  PyObject *__pyx_tuple__170;
  PyObject *__pyx_tuple__172;
  PyObject *__pyx_tuple__174;
  PyObject *__pyx_tuple__176;
  PyObject *__pyx_tuple__178;
  PyObject *__pyx_tuple__180;
  PyObject *__pyx_tuple__182;
  PyObject *__pyx_tuple__185;
  PyObject *__pyx_tuple__187;
  PyObject *__pyx_tuple__189;
  PyObject *__pyx_tuple__191;
  PyObject *__pyx_tuple__193;
  PyObject *__pyx_tuple__195;
  PyObject *__pyx_tuple__197;
  PyObject *__pyx_tuple__200;
  PyObject *__pyx_tuple__203;
  PyObject *__pyx_codeobj__121;
  PyObject *__pyx_codeobj__123;
  PyObject *__pyx_codeobj__125;
  PyObject *__pyx_codeobj__127;
  PyObject *__pyx_codeobj__129;
  PyObject *__pyx_codeobj__131;
  PyObject *__pyx_codeobj__133;
  PyObject *__pyx_codeobj__135;
  PyObject *__pyx_codeobj__137;
  PyObject *__pyx_codeobj__139;
  PyObject *__pyx_codeobj__141;
  PyObject *__pyx_codeobj__143;
  PyObject *__pyx_codeobj__145;
  PyObject *__pyx_codeobj__147;
  PyObject *__pyx_codeobj__149;
  PyObject *__pyx_codeobj__151;
  PyObject *__pyx_codeobj__153;
  PyObject *__pyx_codeobj__155;
  PyObject *__pyx_codeobj__157;
  PyObject *__pyx_codeobj__159;
  PyObject *__pyx_codeobj__161;
  PyObject *__pyx_codeobj__163;
  PyObject *__pyx_codeobj__165;
  PyObject *__pyx_codeobj__167;
  PyObject *__pyx_codeobj__169;
  PyObject *__pyx_codeobj__171;
  PyObject *__pyx_codeobj__173;
  PyObject *__pyx_codeobj__175;
  PyObject *__pyx_codeobj__177;
  PyObject *__pyx_codeobj__179;
  PyObject *__pyx_codeobj__181;
  PyObject *__pyx_codeobj__183;
  PyObject *__pyx_codeobj__184;
  PyObject *__pyx_codeobj__186;
  PyObject *__pyx_codeobj__188;
  PyObject *__pyx_codeobj__190;
  PyObject *__pyx_codeobj__192;
  PyObject *__pyx_codeobj__194;
  PyObject *__pyx_codeobj__196;
  PyObject *__pyx_codeobj__198;
  PyObject *__pyx_codeobj__199;
  PyObject *__pyx_codeobj__201;
  PyObject *__pyx_codeobj__202;
  PyObject *__pyx_codeobj__204;
} __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_00);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00_00);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00_00_00_06d);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00_00_01);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00_00_01_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00_00_02d);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00_01_01);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00_01_01_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_0101);
  Py_CLEAR(clear_module_state->__pyx_kp_u_0101_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_01_02_2021);
  Py_CLEAR(clear_module_state->__pyx_kp_u_01_02_2021_000006_05_04_03);
  Py_CLEAR(clear_module_state->__pyx_kp_u_01_02_2021_000006_05_04_03UTC_01);
  Py_CLEAR(clear_module_state->__pyx_kp_u_01_02_2021_000006_05_04_03_0101);
  Py_CLEAR(clear_module_state->__pyx_kp_u_02d);
  Py_CLEAR(clear_module_state->__pyx_kp_u_03_04_05);
  Py_CLEAR(clear_module_state->__pyx_kp_u_03_04_05_000006);
  Py_CLEAR(clear_module_state->__pyx_kp_u_03_04_05_000006_0101);
  Py_CLEAR(clear_module_state->__pyx_kp_u_03_04_05_0101);
  Py_CLEAR(clear_module_state->__pyx_kp_u_04d);
  Py_CLEAR(clear_module_state->__pyx_kp_u_06d);
  Py_CLEAR(clear_module_state->__pyx_kp_u_06d_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_2021_000);
  Py_CLEAR(clear_module_state->__pyx_kp_u_2021_01_02);
  Py_CLEAR(clear_module_state->__pyx_kp_u_2021_01_02T03_04_05);
  Py_CLEAR(clear_module_state->__pyx_kp_u_2021_01_02T03_04_05_000006);
  Py_CLEAR(clear_module_state->__pyx_kp_u_2021_01_02T03_04_05_006007);
  Py_CLEAR(clear_module_state->__pyx_kp_u_2021_01_02_03_04_05_000006_0101);
  Py_CLEAR(clear_module_state->__pyx_kp_u_2021_01_02_03_04_05_0101);
  Py_CLEAR(clear_module_state->__pyx_kp_u_2021_365);
  Py_CLEAR(clear_module_state->__pyx_kp_u_2021_367);
  Py_CLEAR(clear_module_state->__pyx_kp_u_2021_W52_6);
  Py_CLEAR(clear_module_state->__pyx_kp_u_2359);
  Py_CLEAR(clear_module_state->__pyx_kp_u_2359_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_24_01_01);
  Py_CLEAR(clear_module_state->__pyx_kp_u_24_01_01_000001);
  Py_CLEAR(clear_module_state->__pyx_kp_u_24_01_01_000001_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_24_01_01_001000);
  Py_CLEAR(clear_module_state->__pyx_kp_u_24_01_01_001000_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_24_01_01_001001);
  Py_CLEAR(clear_module_state->__pyx_kp_u_24_01_01_001001_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_24_01_01_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_2d);
  Py_CLEAR(clear_module_state->__pyx_n_u_Apr);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Array_with_dtype_of_datetime64);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Asia_Shanghai);
  Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError);
  Py_CLEAR(clear_module_state->__pyx_n_u_Aug);
  Py_CLEAR(clear_module_state->__pyx_n_u_CET);
  Py_CLEAR(clear_module_state->__pyx_n_u_CST);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Conversion_limits_to_datetime_u);
  Py_CLEAR(clear_module_state->__pyx_n_s_CustomDate);
  Py_CLEAR(clear_module_state->__pyx_n_s_CustomDateTime);
  Py_CLEAR(clear_module_state->__pyx_n_s_CustomTD);
  Py_CLEAR(clear_module_state->__pyx_n_s_CustomTime);
  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_IN_MONTH);
  Py_CLEAR(clear_module_state->__pyx_n_s_DAYS_IN_QUARTER);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_DD_MAX);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_DD_MIN);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_HH_MAX);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_HH_MIN);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_MI_MAX);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_MI_MIN);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_MM_MAX);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_MM_MIN);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_MS_MAX);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_MS_MIN);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_NS_MAX);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_NS_MIN);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_SS_MAX);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_SS_MIN);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_US_MAX);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_US_MIN);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_WW_MAX);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_WW_MIN);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_YY_MAX);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT64_NS_YY_MIN);
  Py_CLEAR(clear_module_state->__pyx_n_u_Dec);
  Py_CLEAR(clear_module_state->__pyx_n_s_EPOCH_DAY);
  Py_CLEAR(clear_module_state->__pyx_n_s_EPOCH_DT);
  Py_CLEAR(clear_module_state->__pyx_n_s_EPOCH_HOUR);
  Py_CLEAR(clear_module_state->__pyx_n_s_EPOCH_MICROSECOND);
  Py_CLEAR(clear_module_state->__pyx_n_s_EPOCH_MILLISECOND);
  Py_CLEAR(clear_module_state->__pyx_n_s_EPOCH_MINUTE);
  Py_CLEAR(clear_module_state->__pyx_n_s_EPOCH_MONTH);
  Py_CLEAR(clear_module_state->__pyx_n_s_EPOCH_SECOND);
  Py_CLEAR(clear_module_state->__pyx_n_s_EPOCH_YEAR);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Failed_datetime64_type_check);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Failed_timedelta64_type_check);
  Py_CLEAR(clear_module_state->__pyx_n_u_False);
  Py_CLEAR(clear_module_state->__pyx_n_u_Feb);
  Py_CLEAR(clear_module_state->__pyx_kp_u_For_comparision_array_size_must);
  Py_CLEAR(clear_module_state->__pyx_n_u_Fri);
  Py_CLEAR(clear_module_state->__pyx_n_u_GMT);
  Py_CLEAR(clear_module_state->__pyx_n_u_GMT0);
  Py_CLEAR(clear_module_state->__pyx_kp_u_GMT_0);
  Py_CLEAR(clear_module_state->__pyx_kp_u_GMT_0_2);
  Py_CLEAR(clear_module_state->__pyx_n_u_Greenwich);
  Py_CLEAR(clear_module_state->__pyx_n_s_ImportError);
  Py_CLEAR(clear_module_state->__pyx_n_s_InvalidTimezoneError);
  Py_CLEAR(clear_module_state->__pyx_n_u_Jan);
  Py_CLEAR(clear_module_state->__pyx_n_u_Jul);
  Py_CLEAR(clear_module_state->__pyx_n_u_Jun);
  Py_CLEAR(clear_module_state->__pyx_n_s_LOCALTZ);
  Py_CLEAR(clear_module_state->__pyx_n_s_LOCAL_TZ);
  Py_CLEAR(clear_module_state->__pyx_n_u_M);
  Py_CLEAR(clear_module_state->__pyx_n_s_MAXORDINAL);
  Py_CLEAR(clear_module_state->__pyx_n_s_MS_DAY);
  Py_CLEAR(clear_module_state->__pyx_n_s_MS_HOUR);
  Py_CLEAR(clear_module_state->__pyx_n_s_MS_MINUTE);
  Py_CLEAR(clear_module_state->__pyx_n_s_MS_SECOND);
  Py_CLEAR(clear_module_state->__pyx_n_u_Mar);
  Py_CLEAR(clear_module_state->__pyx_n_u_May);
  Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError);
  Py_CLEAR(clear_module_state->__pyx_n_u_Mon);
  Py_CLEAR(clear_module_state->__pyx_n_s_NS_DAY);
  Py_CLEAR(clear_module_state->__pyx_n_s_NS_HOUR);
  Py_CLEAR(clear_module_state->__pyx_n_s_NS_MICROSECOND);
  Py_CLEAR(clear_module_state->__pyx_n_s_NS_MILLISECOND);
  Py_CLEAR(clear_module_state->__pyx_n_s_NS_MINUTE);
  Py_CLEAR(clear_module_state->__pyx_n_s_NS_SECOND);
  Py_CLEAR(clear_module_state->__pyx_n_s_None);
  Py_CLEAR(clear_module_state->__pyx_kp_u_None);
  Py_CLEAR(clear_module_state->__pyx_n_u_Nov);
  Py_CLEAR(clear_module_state->__pyx_n_s_ORDINAL_MAX);
  Py_CLEAR(clear_module_state->__pyx_n_u_Oct);
  Py_CLEAR(clear_module_state->__pyx_n_s_OverflowError);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_date_arithmetic);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_date_conversion);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_date_generate);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_date_type_check);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_datetime64_conversion);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_datetime64_type_check);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_days_bf_month);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_days_bf_year);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_days_in_month);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_days_in_quarter);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_dt_conversion);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_dt_generate);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_dt_manipulate);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_dt_type_check);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_dt_tzinfo);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_is_leap_year);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_iso_1st_monday);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_isocalendar);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_localtime_gmtime);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_ndarray_dt64_conversion);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_ndarray_dt64_type_check);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_ndarray_td64_conversion);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_ndarray_td64_type_check);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_ndarray_type_check);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_numpy_share);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_parser);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_quarter_of_month);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_time_conversion);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_time_generate);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_time_type_check);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_time_tzinfo);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_timedelta64_conversion);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_timedelta64_type_check);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_timedelta_conversion);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_timedelta_generate);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_timedelta_type_chech);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_tzinfo_access);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_tzinfo_generate);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_tzinfo_type_check);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_weekday);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_ymd_fr_isocalendar);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_ymd_fr_ordinal);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Passed_ymd_to_ordinal);
  Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeError);
  Py_CLEAR(clear_module_state->__pyx_n_s_SS_DAY);
  Py_CLEAR(clear_module_state->__pyx_n_s_SS_HOUR);
  Py_CLEAR(clear_module_state->__pyx_n_s_SS_MINUTE);
  Py_CLEAR(clear_module_state->__pyx_n_u_Sat);
  Py_CLEAR(clear_module_state->__pyx_n_u_Sep);
  Py_CLEAR(clear_module_state->__pyx_n_u_Sun);
  Py_CLEAR(clear_module_state->__pyx_n_u_T);
  Py_CLEAR(clear_module_state->__pyx_n_s_TD64_MM_DAY);
  Py_CLEAR(clear_module_state->__pyx_n_s_TD64_MM_MICROSECOND);
  Py_CLEAR(clear_module_state->__pyx_n_s_TD64_MM_MILLISECOND);
  Py_CLEAR(clear_module_state->__pyx_n_s_TD64_MM_NANOSECOND);
  Py_CLEAR(clear_module_state->__pyx_n_s_TD64_MM_SECOND);
  Py_CLEAR(clear_module_state->__pyx_n_s_TD64_YY_DAY);
  Py_CLEAR(clear_module_state->__pyx_n_s_TD64_YY_MICROSECOND);
  Py_CLEAR(clear_module_state->__pyx_n_s_TD64_YY_MILLISECOND);
  Py_CLEAR(clear_module_state->__pyx_n_s_TD64_YY_NANOSECOND);
  Py_CLEAR(clear_module_state->__pyx_n_s_TD64_YY_SECOND);
  Py_CLEAR(clear_module_state->__pyx_n_s_TIMEZONE_MAP);
  Py_CLEAR(clear_module_state->__pyx_n_u_Thu);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Time_zones_are_not_available_fro);
  Py_CLEAR(clear_module_state->__pyx_n_s_Timestamp);
  Py_CLEAR(clear_module_state->__pyx_n_u_True);
  Py_CLEAR(clear_module_state->__pyx_n_u_Tue);
  Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
  Py_CLEAR(clear_module_state->__pyx_n_s_US_DAY);
  Py_CLEAR(clear_module_state->__pyx_n_s_US_HOUR);
  Py_CLEAR(clear_module_state->__pyx_n_s_US_MILLISECOND);
  Py_CLEAR(clear_module_state->__pyx_n_s_US_MINUTE);
  Py_CLEAR(clear_module_state->__pyx_n_s_US_SECOND);
  Py_CLEAR(clear_module_state->__pyx_n_s_UTC);
  Py_CLEAR(clear_module_state->__pyx_n_u_UTC);
  Py_CLEAR(clear_module_state->__pyx_n_u_Universal);
  Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
  Py_CLEAR(clear_module_state->__pyx_n_u_W);
  Py_CLEAR(clear_module_state->__pyx_n_u_Wed);
  Py_CLEAR(clear_module_state->__pyx_n_u_Y);
  Py_CLEAR(clear_module_state->__pyx_n_s_ZeroDivisionError);
  Py_CLEAR(clear_module_state->__pyx_n_s_ZoneInfo);
  Py_CLEAR(clear_module_state->__pyx_n_u_Zulu);
  Py_CLEAR(clear_module_state->__pyx_kp_u__10);
  Py_CLEAR(clear_module_state->__pyx_kp_u__11);
  Py_CLEAR(clear_module_state->__pyx_kp_u__117);
  Py_CLEAR(clear_module_state->__pyx_kp_u__12);
  Py_CLEAR(clear_module_state->__pyx_kp_u__13);
  Py_CLEAR(clear_module_state->__pyx_kp_u__14);
  Py_CLEAR(clear_module_state->__pyx_kp_u__15);
  Py_CLEAR(clear_module_state->__pyx_kp_u__19);
  Py_CLEAR(clear_module_state->__pyx_n_s__205);
  Py_CLEAR(clear_module_state->__pyx_kp_u__35);
  Py_CLEAR(clear_module_state->__pyx_n_s__37);
  Py_CLEAR(clear_module_state->__pyx_kp_u__38);
  Py_CLEAR(clear_module_state->__pyx_kp_u__40);
  Py_CLEAR(clear_module_state->__pyx_kp_u__9);
  Py_CLEAR(clear_module_state->__pyx_n_u_a);
  Py_CLEAR(clear_module_state->__pyx_n_s_all);
  Py_CLEAR(clear_module_state->__pyx_n_s_arr);
  Py_CLEAR(clear_module_state->__pyx_n_s_arr_i);
  Py_CLEAR(clear_module_state->__pyx_n_s_array);
  Py_CLEAR(clear_module_state->__pyx_kp_u_array_size_must_be_greater_than);
  Py_CLEAR(clear_module_state->__pyx_n_u_as);
  Py_CLEAR(clear_module_state->__pyx_n_s_astype);
  Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
  Py_CLEAR(clear_module_state->__pyx_n_s_available_timezones);
  Py_CLEAR(clear_module_state->__pyx_n_s_babel_dates);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_access_the_time_value_fro);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_cast);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_cast_ndarray);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_cast_ndarray_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_ceil_to_multiple_0);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_check_if_ndarray_s_is_wit);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_check_ndarray);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_compare_ndarrays_with_dif);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_convert_ndarray);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_convert_ndarray_from_date);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_floor_to_multiple_0);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_perform_addition_on_ndarr);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_perform_comparison_on_nda);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_perform_subtraction_on_nd);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_round_to_multiple_0);
  Py_CLEAR(clear_module_state->__pyx_n_u_ceil);
  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_cmp);
  Py_CLEAR(clear_module_state->__pyx_n_s_count);
  Py_CLEAR(clear_module_state->__pyx_n_s_cytimes);
  Py_CLEAR(clear_module_state->__pyx_n_s_cytimes_utils);
  Py_CLEAR(clear_module_state->__pyx_n_s_d);
  Py_CLEAR(clear_module_state->__pyx_n_u_d);
  Py_CLEAR(clear_module_state->__pyx_n_s_date);
  Py_CLEAR(clear_module_state->__pyx_n_s_datetime);
  Py_CLEAR(clear_module_state->__pyx_n_s_datetime64);
  Py_CLEAR(clear_module_state->__pyx_n_u_datetime64);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_D);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_M);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_W);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_Y);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_h);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_m);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_ms);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_ns);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_s_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_us);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime_s_is_ambiguous);
  Py_CLEAR(clear_module_state->__pyx_n_s_day);
  Py_CLEAR(clear_module_state->__pyx_n_s_days_before_month);
  Py_CLEAR(clear_module_state->__pyx_n_s_days_before_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_days_in_month);
  Py_CLEAR(clear_module_state->__pyx_n_s_dict);
  Py_CLEAR(clear_module_state->__pyx_kp_u_division_by_zero_for_utils_arr_c);
  Py_CLEAR(clear_module_state->__pyx_kp_u_division_by_zero_for_utils_arr_f);
  Py_CLEAR(clear_module_state->__pyx_kp_u_division_by_zero_for_utils_arr_r);
  Py_CLEAR(clear_module_state->__pyx_kp_u_division_by_zero_for_utils_math);
  Py_CLEAR(clear_module_state->__pyx_kp_u_division_by_zero_for_utils_math_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_division_by_zero_for_utils_math_3);
  Py_CLEAR(clear_module_state->__pyx_kp_u_division_by_zero_for_utils_math_4);
  Py_CLEAR(clear_module_state->__pyx_kp_u_division_by_zero_in_arr_mod);
  Py_CLEAR(clear_module_state->__pyx_n_s_doc);
  Py_CLEAR(clear_module_state->__pyx_n_s_dst);
  Py_CLEAR(clear_module_state->__pyx_n_s_dt);
  Py_CLEAR(clear_module_state->__pyx_n_s_dt2);
  Py_CLEAR(clear_module_state->__pyx_n_s_dt64);
  Py_CLEAR(clear_module_state->__pyx_n_s_dt_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_dt_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_dt_n);
  Py_CLEAR(clear_module_state->__pyx_n_s_dt_str);
  Py_CLEAR(clear_module_state->__pyx_n_s_dt_tz1);
  Py_CLEAR(clear_module_state->__pyx_n_s_dt_tz2);
  Py_CLEAR(clear_module_state->__pyx_n_s_dt_tz3);
  Py_CLEAR(clear_module_state->__pyx_n_s_dt_tz4);
  Py_CLEAR(clear_module_state->__pyx_n_s_dtype);
  Py_CLEAR(clear_module_state->__pyx_n_s_equal);
  Py_CLEAR(clear_module_state->__pyx_n_s_errors);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expects_datetime_tzinfo_got_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expects_np_datetime64_got_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expects_np_ndarray_datetime64_go);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expects_np_ndarray_datetime64_ti);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expects_np_ndarray_datetime64_ti_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expects_np_ndarray_timedelta64_g);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expects_np_timedelta64_got_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_failed_to_allocate_memory_for_st);
  Py_CLEAR(clear_module_state->__pyx_n_u_floor);
  Py_CLEAR(clear_module_state->__pyx_n_s_fold);
  Py_CLEAR(clear_module_state->__pyx_n_s_fromtimestamp);
  Py_CLEAR(clear_module_state->__pyx_n_s_fromutc);
  Py_CLEAR(clear_module_state->__pyx_n_u_fs);
  Py_CLEAR(clear_module_state->__pyx_n_s_gmtime);
  Py_CLEAR(clear_module_state->__pyx_n_s_h);
  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_hours);
  Py_CLEAR(clear_module_state->__pyx_n_s_i);
  Py_CLEAR(clear_module_state->__pyx_n_s_import);
  Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass);
  Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
  Py_CLEAR(clear_module_state->__pyx_n_u_int64);
  Py_CLEAR(clear_module_state->__pyx_kp_u_int64_under_D_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_int64_under_M_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_int64_under_Y_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_int64_under_h_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_int64_under_m_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_int64_under_ms_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_int64_under_ns_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_int64_under_s_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_int64_under_us_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_character_s_as_an_intege);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_timezone);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_leap);
  Py_CLEAR(clear_module_state->__pyx_kp_u_is_not_supported);
  Py_CLEAR(clear_module_state->__pyx_kp_u_is_not_supported_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_is_not_supported_3);
  Py_CLEAR(clear_module_state->__pyx_n_s_iso_calr);
  Py_CLEAR(clear_module_state->__pyx_n_s_iso_week);
  Py_CLEAR(clear_module_state->__pyx_n_s_iso_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_isocalendar);
  Py_CLEAR(clear_module_state->__pyx_n_s_isoweek1monday);
  Py_CLEAR(clear_module_state->__pyx_n_s_isoweek_to_gregorian);
  Py_CLEAR(clear_module_state->__pyx_n_s_key);
  Py_CLEAR(clear_module_state->__pyx_n_u_local);
  Py_CLEAR(clear_module_state->__pyx_n_u_localize);
  Py_CLEAR(clear_module_state->__pyx_n_s_localtime);
  Py_CLEAR(clear_module_state->__pyx_n_s_m);
  Py_CLEAR(clear_module_state->__pyx_n_u_m);
  Py_CLEAR(clear_module_state->__pyx_kp_u_m_d_Y);
  Py_CLEAR(clear_module_state->__pyx_kp_u_m_d_Y_f_S_M_H);
  Py_CLEAR(clear_module_state->__pyx_kp_u_m_d_Y_f_S_M_H_Z);
  Py_CLEAR(clear_module_state->__pyx_kp_u_m_d_Y_f_S_M_H_z);
  Py_CLEAR(clear_module_state->__pyx_n_s_main);
  Py_CLEAR(clear_module_state->__pyx_n_s_metaclass);
  Py_CLEAR(clear_module_state->__pyx_n_s_microsecond);
  Py_CLEAR(clear_module_state->__pyx_n_s_microseconds);
  Py_CLEAR(clear_module_state->__pyx_n_s_milliseconds);
  Py_CLEAR(clear_module_state->__pyx_n_u_min);
  Py_CLEAR(clear_module_state->__pyx_n_s_minute);
  Py_CLEAR(clear_module_state->__pyx_n_s_minutes);
  Py_CLEAR(clear_module_state->__pyx_n_s_module);
  Py_CLEAR(clear_module_state->__pyx_n_s_month);
  Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries);
  Py_CLEAR(clear_module_state->__pyx_n_u_ms);
  Py_CLEAR(clear_module_state->__pyx_n_s_my_unit);
  Py_CLEAR(clear_module_state->__pyx_n_s_name);
  Py_CLEAR(clear_module_state->__pyx_kp_u_nanosecond_conversion_range_dat);
  Py_CLEAR(clear_module_state->__pyx_kp_u_ndarray_size_must_be_an_integer);
  Py_CLEAR(clear_module_state->__pyx_n_s_now);
  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_offset);
  Py_CLEAR(clear_module_state->__pyx_kp_u_operation_on_ndarray_datetime64);
  Py_CLEAR(clear_module_state->__pyx_n_s_ord2ymd);
  Py_CLEAR(clear_module_state->__pyx_n_s_pandas);
  Py_CLEAR(clear_module_state->__pyx_n_s_prepare);
  Py_CLEAR(clear_module_state->__pyx_n_s_print);
  Py_CLEAR(clear_module_state->__pyx_n_u_ps);
  Py_CLEAR(clear_module_state->__pyx_n_s_pydatetime);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_capi);
  Py_CLEAR(clear_module_state->__pyx_n_s_qtr);
  Py_CLEAR(clear_module_state->__pyx_n_s_qualname);
  Py_CLEAR(clear_module_state->__pyx_n_s_range);
  Py_CLEAR(clear_module_state->__pyx_n_s_replace);
  Py_CLEAR(clear_module_state->__pyx_kp_u_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_resolution_Array_with_datetime);
  Py_CLEAR(clear_module_state->__pyx_kp_u_resolution_Array_with_dtype_of);
  Py_CLEAR(clear_module_state->__pyx_kp_u_resolution_Supported_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_resolution_is_not_supported);
  Py_CLEAR(clear_module_state->__pyx_n_s_return);
  Py_CLEAR(clear_module_state->__pyx_n_u_round);
  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_secs);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_spec);
  Py_CLEAR(clear_module_state->__pyx_kp_s_src_cytimes_utils_py);
  Py_CLEAR(clear_module_state->__pyx_n_s_str);
  Py_CLEAR(clear_module_state->__pyx_kp_u_strftime_format_is_too_long_s);
  Py_CLEAR(clear_module_state->__pyx_n_s_super);
  Py_CLEAR(clear_module_state->__pyx_kp_u_support_ndarray_with_1_4_dimensi);
  Py_CLEAR(clear_module_state->__pyx_n_s_t);
  Py_CLEAR(clear_module_state->__pyx_n_s_t1);
  Py_CLEAR(clear_module_state->__pyx_n_s_t_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_t_n);
  Py_CLEAR(clear_module_state->__pyx_n_s_t_tz1);
  Py_CLEAR(clear_module_state->__pyx_n_s_td);
  Py_CLEAR(clear_module_state->__pyx_n_s_td1);
  Py_CLEAR(clear_module_state->__pyx_n_s_td2);
  Py_CLEAR(clear_module_state->__pyx_n_s_td3);
  Py_CLEAR(clear_module_state->__pyx_n_s_td4);
  Py_CLEAR(clear_module_state->__pyx_n_s_td5);
  Py_CLEAR(clear_module_state->__pyx_n_s_td6);
  Py_CLEAR(clear_module_state->__pyx_n_s_td64);
  Py_CLEAR(clear_module_state->__pyx_n_s_td7);
  Py_CLEAR(clear_module_state->__pyx_n_s_td8);
  Py_CLEAR(clear_module_state->__pyx_n_s_test);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_date_conversion);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_date_conversion_locals_Cus);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_date_generate);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_date_type_check);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_date_type_check_locals_Cus);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_datetime64_conversion);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_datetime64_type_check);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_days_bf_month);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_days_bf_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_days_in_month);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_days_in_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_dt_arithmetic);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_dt_conversion);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_dt_generate);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_dt_mainipulate);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_dt_type_check);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_dt_type_check_locals_Custo);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_dt_tzinfo);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_is_leap_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_iso_1st_monday);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_isocalendar);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_localtime_n_gmtime);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_ndarray_dt64_conversion);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_ndarray_dt64_type_check);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_ndarray_td64_conversion);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_ndarray_td64_type_check);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_ndarray_type_check);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_numpy_share);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_parser);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_quarter_of_month);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_time_conversion);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_time_conversion_locals_Cus);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_time_generate);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_time_type_check);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_time_type_check_locals_Cus);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_time_tzinfo);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_timedelta64_conversion);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_timedelta64_type_check);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_timedelta_conversion);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_timedelta_conversion_local);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_timedelta_generate);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_timedelta_type_check);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_timedelta_type_check_local);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_tzinfo_access);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_tzinfo_generate);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_tzinfo_type_check);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_utils);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_weekday);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_ymd_fr_isocalendar);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_ymd_fr_ordinal);
  Py_CLEAR(clear_module_state->__pyx_n_s_test_ymd_to_ordinal);
  Py_CLEAR(clear_module_state->__pyx_n_s_time);
  Py_CLEAR(clear_module_state->__pyx_n_s_time1);
  Py_CLEAR(clear_module_state->__pyx_n_s_time2);
  Py_CLEAR(clear_module_state->__pyx_n_s_time_tz1);
  Py_CLEAR(clear_module_state->__pyx_n_s_time_tz2);
  Py_CLEAR(clear_module_state->__pyx_n_s_timedelta);
  Py_CLEAR(clear_module_state->__pyx_n_s_timedelta64);
  Py_CLEAR(clear_module_state->__pyx_n_u_timedelta64);
  Py_CLEAR(clear_module_state->__pyx_kp_u_timedelta64_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_timedelta64_ns);
  Py_CLEAR(clear_module_state->__pyx_kp_u_timedelta64_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_timedelta64_us);
  Py_CLEAR(clear_module_state->__pyx_n_s_timestamp);
  Py_CLEAR(clear_module_state->__pyx_n_s_timetuple);
  Py_CLEAR(clear_module_state->__pyx_n_s_timetz);
  Py_CLEAR(clear_module_state->__pyx_n_s_timezone);
  Py_CLEAR(clear_module_state->__pyx_kp_u_timezone_offset_s_seconds_out_of);
  Py_CLEAR(clear_module_state->__pyx_n_s_tm);
  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_tmp);
  Py_CLEAR(clear_module_state->__pyx_n_s_tmp1);
  Py_CLEAR(clear_module_state->__pyx_n_s_tmp2);
  Py_CLEAR(clear_module_state->__pyx_n_s_tmp3);
  Py_CLEAR(clear_module_state->__pyx_kp_u_to);
  Py_CLEAR(clear_module_state->__pyx_kp_u_to_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_to_an_integer_under);
  Py_CLEAR(clear_module_state->__pyx_kp_u_to_an_integer_under_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_to_datetime64);
  Py_CLEAR(clear_module_state->__pyx_kp_u_to_int64_under);
  Py_CLEAR(clear_module_state->__pyx_kp_u_to_int64_under_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_to_int64_under_3);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_unit);
  Py_CLEAR(clear_module_state->__pyx_n_s_today);
  Py_CLEAR(clear_module_state->__pyx_n_s_toordinal);
  Py_CLEAR(clear_module_state->__pyx_n_s_total_seconds);
  Py_CLEAR(clear_module_state->__pyx_n_s_ts);
  Py_CLEAR(clear_module_state->__pyx_n_s_typeref);
  Py_CLEAR(clear_module_state->__pyx_n_s_tz);
  Py_CLEAR(clear_module_state->__pyx_n_s_tz1);
  Py_CLEAR(clear_module_state->__pyx_n_s_tz2);
  Py_CLEAR(clear_module_state->__pyx_n_s_tz3);
  Py_CLEAR(clear_module_state->__pyx_n_s_tz4);
  Py_CLEAR(clear_module_state->__pyx_n_s_tz_str);
  Py_CLEAR(clear_module_state->__pyx_n_s_tzinfo);
  Py_CLEAR(clear_module_state->__pyx_n_s_tzname);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unable_to_parse_datetime_unit_fr);
  Py_CLEAR(clear_module_state->__pyx_n_s_unit);
  Py_CLEAR(clear_module_state->__pyx_n_s_units);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unknown_datetime_unit_d);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unknown_datetime_unit_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unsupported_datetime_unit_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unsupported_factor_d_for_timedel);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unsupported_factor_d_for_timedel_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_us);
  Py_CLEAR(clear_module_state->__pyx_n_u_us);
  Py_CLEAR(clear_module_state->__pyx_n_s_utc);
  Py_CLEAR(clear_module_state->__pyx_n_s_utcoffset);
  Py_CLEAR(clear_module_state->__pyx_n_s_utctimetuple);
  Py_CLEAR(clear_module_state->__pyx_n_s_val);
  Py_CLEAR(clear_module_state->__pyx_n_s_value);
  Py_CLEAR(clear_module_state->__pyx_n_s_week);
  Py_CLEAR(clear_module_state->__pyx_n_s_weekday);
  Py_CLEAR(clear_module_state->__pyx_kp_u_with_datetime_unit);
  Py_CLEAR(clear_module_state->__pyx_kp_u_without_specifying_the_array_da);
  Py_CLEAR(clear_module_state->__pyx_n_s_y);
  Py_CLEAR(clear_module_state->__pyx_n_s_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_ymd2ord);
  Py_CLEAR(clear_module_state->__pyx_n_s_zone);
  Py_CLEAR(clear_module_state->__pyx_n_s_zoneinfo);
  Py_CLEAR(clear_module_state->__pyx_int_0);
  Py_CLEAR(clear_module_state->__pyx_int_1);
  Py_CLEAR(clear_module_state->__pyx_int_2);
  Py_CLEAR(clear_module_state->__pyx_int_3);
  Py_CLEAR(clear_module_state->__pyx_int_4);
  Py_CLEAR(clear_module_state->__pyx_int_5);
  Py_CLEAR(clear_module_state->__pyx_int_6);
  Py_CLEAR(clear_module_state->__pyx_int_8);
  Py_CLEAR(clear_module_state->__pyx_int_23);
  Py_CLEAR(clear_module_state->__pyx_int_59);
  Py_CLEAR(clear_module_state->__pyx_int_60);
  Py_CLEAR(clear_module_state->__pyx_int_1000);
  Py_CLEAR(clear_module_state->__pyx_int_1970);
  Py_CLEAR(clear_module_state->__pyx_int_2021);
  Py_CLEAR(clear_module_state->__pyx_int_3600);
  Py_CLEAR(clear_module_state->__pyx_int_10000);
  Py_CLEAR(clear_module_state->__pyx_int_86399);
  Py_CLEAR(clear_module_state->__pyx_int_86400);
  Py_CLEAR(clear_module_state->__pyx_int_100000);
  Py_CLEAR(clear_module_state->__pyx_int_1000000);
  Py_CLEAR(clear_module_state->__pyx_int_86400000000);
  Py_CLEAR(clear_module_state->__pyx_int_neg_1);
  Py_CLEAR(clear_module_state->__pyx_int_neg_2);
  Py_CLEAR(clear_module_state->__pyx_int_neg_3);
  Py_CLEAR(clear_module_state->__pyx_int_neg_23);
  Py_CLEAR(clear_module_state->__pyx_int_neg_59);
  Py_CLEAR(clear_module_state->__pyx_int_neg_60);
  Py_CLEAR(clear_module_state->__pyx_int_neg_1000);
  Py_CLEAR(clear_module_state->__pyx_int_neg_86399);
  Py_CLEAR(clear_module_state->__pyx_int_neg_86400);
  Py_CLEAR(clear_module_state->__pyx_int_neg_100000);
  Py_CLEAR(clear_module_state->__pyx_tuple_);
  Py_CLEAR(clear_module_state->__pyx_tuple__2);
  Py_CLEAR(clear_module_state->__pyx_tuple__3);
  Py_CLEAR(clear_module_state->__pyx_tuple__4);
  Py_CLEAR(clear_module_state->__pyx_tuple__5);
  Py_CLEAR(clear_module_state->__pyx_tuple__6);
  Py_CLEAR(clear_module_state->__pyx_tuple__7);
  Py_CLEAR(clear_module_state->__pyx_tuple__8);
  Py_CLEAR(clear_module_state->__pyx_slice__99);
  Py_CLEAR(clear_module_state->__pyx_tuple__16);
  Py_CLEAR(clear_module_state->__pyx_tuple__17);
  Py_CLEAR(clear_module_state->__pyx_tuple__18);
  Py_CLEAR(clear_module_state->__pyx_tuple__20);
  Py_CLEAR(clear_module_state->__pyx_tuple__21);
  Py_CLEAR(clear_module_state->__pyx_tuple__22);
  Py_CLEAR(clear_module_state->__pyx_tuple__23);
  Py_CLEAR(clear_module_state->__pyx_tuple__24);
  Py_CLEAR(clear_module_state->__pyx_tuple__25);
  Py_CLEAR(clear_module_state->__pyx_tuple__26);
  Py_CLEAR(clear_module_state->__pyx_tuple__27);
  Py_CLEAR(clear_module_state->__pyx_tuple__28);
  Py_CLEAR(clear_module_state->__pyx_tuple__29);
  Py_CLEAR(clear_module_state->__pyx_tuple__30);
  Py_CLEAR(clear_module_state->__pyx_tuple__31);
  Py_CLEAR(clear_module_state->__pyx_tuple__32);
  Py_CLEAR(clear_module_state->__pyx_tuple__33);
  Py_CLEAR(clear_module_state->__pyx_tuple__34);
  Py_CLEAR(clear_module_state->__pyx_tuple__36);
  Py_CLEAR(clear_module_state->__pyx_tuple__39);
  Py_CLEAR(clear_module_state->__pyx_tuple__41);
  Py_CLEAR(clear_module_state->__pyx_tuple__42);
  Py_CLEAR(clear_module_state->__pyx_tuple__43);
  Py_CLEAR(clear_module_state->__pyx_tuple__44);
  Py_CLEAR(clear_module_state->__pyx_tuple__45);
  Py_CLEAR(clear_module_state->__pyx_tuple__46);
  Py_CLEAR(clear_module_state->__pyx_tuple__47);
  Py_CLEAR(clear_module_state->__pyx_tuple__48);
  Py_CLEAR(clear_module_state->__pyx_tuple__49);
  Py_CLEAR(clear_module_state->__pyx_tuple__50);
  Py_CLEAR(clear_module_state->__pyx_tuple__51);
  Py_CLEAR(clear_module_state->__pyx_tuple__52);
  Py_CLEAR(clear_module_state->__pyx_tuple__53);
  Py_CLEAR(clear_module_state->__pyx_tuple__54);
  Py_CLEAR(clear_module_state->__pyx_tuple__55);
  Py_CLEAR(clear_module_state->__pyx_tuple__56);
  Py_CLEAR(clear_module_state->__pyx_tuple__57);
  Py_CLEAR(clear_module_state->__pyx_tuple__58);
  Py_CLEAR(clear_module_state->__pyx_tuple__59);
  Py_CLEAR(clear_module_state->__pyx_tuple__60);
  Py_CLEAR(clear_module_state->__pyx_tuple__61);
  Py_CLEAR(clear_module_state->__pyx_tuple__62);
  Py_CLEAR(clear_module_state->__pyx_tuple__63);
  Py_CLEAR(clear_module_state->__pyx_tuple__64);
  Py_CLEAR(clear_module_state->__pyx_tuple__65);
  Py_CLEAR(clear_module_state->__pyx_tuple__66);
  Py_CLEAR(clear_module_state->__pyx_tuple__67);
  Py_CLEAR(clear_module_state->__pyx_tuple__68);
  Py_CLEAR(clear_module_state->__pyx_tuple__69);
  Py_CLEAR(clear_module_state->__pyx_tuple__70);
  Py_CLEAR(clear_module_state->__pyx_tuple__71);
  Py_CLEAR(clear_module_state->__pyx_tuple__72);
  Py_CLEAR(clear_module_state->__pyx_tuple__73);
  Py_CLEAR(clear_module_state->__pyx_tuple__74);
  Py_CLEAR(clear_module_state->__pyx_tuple__75);
  Py_CLEAR(clear_module_state->__pyx_tuple__76);
  Py_CLEAR(clear_module_state->__pyx_tuple__77);
  Py_CLEAR(clear_module_state->__pyx_tuple__78);
  Py_CLEAR(clear_module_state->__pyx_tuple__79);
  Py_CLEAR(clear_module_state->__pyx_tuple__80);
  Py_CLEAR(clear_module_state->__pyx_tuple__81);
  Py_CLEAR(clear_module_state->__pyx_tuple__82);
  Py_CLEAR(clear_module_state->__pyx_tuple__83);
  Py_CLEAR(clear_module_state->__pyx_tuple__84);
  Py_CLEAR(clear_module_state->__pyx_tuple__85);
  Py_CLEAR(clear_module_state->__pyx_tuple__86);
  Py_CLEAR(clear_module_state->__pyx_tuple__87);
  Py_CLEAR(clear_module_state->__pyx_tuple__88);
  Py_CLEAR(clear_module_state->__pyx_tuple__89);
  Py_CLEAR(clear_module_state->__pyx_tuple__90);
  Py_CLEAR(clear_module_state->__pyx_tuple__91);
  Py_CLEAR(clear_module_state->__pyx_tuple__92);
  Py_CLEAR(clear_module_state->__pyx_tuple__93);
  Py_CLEAR(clear_module_state->__pyx_tuple__94);
  Py_CLEAR(clear_module_state->__pyx_tuple__95);
  Py_CLEAR(clear_module_state->__pyx_tuple__96);
  Py_CLEAR(clear_module_state->__pyx_tuple__97);
  Py_CLEAR(clear_module_state->__pyx_tuple__98);
  Py_CLEAR(clear_module_state->__pyx_slice__100);
  Py_CLEAR(clear_module_state->__pyx_tuple__101);
  Py_CLEAR(clear_module_state->__pyx_tuple__102);
  Py_CLEAR(clear_module_state->__pyx_tuple__103);
  Py_CLEAR(clear_module_state->__pyx_tuple__104);
  Py_CLEAR(clear_module_state->__pyx_tuple__105);
  Py_CLEAR(clear_module_state->__pyx_tuple__106);
  Py_CLEAR(clear_module_state->__pyx_tuple__107);
  Py_CLEAR(clear_module_state->__pyx_tuple__108);
  Py_CLEAR(clear_module_state->__pyx_tuple__109);
  Py_CLEAR(clear_module_state->__pyx_tuple__110);
  Py_CLEAR(clear_module_state->__pyx_tuple__111);
  Py_CLEAR(clear_module_state->__pyx_tuple__112);
  Py_CLEAR(clear_module_state->__pyx_tuple__113);
  Py_CLEAR(clear_module_state->__pyx_tuple__114);
  Py_CLEAR(clear_module_state->__pyx_tuple__115);
  Py_CLEAR(clear_module_state->__pyx_tuple__116);
  Py_CLEAR(clear_module_state->__pyx_tuple__118);
  Py_CLEAR(clear_module_state->__pyx_tuple__119);
  Py_CLEAR(clear_module_state->__pyx_tuple__120);
  Py_CLEAR(clear_module_state->__pyx_tuple__122);
  Py_CLEAR(clear_module_state->__pyx_tuple__124);
  Py_CLEAR(clear_module_state->__pyx_tuple__126);
  Py_CLEAR(clear_module_state->__pyx_tuple__128);
  Py_CLEAR(clear_module_state->__pyx_tuple__130);
  Py_CLEAR(clear_module_state->__pyx_tuple__132);
  Py_CLEAR(clear_module_state->__pyx_tuple__134);
  Py_CLEAR(clear_module_state->__pyx_tuple__136);
  Py_CLEAR(clear_module_state->__pyx_tuple__138);
  Py_CLEAR(clear_module_state->__pyx_tuple__140);
  Py_CLEAR(clear_module_state->__pyx_tuple__142);
  Py_CLEAR(clear_module_state->__pyx_tuple__144);
  Py_CLEAR(clear_module_state->__pyx_tuple__146);
  Py_CLEAR(clear_module_state->__pyx_tuple__148);
  Py_CLEAR(clear_module_state->__pyx_tuple__150);
  Py_CLEAR(clear_module_state->__pyx_tuple__152);
  Py_CLEAR(clear_module_state->__pyx_tuple__154);
  Py_CLEAR(clear_module_state->__pyx_tuple__156);
  Py_CLEAR(clear_module_state->__pyx_tuple__158);
  Py_CLEAR(clear_module_state->__pyx_tuple__160);
  Py_CLEAR(clear_module_state->__pyx_tuple__162);
  Py_CLEAR(clear_module_state->__pyx_tuple__164);
  Py_CLEAR(clear_module_state->__pyx_tuple__166);
  Py_CLEAR(clear_module_state->__pyx_tuple__168);
  Py_CLEAR(clear_module_state->__pyx_tuple__170);
  Py_CLEAR(clear_module_state->__pyx_tuple__172);
  Py_CLEAR(clear_module_state->__pyx_tuple__174);
  Py_CLEAR(clear_module_state->__pyx_tuple__176);
  Py_CLEAR(clear_module_state->__pyx_tuple__178);
  Py_CLEAR(clear_module_state->__pyx_tuple__180);
  Py_CLEAR(clear_module_state->__pyx_tuple__182);
  Py_CLEAR(clear_module_state->__pyx_tuple__185);
  Py_CLEAR(clear_module_state->__pyx_tuple__187);
  Py_CLEAR(clear_module_state->__pyx_tuple__189);
  Py_CLEAR(clear_module_state->__pyx_tuple__191);
  Py_CLEAR(clear_module_state->__pyx_tuple__193);
  Py_CLEAR(clear_module_state->__pyx_tuple__195);
  Py_CLEAR(clear_module_state->__pyx_tuple__197);
  Py_CLEAR(clear_module_state->__pyx_tuple__200);
  Py_CLEAR(clear_module_state->__pyx_tuple__203);
  Py_CLEAR(clear_module_state->__pyx_codeobj__121);
  Py_CLEAR(clear_module_state->__pyx_codeobj__123);
  Py_CLEAR(clear_module_state->__pyx_codeobj__125);
  Py_CLEAR(clear_module_state->__pyx_codeobj__127);
  Py_CLEAR(clear_module_state->__pyx_codeobj__129);
  Py_CLEAR(clear_module_state->__pyx_codeobj__131);
  Py_CLEAR(clear_module_state->__pyx_codeobj__133);
  Py_CLEAR(clear_module_state->__pyx_codeobj__135);
  Py_CLEAR(clear_module_state->__pyx_codeobj__137);
  Py_CLEAR(clear_module_state->__pyx_codeobj__139);
  Py_CLEAR(clear_module_state->__pyx_codeobj__141);
  Py_CLEAR(clear_module_state->__pyx_codeobj__143);
  Py_CLEAR(clear_module_state->__pyx_codeobj__145);
  Py_CLEAR(clear_module_state->__pyx_codeobj__147);
  Py_CLEAR(clear_module_state->__pyx_codeobj__149);
  Py_CLEAR(clear_module_state->__pyx_codeobj__151);
  Py_CLEAR(clear_module_state->__pyx_codeobj__153);
  Py_CLEAR(clear_module_state->__pyx_codeobj__155);
  Py_CLEAR(clear_module_state->__pyx_codeobj__157);
  Py_CLEAR(clear_module_state->__pyx_codeobj__159);
  Py_CLEAR(clear_module_state->__pyx_codeobj__161);
  Py_CLEAR(clear_module_state->__pyx_codeobj__163);
  Py_CLEAR(clear_module_state->__pyx_codeobj__165);
  Py_CLEAR(clear_module_state->__pyx_codeobj__167);
  Py_CLEAR(clear_module_state->__pyx_codeobj__169);
  Py_CLEAR(clear_module_state->__pyx_codeobj__171);
  Py_CLEAR(clear_module_state->__pyx_codeobj__173);
  Py_CLEAR(clear_module_state->__pyx_codeobj__175);
  Py_CLEAR(clear_module_state->__pyx_codeobj__177);
  Py_CLEAR(clear_module_state->__pyx_codeobj__179);
  Py_CLEAR(clear_module_state->__pyx_codeobj__181);
  Py_CLEAR(clear_module_state->__pyx_codeobj__183);
  Py_CLEAR(clear_module_state->__pyx_codeobj__184);
  Py_CLEAR(clear_module_state->__pyx_codeobj__186);
  Py_CLEAR(clear_module_state->__pyx_codeobj__188);
  Py_CLEAR(clear_module_state->__pyx_codeobj__190);
  Py_CLEAR(clear_module_state->__pyx_codeobj__192);
  Py_CLEAR(clear_module_state->__pyx_codeobj__194);
  Py_CLEAR(clear_module_state->__pyx_codeobj__196);
  Py_CLEAR(clear_module_state->__pyx_codeobj__198);
  Py_CLEAR(clear_module_state->__pyx_codeobj__199);
  Py_CLEAR(clear_module_state->__pyx_codeobj__201);
  Py_CLEAR(clear_module_state->__pyx_codeobj__202);
  Py_CLEAR(clear_module_state->__pyx_codeobj__204);
  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_00);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00_00);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00_00_00_06d);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00_00_01);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00_00_01_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00_00_02d);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00_01_01);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00_01_01_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_0101);
  Py_VISIT(traverse_module_state->__pyx_kp_u_0101_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_01_02_2021);
  Py_VISIT(traverse_module_state->__pyx_kp_u_01_02_2021_000006_05_04_03);
  Py_VISIT(traverse_module_state->__pyx_kp_u_01_02_2021_000006_05_04_03UTC_01);
  Py_VISIT(traverse_module_state->__pyx_kp_u_01_02_2021_000006_05_04_03_0101);
  Py_VISIT(traverse_module_state->__pyx_kp_u_02d);
  Py_VISIT(traverse_module_state->__pyx_kp_u_03_04_05);
  Py_VISIT(traverse_module_state->__pyx_kp_u_03_04_05_000006);
  Py_VISIT(traverse_module_state->__pyx_kp_u_03_04_05_000006_0101);
  Py_VISIT(traverse_module_state->__pyx_kp_u_03_04_05_0101);
  Py_VISIT(traverse_module_state->__pyx_kp_u_04d);
  Py_VISIT(traverse_module_state->__pyx_kp_u_06d);
  Py_VISIT(traverse_module_state->__pyx_kp_u_06d_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_2021_000);
  Py_VISIT(traverse_module_state->__pyx_kp_u_2021_01_02);
  Py_VISIT(traverse_module_state->__pyx_kp_u_2021_01_02T03_04_05);
  Py_VISIT(traverse_module_state->__pyx_kp_u_2021_01_02T03_04_05_000006);
  Py_VISIT(traverse_module_state->__pyx_kp_u_2021_01_02T03_04_05_006007);
  Py_VISIT(traverse_module_state->__pyx_kp_u_2021_01_02_03_04_05_000006_0101);
  Py_VISIT(traverse_module_state->__pyx_kp_u_2021_01_02_03_04_05_0101);
  Py_VISIT(traverse_module_state->__pyx_kp_u_2021_365);
  Py_VISIT(traverse_module_state->__pyx_kp_u_2021_367);
  Py_VISIT(traverse_module_state->__pyx_kp_u_2021_W52_6);
  Py_VISIT(traverse_module_state->__pyx_kp_u_2359);
  Py_VISIT(traverse_module_state->__pyx_kp_u_2359_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_24_01_01);
  Py_VISIT(traverse_module_state->__pyx_kp_u_24_01_01_000001);
  Py_VISIT(traverse_module_state->__pyx_kp_u_24_01_01_000001_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_24_01_01_001000);
  Py_VISIT(traverse_module_state->__pyx_kp_u_24_01_01_001000_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_24_01_01_001001);
  Py_VISIT(traverse_module_state->__pyx_kp_u_24_01_01_001001_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_24_01_01_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_2d);
  Py_VISIT(traverse_module_state->__pyx_n_u_Apr);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Array_with_dtype_of_datetime64);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Asia_Shanghai);
  Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError);
  Py_VISIT(traverse_module_state->__pyx_n_u_Aug);
  Py_VISIT(traverse_module_state->__pyx_n_u_CET);
  Py_VISIT(traverse_module_state->__pyx_n_u_CST);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Conversion_limits_to_datetime_u);
  Py_VISIT(traverse_module_state->__pyx_n_s_CustomDate);
  Py_VISIT(traverse_module_state->__pyx_n_s_CustomDateTime);
  Py_VISIT(traverse_module_state->__pyx_n_s_CustomTD);
  Py_VISIT(traverse_module_state->__pyx_n_s_CustomTime);
  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_IN_MONTH);
  Py_VISIT(traverse_module_state->__pyx_n_s_DAYS_IN_QUARTER);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_DD_MAX);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_DD_MIN);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_HH_MAX);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_HH_MIN);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_MI_MAX);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_MI_MIN);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_MM_MAX);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_MM_MIN);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_MS_MAX);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_MS_MIN);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_NS_MAX);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_NS_MIN);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_SS_MAX);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_SS_MIN);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_US_MAX);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_US_MIN);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_WW_MAX);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_WW_MIN);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_YY_MAX);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT64_NS_YY_MIN);
  Py_VISIT(traverse_module_state->__pyx_n_u_Dec);
  Py_VISIT(traverse_module_state->__pyx_n_s_EPOCH_DAY);
  Py_VISIT(traverse_module_state->__pyx_n_s_EPOCH_DT);
  Py_VISIT(traverse_module_state->__pyx_n_s_EPOCH_HOUR);
  Py_VISIT(traverse_module_state->__pyx_n_s_EPOCH_MICROSECOND);
  Py_VISIT(traverse_module_state->__pyx_n_s_EPOCH_MILLISECOND);
  Py_VISIT(traverse_module_state->__pyx_n_s_EPOCH_MINUTE);
  Py_VISIT(traverse_module_state->__pyx_n_s_EPOCH_MONTH);
  Py_VISIT(traverse_module_state->__pyx_n_s_EPOCH_SECOND);
  Py_VISIT(traverse_module_state->__pyx_n_s_EPOCH_YEAR);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Failed_datetime64_type_check);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Failed_timedelta64_type_check);
  Py_VISIT(traverse_module_state->__pyx_n_u_False);
  Py_VISIT(traverse_module_state->__pyx_n_u_Feb);
  Py_VISIT(traverse_module_state->__pyx_kp_u_For_comparision_array_size_must);
  Py_VISIT(traverse_module_state->__pyx_n_u_Fri);
  Py_VISIT(traverse_module_state->__pyx_n_u_GMT);
  Py_VISIT(traverse_module_state->__pyx_n_u_GMT0);
  Py_VISIT(traverse_module_state->__pyx_kp_u_GMT_0);
  Py_VISIT(traverse_module_state->__pyx_kp_u_GMT_0_2);
  Py_VISIT(traverse_module_state->__pyx_n_u_Greenwich);
  Py_VISIT(traverse_module_state->__pyx_n_s_ImportError);
  Py_VISIT(traverse_module_state->__pyx_n_s_InvalidTimezoneError);
  Py_VISIT(traverse_module_state->__pyx_n_u_Jan);
  Py_VISIT(traverse_module_state->__pyx_n_u_Jul);
  Py_VISIT(traverse_module_state->__pyx_n_u_Jun);
  Py_VISIT(traverse_module_state->__pyx_n_s_LOCALTZ);
  Py_VISIT(traverse_module_state->__pyx_n_s_LOCAL_TZ);
  Py_VISIT(traverse_module_state->__pyx_n_u_M);
  Py_VISIT(traverse_module_state->__pyx_n_s_MAXORDINAL);
  Py_VISIT(traverse_module_state->__pyx_n_s_MS_DAY);
  Py_VISIT(traverse_module_state->__pyx_n_s_MS_HOUR);
  Py_VISIT(traverse_module_state->__pyx_n_s_MS_MINUTE);
  Py_VISIT(traverse_module_state->__pyx_n_s_MS_SECOND);
  Py_VISIT(traverse_module_state->__pyx_n_u_Mar);
  Py_VISIT(traverse_module_state->__pyx_n_u_May);
  Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError);
  Py_VISIT(traverse_module_state->__pyx_n_u_Mon);
  Py_VISIT(traverse_module_state->__pyx_n_s_NS_DAY);
  Py_VISIT(traverse_module_state->__pyx_n_s_NS_HOUR);
  Py_VISIT(traverse_module_state->__pyx_n_s_NS_MICROSECOND);
  Py_VISIT(traverse_module_state->__pyx_n_s_NS_MILLISECOND);
  Py_VISIT(traverse_module_state->__pyx_n_s_NS_MINUTE);
  Py_VISIT(traverse_module_state->__pyx_n_s_NS_SECOND);
  Py_VISIT(traverse_module_state->__pyx_n_s_None);
  Py_VISIT(traverse_module_state->__pyx_kp_u_None);
  Py_VISIT(traverse_module_state->__pyx_n_u_Nov);
  Py_VISIT(traverse_module_state->__pyx_n_s_ORDINAL_MAX);
  Py_VISIT(traverse_module_state->__pyx_n_u_Oct);
  Py_VISIT(traverse_module_state->__pyx_n_s_OverflowError);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_date_arithmetic);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_date_conversion);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_date_generate);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_date_type_check);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_datetime64_conversion);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_datetime64_type_check);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_days_bf_month);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_days_bf_year);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_days_in_month);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_days_in_quarter);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_dt_conversion);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_dt_generate);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_dt_manipulate);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_dt_type_check);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_dt_tzinfo);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_is_leap_year);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_iso_1st_monday);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_isocalendar);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_localtime_gmtime);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_ndarray_dt64_conversion);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_ndarray_dt64_type_check);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_ndarray_td64_conversion);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_ndarray_td64_type_check);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_ndarray_type_check);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_numpy_share);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_parser);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_quarter_of_month);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_time_conversion);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_time_generate);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_time_type_check);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_time_tzinfo);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_timedelta64_conversion);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_timedelta64_type_check);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_timedelta_conversion);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_timedelta_generate);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_timedelta_type_chech);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_tzinfo_access);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_tzinfo_generate);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_tzinfo_type_check);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_weekday);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_ymd_fr_isocalendar);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_ymd_fr_ordinal);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Passed_ymd_to_ordinal);
  Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeError);
  Py_VISIT(traverse_module_state->__pyx_n_s_SS_DAY);
  Py_VISIT(traverse_module_state->__pyx_n_s_SS_HOUR);
  Py_VISIT(traverse_module_state->__pyx_n_s_SS_MINUTE);
  Py_VISIT(traverse_module_state->__pyx_n_u_Sat);
  Py_VISIT(traverse_module_state->__pyx_n_u_Sep);
  Py_VISIT(traverse_module_state->__pyx_n_u_Sun);
  Py_VISIT(traverse_module_state->__pyx_n_u_T);
  Py_VISIT(traverse_module_state->__pyx_n_s_TD64_MM_DAY);
  Py_VISIT(traverse_module_state->__pyx_n_s_TD64_MM_MICROSECOND);
  Py_VISIT(traverse_module_state->__pyx_n_s_TD64_MM_MILLISECOND);
  Py_VISIT(traverse_module_state->__pyx_n_s_TD64_MM_NANOSECOND);
  Py_VISIT(traverse_module_state->__pyx_n_s_TD64_MM_SECOND);
  Py_VISIT(traverse_module_state->__pyx_n_s_TD64_YY_DAY);
  Py_VISIT(traverse_module_state->__pyx_n_s_TD64_YY_MICROSECOND);
  Py_VISIT(traverse_module_state->__pyx_n_s_TD64_YY_MILLISECOND);
  Py_VISIT(traverse_module_state->__pyx_n_s_TD64_YY_NANOSECOND);
  Py_VISIT(traverse_module_state->__pyx_n_s_TD64_YY_SECOND);
  Py_VISIT(traverse_module_state->__pyx_n_s_TIMEZONE_MAP);
  Py_VISIT(traverse_module_state->__pyx_n_u_Thu);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Time_zones_are_not_available_fro);
  Py_VISIT(traverse_module_state->__pyx_n_s_Timestamp);
  Py_VISIT(traverse_module_state->__pyx_n_u_True);
  Py_VISIT(traverse_module_state->__pyx_n_u_Tue);
  Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
  Py_VISIT(traverse_module_state->__pyx_n_s_US_DAY);
  Py_VISIT(traverse_module_state->__pyx_n_s_US_HOUR);
  Py_VISIT(traverse_module_state->__pyx_n_s_US_MILLISECOND);
  Py_VISIT(traverse_module_state->__pyx_n_s_US_MINUTE);
  Py_VISIT(traverse_module_state->__pyx_n_s_US_SECOND);
  Py_VISIT(traverse_module_state->__pyx_n_s_UTC);
  Py_VISIT(traverse_module_state->__pyx_n_u_UTC);
  Py_VISIT(traverse_module_state->__pyx_n_u_Universal);
  Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
  Py_VISIT(traverse_module_state->__pyx_n_u_W);
  Py_VISIT(traverse_module_state->__pyx_n_u_Wed);
  Py_VISIT(traverse_module_state->__pyx_n_u_Y);
  Py_VISIT(traverse_module_state->__pyx_n_s_ZeroDivisionError);
  Py_VISIT(traverse_module_state->__pyx_n_s_ZoneInfo);
  Py_VISIT(traverse_module_state->__pyx_n_u_Zulu);
  Py_VISIT(traverse_module_state->__pyx_kp_u__10);
  Py_VISIT(traverse_module_state->__pyx_kp_u__11);
  Py_VISIT(traverse_module_state->__pyx_kp_u__117);
  Py_VISIT(traverse_module_state->__pyx_kp_u__12);
  Py_VISIT(traverse_module_state->__pyx_kp_u__13);
  Py_VISIT(traverse_module_state->__pyx_kp_u__14);
  Py_VISIT(traverse_module_state->__pyx_kp_u__15);
  Py_VISIT(traverse_module_state->__pyx_kp_u__19);
  Py_VISIT(traverse_module_state->__pyx_n_s__205);
  Py_VISIT(traverse_module_state->__pyx_kp_u__35);
  Py_VISIT(traverse_module_state->__pyx_n_s__37);
  Py_VISIT(traverse_module_state->__pyx_kp_u__38);
  Py_VISIT(traverse_module_state->__pyx_kp_u__40);
  Py_VISIT(traverse_module_state->__pyx_kp_u__9);
  Py_VISIT(traverse_module_state->__pyx_n_u_a);
  Py_VISIT(traverse_module_state->__pyx_n_s_all);
  Py_VISIT(traverse_module_state->__pyx_n_s_arr);
  Py_VISIT(traverse_module_state->__pyx_n_s_arr_i);
  Py_VISIT(traverse_module_state->__pyx_n_s_array);
  Py_VISIT(traverse_module_state->__pyx_kp_u_array_size_must_be_greater_than);
  Py_VISIT(traverse_module_state->__pyx_n_u_as);
  Py_VISIT(traverse_module_state->__pyx_n_s_astype);
  Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
  Py_VISIT(traverse_module_state->__pyx_n_s_available_timezones);
  Py_VISIT(traverse_module_state->__pyx_n_s_babel_dates);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_access_the_time_value_fro);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_cast);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_cast_ndarray);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_cast_ndarray_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_ceil_to_multiple_0);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_check_if_ndarray_s_is_wit);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_check_ndarray);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_compare_ndarrays_with_dif);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_convert_ndarray);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_convert_ndarray_from_date);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_floor_to_multiple_0);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_perform_addition_on_ndarr);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_perform_comparison_on_nda);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_perform_subtraction_on_nd);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_round_to_multiple_0);
  Py_VISIT(traverse_module_state->__pyx_n_u_ceil);
  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_cmp);
  Py_VISIT(traverse_module_state->__pyx_n_s_count);
  Py_VISIT(traverse_module_state->__pyx_n_s_cytimes);
  Py_VISIT(traverse_module_state->__pyx_n_s_cytimes_utils);
  Py_VISIT(traverse_module_state->__pyx_n_s_d);
  Py_VISIT(traverse_module_state->__pyx_n_u_d);
  Py_VISIT(traverse_module_state->__pyx_n_s_date);
  Py_VISIT(traverse_module_state->__pyx_n_s_datetime);
  Py_VISIT(traverse_module_state->__pyx_n_s_datetime64);
  Py_VISIT(traverse_module_state->__pyx_n_u_datetime64);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_D);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_M);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_W);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_Y);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_h);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_m);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_ms);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_ns);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_s_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_us);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime_s_is_ambiguous);
  Py_VISIT(traverse_module_state->__pyx_n_s_day);
  Py_VISIT(traverse_module_state->__pyx_n_s_days_before_month);
  Py_VISIT(traverse_module_state->__pyx_n_s_days_before_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_days_in_month);
  Py_VISIT(traverse_module_state->__pyx_n_s_dict);
  Py_VISIT(traverse_module_state->__pyx_kp_u_division_by_zero_for_utils_arr_c);
  Py_VISIT(traverse_module_state->__pyx_kp_u_division_by_zero_for_utils_arr_f);
  Py_VISIT(traverse_module_state->__pyx_kp_u_division_by_zero_for_utils_arr_r);
  Py_VISIT(traverse_module_state->__pyx_kp_u_division_by_zero_for_utils_math);
  Py_VISIT(traverse_module_state->__pyx_kp_u_division_by_zero_for_utils_math_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_division_by_zero_for_utils_math_3);
  Py_VISIT(traverse_module_state->__pyx_kp_u_division_by_zero_for_utils_math_4);
  Py_VISIT(traverse_module_state->__pyx_kp_u_division_by_zero_in_arr_mod);
  Py_VISIT(traverse_module_state->__pyx_n_s_doc);
  Py_VISIT(traverse_module_state->__pyx_n_s_dst);
  Py_VISIT(traverse_module_state->__pyx_n_s_dt);
  Py_VISIT(traverse_module_state->__pyx_n_s_dt2);
  Py_VISIT(traverse_module_state->__pyx_n_s_dt64);
  Py_VISIT(traverse_module_state->__pyx_n_s_dt_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_dt_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_dt_n);
  Py_VISIT(traverse_module_state->__pyx_n_s_dt_str);
  Py_VISIT(traverse_module_state->__pyx_n_s_dt_tz1);
  Py_VISIT(traverse_module_state->__pyx_n_s_dt_tz2);
  Py_VISIT(traverse_module_state->__pyx_n_s_dt_tz3);
  Py_VISIT(traverse_module_state->__pyx_n_s_dt_tz4);
  Py_VISIT(traverse_module_state->__pyx_n_s_dtype);
  Py_VISIT(traverse_module_state->__pyx_n_s_equal);
  Py_VISIT(traverse_module_state->__pyx_n_s_errors);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expects_datetime_tzinfo_got_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expects_np_datetime64_got_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expects_np_ndarray_datetime64_go);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expects_np_ndarray_datetime64_ti);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expects_np_ndarray_datetime64_ti_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expects_np_ndarray_timedelta64_g);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expects_np_timedelta64_got_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_failed_to_allocate_memory_for_st);
  Py_VISIT(traverse_module_state->__pyx_n_u_floor);
  Py_VISIT(traverse_module_state->__pyx_n_s_fold);
  Py_VISIT(traverse_module_state->__pyx_n_s_fromtimestamp);
  Py_VISIT(traverse_module_state->__pyx_n_s_fromutc);
  Py_VISIT(traverse_module_state->__pyx_n_u_fs);
  Py_VISIT(traverse_module_state->__pyx_n_s_gmtime);
  Py_VISIT(traverse_module_state->__pyx_n_s_h);
  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_hours);
  Py_VISIT(traverse_module_state->__pyx_n_s_i);
  Py_VISIT(traverse_module_state->__pyx_n_s_import);
  Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass);
  Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
  Py_VISIT(traverse_module_state->__pyx_n_u_int64);
  Py_VISIT(traverse_module_state->__pyx_kp_u_int64_under_D_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_int64_under_M_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_int64_under_Y_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_int64_under_h_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_int64_under_m_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_int64_under_ms_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_int64_under_ns_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_int64_under_s_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_int64_under_us_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_character_s_as_an_intege);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_timezone);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_leap);
  Py_VISIT(traverse_module_state->__pyx_kp_u_is_not_supported);
  Py_VISIT(traverse_module_state->__pyx_kp_u_is_not_supported_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_is_not_supported_3);
  Py_VISIT(traverse_module_state->__pyx_n_s_iso_calr);
  Py_VISIT(traverse_module_state->__pyx_n_s_iso_week);
  Py_VISIT(traverse_module_state->__pyx_n_s_iso_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_isocalendar);
  Py_VISIT(traverse_module_state->__pyx_n_s_isoweek1monday);
  Py_VISIT(traverse_module_state->__pyx_n_s_isoweek_to_gregorian);
  Py_VISIT(traverse_module_state->__pyx_n_s_key);
  Py_VISIT(traverse_module_state->__pyx_n_u_local);
  Py_VISIT(traverse_module_state->__pyx_n_u_localize);
  Py_VISIT(traverse_module_state->__pyx_n_s_localtime);
  Py_VISIT(traverse_module_state->__pyx_n_s_m);
  Py_VISIT(traverse_module_state->__pyx_n_u_m);
  Py_VISIT(traverse_module_state->__pyx_kp_u_m_d_Y);
  Py_VISIT(traverse_module_state->__pyx_kp_u_m_d_Y_f_S_M_H);
  Py_VISIT(traverse_module_state->__pyx_kp_u_m_d_Y_f_S_M_H_Z);
  Py_VISIT(traverse_module_state->__pyx_kp_u_m_d_Y_f_S_M_H_z);
  Py_VISIT(traverse_module_state->__pyx_n_s_main);
  Py_VISIT(traverse_module_state->__pyx_n_s_metaclass);
  Py_VISIT(traverse_module_state->__pyx_n_s_microsecond);
  Py_VISIT(traverse_module_state->__pyx_n_s_microseconds);
  Py_VISIT(traverse_module_state->__pyx_n_s_milliseconds);
  Py_VISIT(traverse_module_state->__pyx_n_u_min);
  Py_VISIT(traverse_module_state->__pyx_n_s_minute);
  Py_VISIT(traverse_module_state->__pyx_n_s_minutes);
  Py_VISIT(traverse_module_state->__pyx_n_s_module);
  Py_VISIT(traverse_module_state->__pyx_n_s_month);
  Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries);
  Py_VISIT(traverse_module_state->__pyx_n_u_ms);
  Py_VISIT(traverse_module_state->__pyx_n_s_my_unit);
  Py_VISIT(traverse_module_state->__pyx_n_s_name);
  Py_VISIT(traverse_module_state->__pyx_kp_u_nanosecond_conversion_range_dat);
  Py_VISIT(traverse_module_state->__pyx_kp_u_ndarray_size_must_be_an_integer);
  Py_VISIT(traverse_module_state->__pyx_n_s_now);
  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_offset);
  Py_VISIT(traverse_module_state->__pyx_kp_u_operation_on_ndarray_datetime64);
  Py_VISIT(traverse_module_state->__pyx_n_s_ord2ymd);
  Py_VISIT(traverse_module_state->__pyx_n_s_pandas);
  Py_VISIT(traverse_module_state->__pyx_n_s_prepare);
  Py_VISIT(traverse_module_state->__pyx_n_s_print);
  Py_VISIT(traverse_module_state->__pyx_n_u_ps);
  Py_VISIT(traverse_module_state->__pyx_n_s_pydatetime);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_capi);
  Py_VISIT(traverse_module_state->__pyx_n_s_qtr);
  Py_VISIT(traverse_module_state->__pyx_n_s_qualname);
  Py_VISIT(traverse_module_state->__pyx_n_s_range);
  Py_VISIT(traverse_module_state->__pyx_n_s_replace);
  Py_VISIT(traverse_module_state->__pyx_kp_u_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_resolution_Array_with_datetime);
  Py_VISIT(traverse_module_state->__pyx_kp_u_resolution_Array_with_dtype_of);
  Py_VISIT(traverse_module_state->__pyx_kp_u_resolution_Supported_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_resolution_is_not_supported);
  Py_VISIT(traverse_module_state->__pyx_n_s_return);
  Py_VISIT(traverse_module_state->__pyx_n_u_round);
  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_secs);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_spec);
  Py_VISIT(traverse_module_state->__pyx_kp_s_src_cytimes_utils_py);
  Py_VISIT(traverse_module_state->__pyx_n_s_str);
  Py_VISIT(traverse_module_state->__pyx_kp_u_strftime_format_is_too_long_s);
  Py_VISIT(traverse_module_state->__pyx_n_s_super);
  Py_VISIT(traverse_module_state->__pyx_kp_u_support_ndarray_with_1_4_dimensi);
  Py_VISIT(traverse_module_state->__pyx_n_s_t);
  Py_VISIT(traverse_module_state->__pyx_n_s_t1);
  Py_VISIT(traverse_module_state->__pyx_n_s_t_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_t_n);
  Py_VISIT(traverse_module_state->__pyx_n_s_t_tz1);
  Py_VISIT(traverse_module_state->__pyx_n_s_td);
  Py_VISIT(traverse_module_state->__pyx_n_s_td1);
  Py_VISIT(traverse_module_state->__pyx_n_s_td2);
  Py_VISIT(traverse_module_state->__pyx_n_s_td3);
  Py_VISIT(traverse_module_state->__pyx_n_s_td4);
  Py_VISIT(traverse_module_state->__pyx_n_s_td5);
  Py_VISIT(traverse_module_state->__pyx_n_s_td6);
  Py_VISIT(traverse_module_state->__pyx_n_s_td64);
  Py_VISIT(traverse_module_state->__pyx_n_s_td7);
  Py_VISIT(traverse_module_state->__pyx_n_s_td8);
  Py_VISIT(traverse_module_state->__pyx_n_s_test);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_date_conversion);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_date_conversion_locals_Cus);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_date_generate);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_date_type_check);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_date_type_check_locals_Cus);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_datetime64_conversion);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_datetime64_type_check);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_days_bf_month);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_days_bf_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_days_in_month);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_days_in_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_dt_arithmetic);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_dt_conversion);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_dt_generate);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_dt_mainipulate);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_dt_type_check);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_dt_type_check_locals_Custo);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_dt_tzinfo);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_is_leap_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_iso_1st_monday);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_isocalendar);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_localtime_n_gmtime);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_ndarray_dt64_conversion);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_ndarray_dt64_type_check);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_ndarray_td64_conversion);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_ndarray_td64_type_check);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_ndarray_type_check);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_numpy_share);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_parser);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_quarter_of_month);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_time_conversion);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_time_conversion_locals_Cus);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_time_generate);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_time_type_check);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_time_type_check_locals_Cus);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_time_tzinfo);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_timedelta64_conversion);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_timedelta64_type_check);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_timedelta_conversion);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_timedelta_conversion_local);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_timedelta_generate);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_timedelta_type_check);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_timedelta_type_check_local);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_tzinfo_access);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_tzinfo_generate);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_tzinfo_type_check);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_utils);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_weekday);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_ymd_fr_isocalendar);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_ymd_fr_ordinal);
  Py_VISIT(traverse_module_state->__pyx_n_s_test_ymd_to_ordinal);
  Py_VISIT(traverse_module_state->__pyx_n_s_time);
  Py_VISIT(traverse_module_state->__pyx_n_s_time1);
  Py_VISIT(traverse_module_state->__pyx_n_s_time2);
  Py_VISIT(traverse_module_state->__pyx_n_s_time_tz1);
  Py_VISIT(traverse_module_state->__pyx_n_s_time_tz2);
  Py_VISIT(traverse_module_state->__pyx_n_s_timedelta);
  Py_VISIT(traverse_module_state->__pyx_n_s_timedelta64);
  Py_VISIT(traverse_module_state->__pyx_n_u_timedelta64);
  Py_VISIT(traverse_module_state->__pyx_kp_u_timedelta64_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_timedelta64_ns);
  Py_VISIT(traverse_module_state->__pyx_kp_u_timedelta64_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_timedelta64_us);
  Py_VISIT(traverse_module_state->__pyx_n_s_timestamp);
  Py_VISIT(traverse_module_state->__pyx_n_s_timetuple);
  Py_VISIT(traverse_module_state->__pyx_n_s_timetz);
  Py_VISIT(traverse_module_state->__pyx_n_s_timezone);
  Py_VISIT(traverse_module_state->__pyx_kp_u_timezone_offset_s_seconds_out_of);
  Py_VISIT(traverse_module_state->__pyx_n_s_tm);
  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_tmp);
  Py_VISIT(traverse_module_state->__pyx_n_s_tmp1);
  Py_VISIT(traverse_module_state->__pyx_n_s_tmp2);
  Py_VISIT(traverse_module_state->__pyx_n_s_tmp3);
  Py_VISIT(traverse_module_state->__pyx_kp_u_to);
  Py_VISIT(traverse_module_state->__pyx_kp_u_to_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_to_an_integer_under);
  Py_VISIT(traverse_module_state->__pyx_kp_u_to_an_integer_under_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_to_datetime64);
  Py_VISIT(traverse_module_state->__pyx_kp_u_to_int64_under);
  Py_VISIT(traverse_module_state->__pyx_kp_u_to_int64_under_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_to_int64_under_3);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_unit);
  Py_VISIT(traverse_module_state->__pyx_n_s_today);
  Py_VISIT(traverse_module_state->__pyx_n_s_toordinal);
  Py_VISIT(traverse_module_state->__pyx_n_s_total_seconds);
  Py_VISIT(traverse_module_state->__pyx_n_s_ts);
  Py_VISIT(traverse_module_state->__pyx_n_s_typeref);
  Py_VISIT(traverse_module_state->__pyx_n_s_tz);
  Py_VISIT(traverse_module_state->__pyx_n_s_tz1);
  Py_VISIT(traverse_module_state->__pyx_n_s_tz2);
  Py_VISIT(traverse_module_state->__pyx_n_s_tz3);
  Py_VISIT(traverse_module_state->__pyx_n_s_tz4);
  Py_VISIT(traverse_module_state->__pyx_n_s_tz_str);
  Py_VISIT(traverse_module_state->__pyx_n_s_tzinfo);
  Py_VISIT(traverse_module_state->__pyx_n_s_tzname);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unable_to_parse_datetime_unit_fr);
  Py_VISIT(traverse_module_state->__pyx_n_s_unit);
  Py_VISIT(traverse_module_state->__pyx_n_s_units);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unknown_datetime_unit_d);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unknown_datetime_unit_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unsupported_datetime_unit_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unsupported_factor_d_for_timedel);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unsupported_factor_d_for_timedel_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_us);
  Py_VISIT(traverse_module_state->__pyx_n_u_us);
  Py_VISIT(traverse_module_state->__pyx_n_s_utc);
  Py_VISIT(traverse_module_state->__pyx_n_s_utcoffset);
  Py_VISIT(traverse_module_state->__pyx_n_s_utctimetuple);
  Py_VISIT(traverse_module_state->__pyx_n_s_val);
  Py_VISIT(traverse_module_state->__pyx_n_s_value);
  Py_VISIT(traverse_module_state->__pyx_n_s_week);
  Py_VISIT(traverse_module_state->__pyx_n_s_weekday);
  Py_VISIT(traverse_module_state->__pyx_kp_u_with_datetime_unit);
  Py_VISIT(traverse_module_state->__pyx_kp_u_without_specifying_the_array_da);
  Py_VISIT(traverse_module_state->__pyx_n_s_y);
  Py_VISIT(traverse_module_state->__pyx_n_s_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_ymd2ord);
  Py_VISIT(traverse_module_state->__pyx_n_s_zone);
  Py_VISIT(traverse_module_state->__pyx_n_s_zoneinfo);
  Py_VISIT(traverse_module_state->__pyx_int_0);
  Py_VISIT(traverse_module_state->__pyx_int_1);
  Py_VISIT(traverse_module_state->__pyx_int_2);
  Py_VISIT(traverse_module_state->__pyx_int_3);
  Py_VISIT(traverse_module_state->__pyx_int_4);
  Py_VISIT(traverse_module_state->__pyx_int_5);
  Py_VISIT(traverse_module_state->__pyx_int_6);
  Py_VISIT(traverse_module_state->__pyx_int_8);
  Py_VISIT(traverse_module_state->__pyx_int_23);
  Py_VISIT(traverse_module_state->__pyx_int_59);
  Py_VISIT(traverse_module_state->__pyx_int_60);
  Py_VISIT(traverse_module_state->__pyx_int_1000);
  Py_VISIT(traverse_module_state->__pyx_int_1970);
  Py_VISIT(traverse_module_state->__pyx_int_2021);
  Py_VISIT(traverse_module_state->__pyx_int_3600);
  Py_VISIT(traverse_module_state->__pyx_int_10000);
  Py_VISIT(traverse_module_state->__pyx_int_86399);
  Py_VISIT(traverse_module_state->__pyx_int_86400);
  Py_VISIT(traverse_module_state->__pyx_int_100000);
  Py_VISIT(traverse_module_state->__pyx_int_1000000);
  Py_VISIT(traverse_module_state->__pyx_int_86400000000);
  Py_VISIT(traverse_module_state->__pyx_int_neg_1);
  Py_VISIT(traverse_module_state->__pyx_int_neg_2);
  Py_VISIT(traverse_module_state->__pyx_int_neg_3);
  Py_VISIT(traverse_module_state->__pyx_int_neg_23);
  Py_VISIT(traverse_module_state->__pyx_int_neg_59);
  Py_VISIT(traverse_module_state->__pyx_int_neg_60);
  Py_VISIT(traverse_module_state->__pyx_int_neg_1000);
  Py_VISIT(traverse_module_state->__pyx_int_neg_86399);
  Py_VISIT(traverse_module_state->__pyx_int_neg_86400);
  Py_VISIT(traverse_module_state->__pyx_int_neg_100000);
  Py_VISIT(traverse_module_state->__pyx_tuple_);
  Py_VISIT(traverse_module_state->__pyx_tuple__2);
  Py_VISIT(traverse_module_state->__pyx_tuple__3);
  Py_VISIT(traverse_module_state->__pyx_tuple__4);
  Py_VISIT(traverse_module_state->__pyx_tuple__5);
  Py_VISIT(traverse_module_state->__pyx_tuple__6);
  Py_VISIT(traverse_module_state->__pyx_tuple__7);
  Py_VISIT(traverse_module_state->__pyx_tuple__8);
  Py_VISIT(traverse_module_state->__pyx_slice__99);
  Py_VISIT(traverse_module_state->__pyx_tuple__16);
  Py_VISIT(traverse_module_state->__pyx_tuple__17);
  Py_VISIT(traverse_module_state->__pyx_tuple__18);
  Py_VISIT(traverse_module_state->__pyx_tuple__20);
  Py_VISIT(traverse_module_state->__pyx_tuple__21);
  Py_VISIT(traverse_module_state->__pyx_tuple__22);
  Py_VISIT(traverse_module_state->__pyx_tuple__23);
  Py_VISIT(traverse_module_state->__pyx_tuple__24);
  Py_VISIT(traverse_module_state->__pyx_tuple__25);
  Py_VISIT(traverse_module_state->__pyx_tuple__26);
  Py_VISIT(traverse_module_state->__pyx_tuple__27);
  Py_VISIT(traverse_module_state->__pyx_tuple__28);
  Py_VISIT(traverse_module_state->__pyx_tuple__29);
  Py_VISIT(traverse_module_state->__pyx_tuple__30);
  Py_VISIT(traverse_module_state->__pyx_tuple__31);
  Py_VISIT(traverse_module_state->__pyx_tuple__32);
  Py_VISIT(traverse_module_state->__pyx_tuple__33);
  Py_VISIT(traverse_module_state->__pyx_tuple__34);
  Py_VISIT(traverse_module_state->__pyx_tuple__36);
  Py_VISIT(traverse_module_state->__pyx_tuple__39);
  Py_VISIT(traverse_module_state->__pyx_tuple__41);
  Py_VISIT(traverse_module_state->__pyx_tuple__42);
  Py_VISIT(traverse_module_state->__pyx_tuple__43);
  Py_VISIT(traverse_module_state->__pyx_tuple__44);
  Py_VISIT(traverse_module_state->__pyx_tuple__45);
  Py_VISIT(traverse_module_state->__pyx_tuple__46);
  Py_VISIT(traverse_module_state->__pyx_tuple__47);
  Py_VISIT(traverse_module_state->__pyx_tuple__48);
  Py_VISIT(traverse_module_state->__pyx_tuple__49);
  Py_VISIT(traverse_module_state->__pyx_tuple__50);
  Py_VISIT(traverse_module_state->__pyx_tuple__51);
  Py_VISIT(traverse_module_state->__pyx_tuple__52);
  Py_VISIT(traverse_module_state->__pyx_tuple__53);
  Py_VISIT(traverse_module_state->__pyx_tuple__54);
  Py_VISIT(traverse_module_state->__pyx_tuple__55);
  Py_VISIT(traverse_module_state->__pyx_tuple__56);
  Py_VISIT(traverse_module_state->__pyx_tuple__57);
  Py_VISIT(traverse_module_state->__pyx_tuple__58);
  Py_VISIT(traverse_module_state->__pyx_tuple__59);
  Py_VISIT(traverse_module_state->__pyx_tuple__60);
  Py_VISIT(traverse_module_state->__pyx_tuple__61);
  Py_VISIT(traverse_module_state->__pyx_tuple__62);
  Py_VISIT(traverse_module_state->__pyx_tuple__63);
  Py_VISIT(traverse_module_state->__pyx_tuple__64);
  Py_VISIT(traverse_module_state->__pyx_tuple__65);
  Py_VISIT(traverse_module_state->__pyx_tuple__66);
  Py_VISIT(traverse_module_state->__pyx_tuple__67);
  Py_VISIT(traverse_module_state->__pyx_tuple__68);
  Py_VISIT(traverse_module_state->__pyx_tuple__69);
  Py_VISIT(traverse_module_state->__pyx_tuple__70);
  Py_VISIT(traverse_module_state->__pyx_tuple__71);
  Py_VISIT(traverse_module_state->__pyx_tuple__72);
  Py_VISIT(traverse_module_state->__pyx_tuple__73);
  Py_VISIT(traverse_module_state->__pyx_tuple__74);
  Py_VISIT(traverse_module_state->__pyx_tuple__75);
  Py_VISIT(traverse_module_state->__pyx_tuple__76);
  Py_VISIT(traverse_module_state->__pyx_tuple__77);
  Py_VISIT(traverse_module_state->__pyx_tuple__78);
  Py_VISIT(traverse_module_state->__pyx_tuple__79);
  Py_VISIT(traverse_module_state->__pyx_tuple__80);
  Py_VISIT(traverse_module_state->__pyx_tuple__81);
  Py_VISIT(traverse_module_state->__pyx_tuple__82);
  Py_VISIT(traverse_module_state->__pyx_tuple__83);
  Py_VISIT(traverse_module_state->__pyx_tuple__84);
  Py_VISIT(traverse_module_state->__pyx_tuple__85);
  Py_VISIT(traverse_module_state->__pyx_tuple__86);
  Py_VISIT(traverse_module_state->__pyx_tuple__87);
  Py_VISIT(traverse_module_state->__pyx_tuple__88);
  Py_VISIT(traverse_module_state->__pyx_tuple__89);
  Py_VISIT(traverse_module_state->__pyx_tuple__90);
  Py_VISIT(traverse_module_state->__pyx_tuple__91);
  Py_VISIT(traverse_module_state->__pyx_tuple__92);
  Py_VISIT(traverse_module_state->__pyx_tuple__93);
  Py_VISIT(traverse_module_state->__pyx_tuple__94);
  Py_VISIT(traverse_module_state->__pyx_tuple__95);
  Py_VISIT(traverse_module_state->__pyx_tuple__96);
  Py_VISIT(traverse_module_state->__pyx_tuple__97);
  Py_VISIT(traverse_module_state->__pyx_tuple__98);
  Py_VISIT(traverse_module_state->__pyx_slice__100);
  Py_VISIT(traverse_module_state->__pyx_tuple__101);
  Py_VISIT(traverse_module_state->__pyx_tuple__102);
  Py_VISIT(traverse_module_state->__pyx_tuple__103);
  Py_VISIT(traverse_module_state->__pyx_tuple__104);
  Py_VISIT(traverse_module_state->__pyx_tuple__105);
  Py_VISIT(traverse_module_state->__pyx_tuple__106);
  Py_VISIT(traverse_module_state->__pyx_tuple__107);
  Py_VISIT(traverse_module_state->__pyx_tuple__108);
  Py_VISIT(traverse_module_state->__pyx_tuple__109);
  Py_VISIT(traverse_module_state->__pyx_tuple__110);
  Py_VISIT(traverse_module_state->__pyx_tuple__111);
  Py_VISIT(traverse_module_state->__pyx_tuple__112);
  Py_VISIT(traverse_module_state->__pyx_tuple__113);
  Py_VISIT(traverse_module_state->__pyx_tuple__114);
  Py_VISIT(traverse_module_state->__pyx_tuple__115);
  Py_VISIT(traverse_module_state->__pyx_tuple__116);
  Py_VISIT(traverse_module_state->__pyx_tuple__118);
  Py_VISIT(traverse_module_state->__pyx_tuple__119);
  Py_VISIT(traverse_module_state->__pyx_tuple__120);
  Py_VISIT(traverse_module_state->__pyx_tuple__122);
  Py_VISIT(traverse_module_state->__pyx_tuple__124);
  Py_VISIT(traverse_module_state->__pyx_tuple__126);
  Py_VISIT(traverse_module_state->__pyx_tuple__128);
  Py_VISIT(traverse_module_state->__pyx_tuple__130);
  Py_VISIT(traverse_module_state->__pyx_tuple__132);
  Py_VISIT(traverse_module_state->__pyx_tuple__134);
  Py_VISIT(traverse_module_state->__pyx_tuple__136);
  Py_VISIT(traverse_module_state->__pyx_tuple__138);
  Py_VISIT(traverse_module_state->__pyx_tuple__140);
  Py_VISIT(traverse_module_state->__pyx_tuple__142);
  Py_VISIT(traverse_module_state->__pyx_tuple__144);
  Py_VISIT(traverse_module_state->__pyx_tuple__146);
  Py_VISIT(traverse_module_state->__pyx_tuple__148);
  Py_VISIT(traverse_module_state->__pyx_tuple__150);
  Py_VISIT(traverse_module_state->__pyx_tuple__152);
  Py_VISIT(traverse_module_state->__pyx_tuple__154);
  Py_VISIT(traverse_module_state->__pyx_tuple__156);
  Py_VISIT(traverse_module_state->__pyx_tuple__158);
  Py_VISIT(traverse_module_state->__pyx_tuple__160);
  Py_VISIT(traverse_module_state->__pyx_tuple__162);
  Py_VISIT(traverse_module_state->__pyx_tuple__164);
  Py_VISIT(traverse_module_state->__pyx_tuple__166);
  Py_VISIT(traverse_module_state->__pyx_tuple__168);
  Py_VISIT(traverse_module_state->__pyx_tuple__170);
  Py_VISIT(traverse_module_state->__pyx_tuple__172);
  Py_VISIT(traverse_module_state->__pyx_tuple__174);
  Py_VISIT(traverse_module_state->__pyx_tuple__176);
  Py_VISIT(traverse_module_state->__pyx_tuple__178);
  Py_VISIT(traverse_module_state->__pyx_tuple__180);
  Py_VISIT(traverse_module_state->__pyx_tuple__182);
  Py_VISIT(traverse_module_state->__pyx_tuple__185);
  Py_VISIT(traverse_module_state->__pyx_tuple__187);
  Py_VISIT(traverse_module_state->__pyx_tuple__189);
  Py_VISIT(traverse_module_state->__pyx_tuple__191);
  Py_VISIT(traverse_module_state->__pyx_tuple__193);
  Py_VISIT(traverse_module_state->__pyx_tuple__195);
  Py_VISIT(traverse_module_state->__pyx_tuple__197);
  Py_VISIT(traverse_module_state->__pyx_tuple__200);
  Py_VISIT(traverse_module_state->__pyx_tuple__203);
  Py_VISIT(traverse_module_state->__pyx_codeobj__121);
  Py_VISIT(traverse_module_state->__pyx_codeobj__123);
  Py_VISIT(traverse_module_state->__pyx_codeobj__125);
  Py_VISIT(traverse_module_state->__pyx_codeobj__127);
  Py_VISIT(traverse_module_state->__pyx_codeobj__129);
  Py_VISIT(traverse_module_state->__pyx_codeobj__131);
  Py_VISIT(traverse_module_state->__pyx_codeobj__133);
  Py_VISIT(traverse_module_state->__pyx_codeobj__135);
  Py_VISIT(traverse_module_state->__pyx_codeobj__137);
  Py_VISIT(traverse_module_state->__pyx_codeobj__139);
  Py_VISIT(traverse_module_state->__pyx_codeobj__141);
  Py_VISIT(traverse_module_state->__pyx_codeobj__143);
  Py_VISIT(traverse_module_state->__pyx_codeobj__145);
  Py_VISIT(traverse_module_state->__pyx_codeobj__147);
  Py_VISIT(traverse_module_state->__pyx_codeobj__149);
  Py_VISIT(traverse_module_state->__pyx_codeobj__151);
  Py_VISIT(traverse_module_state->__pyx_codeobj__153);
  Py_VISIT(traverse_module_state->__pyx_codeobj__155);
  Py_VISIT(traverse_module_state->__pyx_codeobj__157);
  Py_VISIT(traverse_module_state->__pyx_codeobj__159);
  Py_VISIT(traverse_module_state->__pyx_codeobj__161);
  Py_VISIT(traverse_module_state->__pyx_codeobj__163);
  Py_VISIT(traverse_module_state->__pyx_codeobj__165);
  Py_VISIT(traverse_module_state->__pyx_codeobj__167);
  Py_VISIT(traverse_module_state->__pyx_codeobj__169);
  Py_VISIT(traverse_module_state->__pyx_codeobj__171);
  Py_VISIT(traverse_module_state->__pyx_codeobj__173);
  Py_VISIT(traverse_module_state->__pyx_codeobj__175);
  Py_VISIT(traverse_module_state->__pyx_codeobj__177);
  Py_VISIT(traverse_module_state->__pyx_codeobj__179);
  Py_VISIT(traverse_module_state->__pyx_codeobj__181);
  Py_VISIT(traverse_module_state->__pyx_codeobj__183);
  Py_VISIT(traverse_module_state->__pyx_codeobj__184);
  Py_VISIT(traverse_module_state->__pyx_codeobj__186);
  Py_VISIT(traverse_module_state->__pyx_codeobj__188);
  Py_VISIT(traverse_module_state->__pyx_codeobj__190);
  Py_VISIT(traverse_module_state->__pyx_codeobj__192);
  Py_VISIT(traverse_module_state->__pyx_codeobj__194);
  Py_VISIT(traverse_module_state->__pyx_codeobj__196);
  Py_VISIT(traverse_module_state->__pyx_codeobj__198);
  Py_VISIT(traverse_module_state->__pyx_codeobj__199);
  Py_VISIT(traverse_module_state->__pyx_codeobj__201);
  Py_VISIT(traverse_module_state->__pyx_codeobj__202);
  Py_VISIT(traverse_module_state->__pyx_codeobj__204);
  return 0;
}
#endif
/* #### Code section: module_state_defines ### */
#define __pyx_d __pyx_mstate_global->__pyx_d
#define __pyx_b __pyx_mstate_global->__pyx_b
#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
#ifdef __Pyx_CyFunction_USED
#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
#endif
#ifdef __Pyx_FusedFunction_USED
#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
#endif
#ifdef __Pyx_Generator_USED
#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
#endif
#ifdef __Pyx_IterableCoroutine_USED
#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
#endif
#ifdef __Pyx_Coroutine_USED
#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
#endif
#ifdef __Pyx_Coroutine_USED
#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_7cpython_4bool_bool __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_7cpython_7complex_complex __pyx_mstate_global->__pyx_ptype_7cpython_7complex_complex
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_5numpy_dtype __pyx_mstate_global->__pyx_ptype_5numpy_dtype
#define __pyx_ptype_5numpy_flatiter __pyx_mstate_global->__pyx_ptype_5numpy_flatiter
#define __pyx_ptype_5numpy_broadcast __pyx_mstate_global->__pyx_ptype_5numpy_broadcast
#define __pyx_ptype_5numpy_ndarray __pyx_mstate_global->__pyx_ptype_5numpy_ndarray
#define __pyx_ptype_5numpy_generic __pyx_mstate_global->__pyx_ptype_5numpy_generic
#define __pyx_ptype_5numpy_number __pyx_mstate_global->__pyx_ptype_5numpy_number
#define __pyx_ptype_5numpy_integer __pyx_mstate_global->__pyx_ptype_5numpy_integer
#define __pyx_ptype_5numpy_signedinteger __pyx_mstate_global->__pyx_ptype_5numpy_signedinteger
#define __pyx_ptype_5numpy_unsignedinteger __pyx_mstate_global->__pyx_ptype_5numpy_unsignedinteger
#define __pyx_ptype_5numpy_inexact __pyx_mstate_global->__pyx_ptype_5numpy_inexact
#define __pyx_ptype_5numpy_floating __pyx_mstate_global->__pyx_ptype_5numpy_floating
#define __pyx_ptype_5numpy_complexfloating __pyx_mstate_global->__pyx_ptype_5numpy_complexfloating
#define __pyx_ptype_5numpy_flexible __pyx_mstate_global->__pyx_ptype_5numpy_flexible
#define __pyx_ptype_5numpy_character __pyx_mstate_global->__pyx_ptype_5numpy_character
#define __pyx_ptype_5numpy_ufunc __pyx_mstate_global->__pyx_ptype_5numpy_ufunc
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#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
#define __pyx_kp_u_00 __pyx_mstate_global->__pyx_kp_u_00
#define __pyx_kp_u_00_00 __pyx_mstate_global->__pyx_kp_u_00_00
#define __pyx_kp_u_00_00_00_06d __pyx_mstate_global->__pyx_kp_u_00_00_00_06d
#define __pyx_kp_u_00_00_01 __pyx_mstate_global->__pyx_kp_u_00_00_01
#define __pyx_kp_u_00_00_01_2 __pyx_mstate_global->__pyx_kp_u_00_00_01_2
#define __pyx_kp_u_00_00_02d __pyx_mstate_global->__pyx_kp_u_00_00_02d
#define __pyx_kp_u_00_01_01 __pyx_mstate_global->__pyx_kp_u_00_01_01
#define __pyx_kp_u_00_01_01_2 __pyx_mstate_global->__pyx_kp_u_00_01_01_2
#define __pyx_kp_u_0101 __pyx_mstate_global->__pyx_kp_u_0101
#define __pyx_kp_u_0101_2 __pyx_mstate_global->__pyx_kp_u_0101_2
#define __pyx_kp_u_01_02_2021 __pyx_mstate_global->__pyx_kp_u_01_02_2021
#define __pyx_kp_u_01_02_2021_000006_05_04_03 __pyx_mstate_global->__pyx_kp_u_01_02_2021_000006_05_04_03
#define __pyx_kp_u_01_02_2021_000006_05_04_03UTC_01 __pyx_mstate_global->__pyx_kp_u_01_02_2021_000006_05_04_03UTC_01
#define __pyx_kp_u_01_02_2021_000006_05_04_03_0101 __pyx_mstate_global->__pyx_kp_u_01_02_2021_000006_05_04_03_0101
#define __pyx_kp_u_02d __pyx_mstate_global->__pyx_kp_u_02d
#define __pyx_kp_u_03_04_05 __pyx_mstate_global->__pyx_kp_u_03_04_05
#define __pyx_kp_u_03_04_05_000006 __pyx_mstate_global->__pyx_kp_u_03_04_05_000006
#define __pyx_kp_u_03_04_05_000006_0101 __pyx_mstate_global->__pyx_kp_u_03_04_05_000006_0101
#define __pyx_kp_u_03_04_05_0101 __pyx_mstate_global->__pyx_kp_u_03_04_05_0101
#define __pyx_kp_u_04d __pyx_mstate_global->__pyx_kp_u_04d
#define __pyx_kp_u_06d __pyx_mstate_global->__pyx_kp_u_06d
#define __pyx_kp_u_06d_2 __pyx_mstate_global->__pyx_kp_u_06d_2
#define __pyx_kp_u_2021_000 __pyx_mstate_global->__pyx_kp_u_2021_000
#define __pyx_kp_u_2021_01_02 __pyx_mstate_global->__pyx_kp_u_2021_01_02
#define __pyx_kp_u_2021_01_02T03_04_05 __pyx_mstate_global->__pyx_kp_u_2021_01_02T03_04_05
#define __pyx_kp_u_2021_01_02T03_04_05_000006 __pyx_mstate_global->__pyx_kp_u_2021_01_02T03_04_05_000006
#define __pyx_kp_u_2021_01_02T03_04_05_006007 __pyx_mstate_global->__pyx_kp_u_2021_01_02T03_04_05_006007
#define __pyx_kp_u_2021_01_02_03_04_05_000006_0101 __pyx_mstate_global->__pyx_kp_u_2021_01_02_03_04_05_000006_0101
#define __pyx_kp_u_2021_01_02_03_04_05_0101 __pyx_mstate_global->__pyx_kp_u_2021_01_02_03_04_05_0101
#define __pyx_kp_u_2021_365 __pyx_mstate_global->__pyx_kp_u_2021_365
#define __pyx_kp_u_2021_367 __pyx_mstate_global->__pyx_kp_u_2021_367
#define __pyx_kp_u_2021_W52_6 __pyx_mstate_global->__pyx_kp_u_2021_W52_6
#define __pyx_kp_u_2359 __pyx_mstate_global->__pyx_kp_u_2359
#define __pyx_kp_u_2359_2 __pyx_mstate_global->__pyx_kp_u_2359_2
#define __pyx_kp_u_24_01_01 __pyx_mstate_global->__pyx_kp_u_24_01_01
#define __pyx_kp_u_24_01_01_000001 __pyx_mstate_global->__pyx_kp_u_24_01_01_000001
#define __pyx_kp_u_24_01_01_000001_2 __pyx_mstate_global->__pyx_kp_u_24_01_01_000001_2
#define __pyx_kp_u_24_01_01_001000 __pyx_mstate_global->__pyx_kp_u_24_01_01_001000
#define __pyx_kp_u_24_01_01_001000_2 __pyx_mstate_global->__pyx_kp_u_24_01_01_001000_2
#define __pyx_kp_u_24_01_01_001001 __pyx_mstate_global->__pyx_kp_u_24_01_01_001001
#define __pyx_kp_u_24_01_01_001001_2 __pyx_mstate_global->__pyx_kp_u_24_01_01_001001_2
#define __pyx_kp_u_24_01_01_2 __pyx_mstate_global->__pyx_kp_u_24_01_01_2
#define __pyx_kp_u_2d __pyx_mstate_global->__pyx_kp_u_2d
#define __pyx_n_u_Apr __pyx_mstate_global->__pyx_n_u_Apr
#define __pyx_kp_u_Array_with_dtype_of_datetime64 __pyx_mstate_global->__pyx_kp_u_Array_with_dtype_of_datetime64
#define __pyx_kp_u_Asia_Shanghai __pyx_mstate_global->__pyx_kp_u_Asia_Shanghai
#define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError
#define __pyx_n_u_Aug __pyx_mstate_global->__pyx_n_u_Aug
#define __pyx_n_u_CET __pyx_mstate_global->__pyx_n_u_CET
#define __pyx_n_u_CST __pyx_mstate_global->__pyx_n_u_CST
#define __pyx_kp_u_Conversion_limits_to_datetime_u __pyx_mstate_global->__pyx_kp_u_Conversion_limits_to_datetime_u
#define __pyx_n_s_CustomDate __pyx_mstate_global->__pyx_n_s_CustomDate
#define __pyx_n_s_CustomDateTime __pyx_mstate_global->__pyx_n_s_CustomDateTime
#define __pyx_n_s_CustomTD __pyx_mstate_global->__pyx_n_s_CustomTD
#define __pyx_n_s_CustomTime __pyx_mstate_global->__pyx_n_s_CustomTime
#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_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_DT64_NS_DD_MAX __pyx_mstate_global->__pyx_n_s_DT64_NS_DD_MAX
#define __pyx_n_s_DT64_NS_DD_MIN __pyx_mstate_global->__pyx_n_s_DT64_NS_DD_MIN
#define __pyx_n_s_DT64_NS_HH_MAX __pyx_mstate_global->__pyx_n_s_DT64_NS_HH_MAX
#define __pyx_n_s_DT64_NS_HH_MIN __pyx_mstate_global->__pyx_n_s_DT64_NS_HH_MIN
#define __pyx_n_s_DT64_NS_MI_MAX __pyx_mstate_global->__pyx_n_s_DT64_NS_MI_MAX
#define __pyx_n_s_DT64_NS_MI_MIN __pyx_mstate_global->__pyx_n_s_DT64_NS_MI_MIN
#define __pyx_n_s_DT64_NS_MM_MAX __pyx_mstate_global->__pyx_n_s_DT64_NS_MM_MAX
#define __pyx_n_s_DT64_NS_MM_MIN __pyx_mstate_global->__pyx_n_s_DT64_NS_MM_MIN
#define __pyx_n_s_DT64_NS_MS_MAX __pyx_mstate_global->__pyx_n_s_DT64_NS_MS_MAX
#define __pyx_n_s_DT64_NS_MS_MIN __pyx_mstate_global->__pyx_n_s_DT64_NS_MS_MIN
#define __pyx_n_s_DT64_NS_NS_MAX __pyx_mstate_global->__pyx_n_s_DT64_NS_NS_MAX
#define __pyx_n_s_DT64_NS_NS_MIN __pyx_mstate_global->__pyx_n_s_DT64_NS_NS_MIN
#define __pyx_n_s_DT64_NS_SS_MAX __pyx_mstate_global->__pyx_n_s_DT64_NS_SS_MAX
#define __pyx_n_s_DT64_NS_SS_MIN __pyx_mstate_global->__pyx_n_s_DT64_NS_SS_MIN
#define __pyx_n_s_DT64_NS_US_MAX __pyx_mstate_global->__pyx_n_s_DT64_NS_US_MAX
#define __pyx_n_s_DT64_NS_US_MIN __pyx_mstate_global->__pyx_n_s_DT64_NS_US_MIN
#define __pyx_n_s_DT64_NS_WW_MAX __pyx_mstate_global->__pyx_n_s_DT64_NS_WW_MAX
#define __pyx_n_s_DT64_NS_WW_MIN __pyx_mstate_global->__pyx_n_s_DT64_NS_WW_MIN
#define __pyx_n_s_DT64_NS_YY_MAX __pyx_mstate_global->__pyx_n_s_DT64_NS_YY_MAX
#define __pyx_n_s_DT64_NS_YY_MIN __pyx_mstate_global->__pyx_n_s_DT64_NS_YY_MIN
#define __pyx_n_u_Dec __pyx_mstate_global->__pyx_n_u_Dec
#define __pyx_n_s_EPOCH_DAY __pyx_mstate_global->__pyx_n_s_EPOCH_DAY
#define __pyx_n_s_EPOCH_DT __pyx_mstate_global->__pyx_n_s_EPOCH_DT
#define __pyx_n_s_EPOCH_HOUR __pyx_mstate_global->__pyx_n_s_EPOCH_HOUR
#define __pyx_n_s_EPOCH_MICROSECOND __pyx_mstate_global->__pyx_n_s_EPOCH_MICROSECOND
#define __pyx_n_s_EPOCH_MILLISECOND __pyx_mstate_global->__pyx_n_s_EPOCH_MILLISECOND
#define __pyx_n_s_EPOCH_MINUTE __pyx_mstate_global->__pyx_n_s_EPOCH_MINUTE
#define __pyx_n_s_EPOCH_MONTH __pyx_mstate_global->__pyx_n_s_EPOCH_MONTH
#define __pyx_n_s_EPOCH_SECOND __pyx_mstate_global->__pyx_n_s_EPOCH_SECOND
#define __pyx_n_s_EPOCH_YEAR __pyx_mstate_global->__pyx_n_s_EPOCH_YEAR
#define __pyx_kp_u_Failed_datetime64_type_check __pyx_mstate_global->__pyx_kp_u_Failed_datetime64_type_check
#define __pyx_kp_u_Failed_timedelta64_type_check __pyx_mstate_global->__pyx_kp_u_Failed_timedelta64_type_check
#define __pyx_n_u_False __pyx_mstate_global->__pyx_n_u_False
#define __pyx_n_u_Feb __pyx_mstate_global->__pyx_n_u_Feb
#define __pyx_kp_u_For_comparision_array_size_must __pyx_mstate_global->__pyx_kp_u_For_comparision_array_size_must
#define __pyx_n_u_Fri __pyx_mstate_global->__pyx_n_u_Fri
#define __pyx_n_u_GMT __pyx_mstate_global->__pyx_n_u_GMT
#define __pyx_n_u_GMT0 __pyx_mstate_global->__pyx_n_u_GMT0
#define __pyx_kp_u_GMT_0 __pyx_mstate_global->__pyx_kp_u_GMT_0
#define __pyx_kp_u_GMT_0_2 __pyx_mstate_global->__pyx_kp_u_GMT_0_2
#define __pyx_n_u_Greenwich __pyx_mstate_global->__pyx_n_u_Greenwich
#define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError
#define __pyx_n_s_InvalidTimezoneError __pyx_mstate_global->__pyx_n_s_InvalidTimezoneError
#define __pyx_n_u_Jan __pyx_mstate_global->__pyx_n_u_Jan
#define __pyx_n_u_Jul __pyx_mstate_global->__pyx_n_u_Jul
#define __pyx_n_u_Jun __pyx_mstate_global->__pyx_n_u_Jun
#define __pyx_n_s_LOCALTZ __pyx_mstate_global->__pyx_n_s_LOCALTZ
#define __pyx_n_s_LOCAL_TZ __pyx_mstate_global->__pyx_n_s_LOCAL_TZ
#define __pyx_n_u_M __pyx_mstate_global->__pyx_n_u_M
#define __pyx_n_s_MAXORDINAL __pyx_mstate_global->__pyx_n_s_MAXORDINAL
#define __pyx_n_s_MS_DAY __pyx_mstate_global->__pyx_n_s_MS_DAY
#define __pyx_n_s_MS_HOUR __pyx_mstate_global->__pyx_n_s_MS_HOUR
#define __pyx_n_s_MS_MINUTE __pyx_mstate_global->__pyx_n_s_MS_MINUTE
#define __pyx_n_s_MS_SECOND __pyx_mstate_global->__pyx_n_s_MS_SECOND
#define __pyx_n_u_Mar __pyx_mstate_global->__pyx_n_u_Mar
#define __pyx_n_u_May __pyx_mstate_global->__pyx_n_u_May
#define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError
#define __pyx_n_u_Mon __pyx_mstate_global->__pyx_n_u_Mon
#define __pyx_n_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_MICROSECOND __pyx_mstate_global->__pyx_n_s_NS_MICROSECOND
#define __pyx_n_s_NS_MILLISECOND __pyx_mstate_global->__pyx_n_s_NS_MILLISECOND
#define __pyx_n_s_NS_MINUTE __pyx_mstate_global->__pyx_n_s_NS_MINUTE
#define __pyx_n_s_NS_SECOND __pyx_mstate_global->__pyx_n_s_NS_SECOND
#define __pyx_n_s_None __pyx_mstate_global->__pyx_n_s_None
#define __pyx_kp_u_None __pyx_mstate_global->__pyx_kp_u_None
#define __pyx_n_u_Nov __pyx_mstate_global->__pyx_n_u_Nov
#define __pyx_n_s_ORDINAL_MAX __pyx_mstate_global->__pyx_n_s_ORDINAL_MAX
#define __pyx_n_u_Oct __pyx_mstate_global->__pyx_n_u_Oct
#define __pyx_n_s_OverflowError __pyx_mstate_global->__pyx_n_s_OverflowError
#define __pyx_kp_u_Passed_date_arithmetic __pyx_mstate_global->__pyx_kp_u_Passed_date_arithmetic
#define __pyx_kp_u_Passed_date_conversion __pyx_mstate_global->__pyx_kp_u_Passed_date_conversion
#define __pyx_kp_u_Passed_date_generate __pyx_mstate_global->__pyx_kp_u_Passed_date_generate
#define __pyx_kp_u_Passed_date_type_check __pyx_mstate_global->__pyx_kp_u_Passed_date_type_check
#define __pyx_kp_u_Passed_datetime64_conversion __pyx_mstate_global->__pyx_kp_u_Passed_datetime64_conversion
#define __pyx_kp_u_Passed_datetime64_type_check __pyx_mstate_global->__pyx_kp_u_Passed_datetime64_type_check
#define __pyx_kp_u_Passed_days_bf_month __pyx_mstate_global->__pyx_kp_u_Passed_days_bf_month
#define __pyx_kp_u_Passed_days_bf_year __pyx_mstate_global->__pyx_kp_u_Passed_days_bf_year
#define __pyx_kp_u_Passed_days_in_month __pyx_mstate_global->__pyx_kp_u_Passed_days_in_month
#define __pyx_kp_u_Passed_days_in_quarter __pyx_mstate_global->__pyx_kp_u_Passed_days_in_quarter
#define __pyx_kp_u_Passed_dt_conversion __pyx_mstate_global->__pyx_kp_u_Passed_dt_conversion
#define __pyx_kp_u_Passed_dt_generate __pyx_mstate_global->__pyx_kp_u_Passed_dt_generate
#define __pyx_kp_u_Passed_dt_manipulate __pyx_mstate_global->__pyx_kp_u_Passed_dt_manipulate
#define __pyx_kp_u_Passed_dt_type_check __pyx_mstate_global->__pyx_kp_u_Passed_dt_type_check
#define __pyx_kp_u_Passed_dt_tzinfo __pyx_mstate_global->__pyx_kp_u_Passed_dt_tzinfo
#define __pyx_kp_u_Passed_is_leap_year __pyx_mstate_global->__pyx_kp_u_Passed_is_leap_year
#define __pyx_kp_u_Passed_iso_1st_monday __pyx_mstate_global->__pyx_kp_u_Passed_iso_1st_monday
#define __pyx_kp_u_Passed_isocalendar __pyx_mstate_global->__pyx_kp_u_Passed_isocalendar
#define __pyx_kp_u_Passed_localtime_gmtime __pyx_mstate_global->__pyx_kp_u_Passed_localtime_gmtime
#define __pyx_kp_u_Passed_ndarray_dt64_conversion __pyx_mstate_global->__pyx_kp_u_Passed_ndarray_dt64_conversion
#define __pyx_kp_u_Passed_ndarray_dt64_type_check __pyx_mstate_global->__pyx_kp_u_Passed_ndarray_dt64_type_check
#define __pyx_kp_u_Passed_ndarray_td64_conversion __pyx_mstate_global->__pyx_kp_u_Passed_ndarray_td64_conversion
#define __pyx_kp_u_Passed_ndarray_td64_type_check __pyx_mstate_global->__pyx_kp_u_Passed_ndarray_td64_type_check
#define __pyx_kp_u_Passed_ndarray_type_check __pyx_mstate_global->__pyx_kp_u_Passed_ndarray_type_check
#define __pyx_kp_u_Passed_numpy_share __pyx_mstate_global->__pyx_kp_u_Passed_numpy_share
#define __pyx_kp_u_Passed_parser __pyx_mstate_global->__pyx_kp_u_Passed_parser
#define __pyx_kp_u_Passed_quarter_of_month __pyx_mstate_global->__pyx_kp_u_Passed_quarter_of_month
#define __pyx_kp_u_Passed_time_conversion __pyx_mstate_global->__pyx_kp_u_Passed_time_conversion
#define __pyx_kp_u_Passed_time_generate __pyx_mstate_global->__pyx_kp_u_Passed_time_generate
#define __pyx_kp_u_Passed_time_type_check __pyx_mstate_global->__pyx_kp_u_Passed_time_type_check
#define __pyx_kp_u_Passed_time_tzinfo __pyx_mstate_global->__pyx_kp_u_Passed_time_tzinfo
#define __pyx_kp_u_Passed_timedelta64_conversion __pyx_mstate_global->__pyx_kp_u_Passed_timedelta64_conversion
#define __pyx_kp_u_Passed_timedelta64_type_check __pyx_mstate_global->__pyx_kp_u_Passed_timedelta64_type_check
#define __pyx_kp_u_Passed_timedelta_conversion __pyx_mstate_global->__pyx_kp_u_Passed_timedelta_conversion
#define __pyx_kp_u_Passed_timedelta_generate __pyx_mstate_global->__pyx_kp_u_Passed_timedelta_generate
#define __pyx_kp_u_Passed_timedelta_type_chech __pyx_mstate_global->__pyx_kp_u_Passed_timedelta_type_chech
#define __pyx_kp_u_Passed_tzinfo_access __pyx_mstate_global->__pyx_kp_u_Passed_tzinfo_access
#define __pyx_kp_u_Passed_tzinfo_generate __pyx_mstate_global->__pyx_kp_u_Passed_tzinfo_generate
#define __pyx_kp_u_Passed_tzinfo_type_check __pyx_mstate_global->__pyx_kp_u_Passed_tzinfo_type_check
#define __pyx_kp_u_Passed_weekday __pyx_mstate_global->__pyx_kp_u_Passed_weekday
#define __pyx_kp_u_Passed_ymd_fr_isocalendar __pyx_mstate_global->__pyx_kp_u_Passed_ymd_fr_isocalendar
#define __pyx_kp_u_Passed_ymd_fr_ordinal __pyx_mstate_global->__pyx_kp_u_Passed_ymd_fr_ordinal
#define __pyx_kp_u_Passed_ymd_to_ordinal __pyx_mstate_global->__pyx_kp_u_Passed_ymd_to_ordinal
#define __pyx_n_s_RuntimeError __pyx_mstate_global->__pyx_n_s_RuntimeError
#define __pyx_n_s_SS_DAY __pyx_mstate_global->__pyx_n_s_SS_DAY
#define __pyx_n_s_SS_HOUR __pyx_mstate_global->__pyx_n_s_SS_HOUR
#define __pyx_n_s_SS_MINUTE __pyx_mstate_global->__pyx_n_s_SS_MINUTE
#define __pyx_n_u_Sat __pyx_mstate_global->__pyx_n_u_Sat
#define __pyx_n_u_Sep __pyx_mstate_global->__pyx_n_u_Sep
#define __pyx_n_u_Sun __pyx_mstate_global->__pyx_n_u_Sun
#define __pyx_n_u_T __pyx_mstate_global->__pyx_n_u_T
#define __pyx_n_s_TD64_MM_DAY __pyx_mstate_global->__pyx_n_s_TD64_MM_DAY
#define __pyx_n_s_TD64_MM_MICROSECOND __pyx_mstate_global->__pyx_n_s_TD64_MM_MICROSECOND
#define __pyx_n_s_TD64_MM_MILLISECOND __pyx_mstate_global->__pyx_n_s_TD64_MM_MILLISECOND
#define __pyx_n_s_TD64_MM_NANOSECOND __pyx_mstate_global->__pyx_n_s_TD64_MM_NANOSECOND
#define __pyx_n_s_TD64_MM_SECOND __pyx_mstate_global->__pyx_n_s_TD64_MM_SECOND
#define __pyx_n_s_TD64_YY_DAY __pyx_mstate_global->__pyx_n_s_TD64_YY_DAY
#define __pyx_n_s_TD64_YY_MICROSECOND __pyx_mstate_global->__pyx_n_s_TD64_YY_MICROSECOND
#define __pyx_n_s_TD64_YY_MILLISECOND __pyx_mstate_global->__pyx_n_s_TD64_YY_MILLISECOND
#define __pyx_n_s_TD64_YY_NANOSECOND __pyx_mstate_global->__pyx_n_s_TD64_YY_NANOSECOND
#define __pyx_n_s_TD64_YY_SECOND __pyx_mstate_global->__pyx_n_s_TD64_YY_SECOND
#define __pyx_n_s_TIMEZONE_MAP __pyx_mstate_global->__pyx_n_s_TIMEZONE_MAP
#define __pyx_n_u_Thu __pyx_mstate_global->__pyx_n_u_Thu
#define __pyx_kp_u_Time_zones_are_not_available_fro __pyx_mstate_global->__pyx_kp_u_Time_zones_are_not_available_fro
#define __pyx_n_s_Timestamp __pyx_mstate_global->__pyx_n_s_Timestamp
#define __pyx_n_u_True __pyx_mstate_global->__pyx_n_u_True
#define __pyx_n_u_Tue __pyx_mstate_global->__pyx_n_u_Tue
#define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
#define __pyx_n_s_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_US_MILLISECOND __pyx_mstate_global->__pyx_n_s_US_MILLISECOND
#define __pyx_n_s_US_MINUTE __pyx_mstate_global->__pyx_n_s_US_MINUTE
#define __pyx_n_s_US_SECOND __pyx_mstate_global->__pyx_n_s_US_SECOND
#define __pyx_n_s_UTC __pyx_mstate_global->__pyx_n_s_UTC
#define __pyx_n_u_UTC __pyx_mstate_global->__pyx_n_u_UTC
#define __pyx_n_u_Universal __pyx_mstate_global->__pyx_n_u_Universal
#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
#define __pyx_n_u_W __pyx_mstate_global->__pyx_n_u_W
#define __pyx_n_u_Wed __pyx_mstate_global->__pyx_n_u_Wed
#define __pyx_n_u_Y __pyx_mstate_global->__pyx_n_u_Y
#define __pyx_n_s_ZeroDivisionError __pyx_mstate_global->__pyx_n_s_ZeroDivisionError
#define __pyx_n_s_ZoneInfo __pyx_mstate_global->__pyx_n_s_ZoneInfo
#define __pyx_n_u_Zulu __pyx_mstate_global->__pyx_n_u_Zulu
#define __pyx_kp_u__10 __pyx_mstate_global->__pyx_kp_u__10
#define __pyx_kp_u__11 __pyx_mstate_global->__pyx_kp_u__11
#define __pyx_kp_u__117 __pyx_mstate_global->__pyx_kp_u__117
#define __pyx_kp_u__12 __pyx_mstate_global->__pyx_kp_u__12
#define __pyx_kp_u__13 __pyx_mstate_global->__pyx_kp_u__13
#define __pyx_kp_u__14 __pyx_mstate_global->__pyx_kp_u__14
#define __pyx_kp_u__15 __pyx_mstate_global->__pyx_kp_u__15
#define __pyx_kp_u__19 __pyx_mstate_global->__pyx_kp_u__19
#define __pyx_n_s__205 __pyx_mstate_global->__pyx_n_s__205
#define __pyx_kp_u__35 __pyx_mstate_global->__pyx_kp_u__35
#define __pyx_n_s__37 __pyx_mstate_global->__pyx_n_s__37
#define __pyx_kp_u__38 __pyx_mstate_global->__pyx_kp_u__38
#define __pyx_kp_u__40 __pyx_mstate_global->__pyx_kp_u__40
#define __pyx_kp_u__9 __pyx_mstate_global->__pyx_kp_u__9
#define __pyx_n_u_a __pyx_mstate_global->__pyx_n_u_a
#define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all
#define __pyx_n_s_arr __pyx_mstate_global->__pyx_n_s_arr
#define __pyx_n_s_arr_i __pyx_mstate_global->__pyx_n_s_arr_i
#define __pyx_n_s_array __pyx_mstate_global->__pyx_n_s_array
#define __pyx_kp_u_array_size_must_be_greater_than __pyx_mstate_global->__pyx_kp_u_array_size_must_be_greater_than
#define __pyx_n_u_as __pyx_mstate_global->__pyx_n_u_as
#define __pyx_n_s_astype __pyx_mstate_global->__pyx_n_s_astype
#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
#define __pyx_n_s_available_timezones __pyx_mstate_global->__pyx_n_s_available_timezones
#define __pyx_n_s_babel_dates __pyx_mstate_global->__pyx_n_s_babel_dates
#define __pyx_kp_u_cannot_access_the_time_value_fro __pyx_mstate_global->__pyx_kp_u_cannot_access_the_time_value_fro
#define __pyx_kp_u_cannot_cast __pyx_mstate_global->__pyx_kp_u_cannot_cast
#define __pyx_kp_u_cannot_cast_ndarray __pyx_mstate_global->__pyx_kp_u_cannot_cast_ndarray
#define __pyx_kp_u_cannot_cast_ndarray_2 __pyx_mstate_global->__pyx_kp_u_cannot_cast_ndarray_2
#define __pyx_kp_u_cannot_ceil_to_multiple_0 __pyx_mstate_global->__pyx_kp_u_cannot_ceil_to_multiple_0
#define __pyx_kp_u_cannot_check_if_ndarray_s_is_wit __pyx_mstate_global->__pyx_kp_u_cannot_check_if_ndarray_s_is_wit
#define __pyx_kp_u_cannot_check_ndarray __pyx_mstate_global->__pyx_kp_u_cannot_check_ndarray
#define __pyx_kp_u_cannot_compare_ndarrays_with_dif __pyx_mstate_global->__pyx_kp_u_cannot_compare_ndarrays_with_dif
#define __pyx_kp_u_cannot_convert_ndarray __pyx_mstate_global->__pyx_kp_u_cannot_convert_ndarray
#define __pyx_kp_u_cannot_convert_ndarray_from_date __pyx_mstate_global->__pyx_kp_u_cannot_convert_ndarray_from_date
#define __pyx_kp_u_cannot_floor_to_multiple_0 __pyx_mstate_global->__pyx_kp_u_cannot_floor_to_multiple_0
#define __pyx_kp_u_cannot_perform_addition_on_ndarr __pyx_mstate_global->__pyx_kp_u_cannot_perform_addition_on_ndarr
#define __pyx_kp_u_cannot_perform_comparison_on_nda __pyx_mstate_global->__pyx_kp_u_cannot_perform_comparison_on_nda
#define __pyx_kp_u_cannot_perform_subtraction_on_nd __pyx_mstate_global->__pyx_kp_u_cannot_perform_subtraction_on_nd
#define __pyx_kp_u_cannot_round_to_multiple_0 __pyx_mstate_global->__pyx_kp_u_cannot_round_to_multiple_0
#define __pyx_n_u_ceil __pyx_mstate_global->__pyx_n_u_ceil
#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_cmp __pyx_mstate_global->__pyx_n_s_cmp
#define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count
#define __pyx_n_s_cytimes __pyx_mstate_global->__pyx_n_s_cytimes
#define __pyx_n_s_cytimes_utils __pyx_mstate_global->__pyx_n_s_cytimes_utils
#define __pyx_n_s_d __pyx_mstate_global->__pyx_n_s_d
#define __pyx_n_u_d __pyx_mstate_global->__pyx_n_u_d
#define __pyx_n_s_date __pyx_mstate_global->__pyx_n_s_date
#define __pyx_n_s_datetime __pyx_mstate_global->__pyx_n_s_datetime
#define __pyx_n_s_datetime64 __pyx_mstate_global->__pyx_n_s_datetime64
#define __pyx_n_u_datetime64 __pyx_mstate_global->__pyx_n_u_datetime64
#define __pyx_kp_u_datetime64_2 __pyx_mstate_global->__pyx_kp_u_datetime64_2
#define __pyx_kp_u_datetime64_D __pyx_mstate_global->__pyx_kp_u_datetime64_D
#define __pyx_kp_u_datetime64_M __pyx_mstate_global->__pyx_kp_u_datetime64_M
#define __pyx_kp_u_datetime64_W __pyx_mstate_global->__pyx_kp_u_datetime64_W
#define __pyx_kp_u_datetime64_Y __pyx_mstate_global->__pyx_kp_u_datetime64_Y
#define __pyx_kp_u_datetime64_h __pyx_mstate_global->__pyx_kp_u_datetime64_h
#define __pyx_kp_u_datetime64_m __pyx_mstate_global->__pyx_kp_u_datetime64_m
#define __pyx_kp_u_datetime64_ms __pyx_mstate_global->__pyx_kp_u_datetime64_ms
#define __pyx_kp_u_datetime64_ns __pyx_mstate_global->__pyx_kp_u_datetime64_ns
#define __pyx_kp_u_datetime64_s __pyx_mstate_global->__pyx_kp_u_datetime64_s
#define __pyx_kp_u_datetime64_s_2 __pyx_mstate_global->__pyx_kp_u_datetime64_s_2
#define __pyx_kp_u_datetime64_us __pyx_mstate_global->__pyx_kp_u_datetime64_us
#define __pyx_kp_u_datetime_s_is_ambiguous __pyx_mstate_global->__pyx_kp_u_datetime_s_is_ambiguous
#define __pyx_n_s_day __pyx_mstate_global->__pyx_n_s_day
#define __pyx_n_s_days_before_month __pyx_mstate_global->__pyx_n_s_days_before_month
#define __pyx_n_s_days_before_year __pyx_mstate_global->__pyx_n_s_days_before_year
#define __pyx_n_s_days_in_month __pyx_mstate_global->__pyx_n_s_days_in_month
#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
#define __pyx_kp_u_division_by_zero_for_utils_arr_c __pyx_mstate_global->__pyx_kp_u_division_by_zero_for_utils_arr_c
#define __pyx_kp_u_division_by_zero_for_utils_arr_f __pyx_mstate_global->__pyx_kp_u_division_by_zero_for_utils_arr_f
#define __pyx_kp_u_division_by_zero_for_utils_arr_r __pyx_mstate_global->__pyx_kp_u_division_by_zero_for_utils_arr_r
#define __pyx_kp_u_division_by_zero_for_utils_math __pyx_mstate_global->__pyx_kp_u_division_by_zero_for_utils_math
#define __pyx_kp_u_division_by_zero_for_utils_math_2 __pyx_mstate_global->__pyx_kp_u_division_by_zero_for_utils_math_2
#define __pyx_kp_u_division_by_zero_for_utils_math_3 __pyx_mstate_global->__pyx_kp_u_division_by_zero_for_utils_math_3
#define __pyx_kp_u_division_by_zero_for_utils_math_4 __pyx_mstate_global->__pyx_kp_u_division_by_zero_for_utils_math_4
#define __pyx_kp_u_division_by_zero_in_arr_mod __pyx_mstate_global->__pyx_kp_u_division_by_zero_in_arr_mod
#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc
#define __pyx_n_s_dst __pyx_mstate_global->__pyx_n_s_dst
#define __pyx_n_s_dt __pyx_mstate_global->__pyx_n_s_dt
#define __pyx_n_s_dt2 __pyx_mstate_global->__pyx_n_s_dt2
#define __pyx_n_s_dt64 __pyx_mstate_global->__pyx_n_s_dt64
#define __pyx_n_s_dt_2 __pyx_mstate_global->__pyx_n_s_dt_2
#define __pyx_n_s_dt_c __pyx_mstate_global->__pyx_n_s_dt_c
#define __pyx_n_s_dt_n __pyx_mstate_global->__pyx_n_s_dt_n
#define __pyx_n_s_dt_str __pyx_mstate_global->__pyx_n_s_dt_str
#define __pyx_n_s_dt_tz1 __pyx_mstate_global->__pyx_n_s_dt_tz1
#define __pyx_n_s_dt_tz2 __pyx_mstate_global->__pyx_n_s_dt_tz2
#define __pyx_n_s_dt_tz3 __pyx_mstate_global->__pyx_n_s_dt_tz3
#define __pyx_n_s_dt_tz4 __pyx_mstate_global->__pyx_n_s_dt_tz4
#define __pyx_n_s_dtype __pyx_mstate_global->__pyx_n_s_dtype
#define __pyx_n_s_equal __pyx_mstate_global->__pyx_n_s_equal
#define __pyx_n_s_errors __pyx_mstate_global->__pyx_n_s_errors
#define __pyx_kp_u_expects_datetime_tzinfo_got_s __pyx_mstate_global->__pyx_kp_u_expects_datetime_tzinfo_got_s
#define __pyx_kp_u_expects_np_datetime64_got_s __pyx_mstate_global->__pyx_kp_u_expects_np_datetime64_got_s
#define __pyx_kp_u_expects_np_ndarray_datetime64_go __pyx_mstate_global->__pyx_kp_u_expects_np_ndarray_datetime64_go
#define __pyx_kp_u_expects_np_ndarray_datetime64_ti __pyx_mstate_global->__pyx_kp_u_expects_np_ndarray_datetime64_ti
#define __pyx_kp_u_expects_np_ndarray_datetime64_ti_2 __pyx_mstate_global->__pyx_kp_u_expects_np_ndarray_datetime64_ti_2
#define __pyx_kp_u_expects_np_ndarray_timedelta64_g __pyx_mstate_global->__pyx_kp_u_expects_np_ndarray_timedelta64_g
#define __pyx_kp_u_expects_np_timedelta64_got_s __pyx_mstate_global->__pyx_kp_u_expects_np_timedelta64_got_s
#define __pyx_kp_u_failed_to_allocate_memory_for_st __pyx_mstate_global->__pyx_kp_u_failed_to_allocate_memory_for_st
#define __pyx_n_u_floor __pyx_mstate_global->__pyx_n_u_floor
#define __pyx_n_s_fold __pyx_mstate_global->__pyx_n_s_fold
#define __pyx_n_s_fromtimestamp __pyx_mstate_global->__pyx_n_s_fromtimestamp
#define __pyx_n_s_fromutc __pyx_mstate_global->__pyx_n_s_fromutc
#define __pyx_n_u_fs __pyx_mstate_global->__pyx_n_u_fs
#define __pyx_n_s_gmtime __pyx_mstate_global->__pyx_n_s_gmtime
#define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h
#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_hours __pyx_mstate_global->__pyx_n_s_hours
#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i
#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass
#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
#define __pyx_n_u_int64 __pyx_mstate_global->__pyx_n_u_int64
#define __pyx_kp_u_int64_under_D_resolution __pyx_mstate_global->__pyx_kp_u_int64_under_D_resolution
#define __pyx_kp_u_int64_under_M_resolution __pyx_mstate_global->__pyx_kp_u_int64_under_M_resolution
#define __pyx_kp_u_int64_under_Y_resolution __pyx_mstate_global->__pyx_kp_u_int64_under_Y_resolution
#define __pyx_kp_u_int64_under_h_resolution __pyx_mstate_global->__pyx_kp_u_int64_under_h_resolution
#define __pyx_kp_u_int64_under_m_resolution __pyx_mstate_global->__pyx_kp_u_int64_under_m_resolution
#define __pyx_kp_u_int64_under_ms_resolution __pyx_mstate_global->__pyx_kp_u_int64_under_ms_resolution
#define __pyx_kp_u_int64_under_ns_resolution __pyx_mstate_global->__pyx_kp_u_int64_under_ns_resolution
#define __pyx_kp_u_int64_under_s_resolution __pyx_mstate_global->__pyx_kp_u_int64_under_s_resolution
#define __pyx_kp_u_int64_under_us_resolution __pyx_mstate_global->__pyx_kp_u_int64_under_us_resolution
#define __pyx_kp_u_invalid_character_s_as_an_intege __pyx_mstate_global->__pyx_kp_u_invalid_character_s_as_an_intege
#define __pyx_kp_u_invalid_timezone __pyx_mstate_global->__pyx_kp_u_invalid_timezone
#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
#define __pyx_n_s_is_leap __pyx_mstate_global->__pyx_n_s_is_leap
#define __pyx_kp_u_is_not_supported __pyx_mstate_global->__pyx_kp_u_is_not_supported
#define __pyx_kp_u_is_not_supported_2 __pyx_mstate_global->__pyx_kp_u_is_not_supported_2
#define __pyx_kp_u_is_not_supported_3 __pyx_mstate_global->__pyx_kp_u_is_not_supported_3
#define __pyx_n_s_iso_calr __pyx_mstate_global->__pyx_n_s_iso_calr
#define __pyx_n_s_iso_week __pyx_mstate_global->__pyx_n_s_iso_week
#define __pyx_n_s_iso_year __pyx_mstate_global->__pyx_n_s_iso_year
#define __pyx_n_s_isocalendar __pyx_mstate_global->__pyx_n_s_isocalendar
#define __pyx_n_s_isoweek1monday __pyx_mstate_global->__pyx_n_s_isoweek1monday
#define __pyx_n_s_isoweek_to_gregorian __pyx_mstate_global->__pyx_n_s_isoweek_to_gregorian
#define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key
#define __pyx_n_u_local __pyx_mstate_global->__pyx_n_u_local
#define __pyx_n_u_localize __pyx_mstate_global->__pyx_n_u_localize
#define __pyx_n_s_localtime __pyx_mstate_global->__pyx_n_s_localtime
#define __pyx_n_s_m __pyx_mstate_global->__pyx_n_s_m
#define __pyx_n_u_m __pyx_mstate_global->__pyx_n_u_m
#define __pyx_kp_u_m_d_Y __pyx_mstate_global->__pyx_kp_u_m_d_Y
#define __pyx_kp_u_m_d_Y_f_S_M_H __pyx_mstate_global->__pyx_kp_u_m_d_Y_f_S_M_H
#define __pyx_kp_u_m_d_Y_f_S_M_H_Z __pyx_mstate_global->__pyx_kp_u_m_d_Y_f_S_M_H_Z
#define __pyx_kp_u_m_d_Y_f_S_M_H_z __pyx_mstate_global->__pyx_kp_u_m_d_Y_f_S_M_H_z
#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass
#define __pyx_n_s_microsecond __pyx_mstate_global->__pyx_n_s_microsecond
#define __pyx_n_s_microseconds __pyx_mstate_global->__pyx_n_s_microseconds
#define __pyx_n_s_milliseconds __pyx_mstate_global->__pyx_n_s_milliseconds
#define __pyx_n_u_min __pyx_mstate_global->__pyx_n_u_min
#define __pyx_n_s_minute __pyx_mstate_global->__pyx_n_s_minute
#define __pyx_n_s_minutes __pyx_mstate_global->__pyx_n_s_minutes
#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module
#define __pyx_n_s_month __pyx_mstate_global->__pyx_n_s_month
#define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries
#define __pyx_n_u_ms __pyx_mstate_global->__pyx_n_u_ms
#define __pyx_n_s_my_unit __pyx_mstate_global->__pyx_n_s_my_unit
#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
#define __pyx_kp_u_nanosecond_conversion_range_dat __pyx_mstate_global->__pyx_kp_u_nanosecond_conversion_range_dat
#define __pyx_kp_u_ndarray_size_must_be_an_integer __pyx_mstate_global->__pyx_kp_u_ndarray_size_must_be_an_integer
#define __pyx_n_s_now __pyx_mstate_global->__pyx_n_s_now
#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_offset __pyx_mstate_global->__pyx_n_s_offset
#define __pyx_kp_u_operation_on_ndarray_datetime64 __pyx_mstate_global->__pyx_kp_u_operation_on_ndarray_datetime64
#define __pyx_n_s_ord2ymd __pyx_mstate_global->__pyx_n_s_ord2ymd
#define __pyx_n_s_pandas __pyx_mstate_global->__pyx_n_s_pandas
#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare
#define __pyx_n_s_print __pyx_mstate_global->__pyx_n_s_print
#define __pyx_n_u_ps __pyx_mstate_global->__pyx_n_u_ps
#define __pyx_n_s_pydatetime __pyx_mstate_global->__pyx_n_s_pydatetime
#define __pyx_n_s_pyx_capi __pyx_mstate_global->__pyx_n_s_pyx_capi
#define __pyx_n_s_qtr __pyx_mstate_global->__pyx_n_s_qtr
#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname
#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
#define __pyx_n_s_replace __pyx_mstate_global->__pyx_n_s_replace
#define __pyx_kp_u_resolution __pyx_mstate_global->__pyx_kp_u_resolution
#define __pyx_kp_u_resolution_Array_with_datetime __pyx_mstate_global->__pyx_kp_u_resolution_Array_with_datetime
#define __pyx_kp_u_resolution_Array_with_dtype_of __pyx_mstate_global->__pyx_kp_u_resolution_Array_with_dtype_of
#define __pyx_kp_u_resolution_Supported_resolution __pyx_mstate_global->__pyx_kp_u_resolution_Supported_resolution
#define __pyx_kp_u_resolution_is_not_supported __pyx_mstate_global->__pyx_kp_u_resolution_is_not_supported
#define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return
#define __pyx_n_u_round __pyx_mstate_global->__pyx_n_u_round
#define __pyx_n_u_s __pyx_mstate_global->__pyx_n_u_s
#define __pyx_n_s_second __pyx_mstate_global->__pyx_n_s_second
#define __pyx_n_s_secs __pyx_mstate_global->__pyx_n_s_secs
#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name
#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
#define __pyx_kp_s_src_cytimes_utils_py __pyx_mstate_global->__pyx_kp_s_src_cytimes_utils_py
#define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str
#define __pyx_kp_u_strftime_format_is_too_long_s __pyx_mstate_global->__pyx_kp_u_strftime_format_is_too_long_s
#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super
#define __pyx_kp_u_support_ndarray_with_1_4_dimensi __pyx_mstate_global->__pyx_kp_u_support_ndarray_with_1_4_dimensi
#define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t
#define __pyx_n_s_t1 __pyx_mstate_global->__pyx_n_s_t1
#define __pyx_n_s_t_c __pyx_mstate_global->__pyx_n_s_t_c
#define __pyx_n_s_t_n __pyx_mstate_global->__pyx_n_s_t_n
#define __pyx_n_s_t_tz1 __pyx_mstate_global->__pyx_n_s_t_tz1
#define __pyx_n_s_td __pyx_mstate_global->__pyx_n_s_td
#define __pyx_n_s_td1 __pyx_mstate_global->__pyx_n_s_td1
#define __pyx_n_s_td2 __pyx_mstate_global->__pyx_n_s_td2
#define __pyx_n_s_td3 __pyx_mstate_global->__pyx_n_s_td3
#define __pyx_n_s_td4 __pyx_mstate_global->__pyx_n_s_td4
#define __pyx_n_s_td5 __pyx_mstate_global->__pyx_n_s_td5
#define __pyx_n_s_td6 __pyx_mstate_global->__pyx_n_s_td6
#define __pyx_n_s_td64 __pyx_mstate_global->__pyx_n_s_td64
#define __pyx_n_s_td7 __pyx_mstate_global->__pyx_n_s_td7
#define __pyx_n_s_td8 __pyx_mstate_global->__pyx_n_s_td8
#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
#define __pyx_n_s_test_date_conversion __pyx_mstate_global->__pyx_n_s_test_date_conversion
#define __pyx_n_s_test_date_conversion_locals_Cus __pyx_mstate_global->__pyx_n_s_test_date_conversion_locals_Cus
#define __pyx_n_s_test_date_generate __pyx_mstate_global->__pyx_n_s_test_date_generate
#define __pyx_n_s_test_date_type_check __pyx_mstate_global->__pyx_n_s_test_date_type_check
#define __pyx_n_s_test_date_type_check_locals_Cus __pyx_mstate_global->__pyx_n_s_test_date_type_check_locals_Cus
#define __pyx_n_s_test_datetime64_conversion __pyx_mstate_global->__pyx_n_s_test_datetime64_conversion
#define __pyx_n_s_test_datetime64_type_check __pyx_mstate_global->__pyx_n_s_test_datetime64_type_check
#define __pyx_n_s_test_days_bf_month __pyx_mstate_global->__pyx_n_s_test_days_bf_month
#define __pyx_n_s_test_days_bf_year __pyx_mstate_global->__pyx_n_s_test_days_bf_year
#define __pyx_n_s_test_days_in_month __pyx_mstate_global->__pyx_n_s_test_days_in_month
#define __pyx_n_s_test_days_in_quarter __pyx_mstate_global->__pyx_n_s_test_days_in_quarter
#define __pyx_n_s_test_dt_arithmetic __pyx_mstate_global->__pyx_n_s_test_dt_arithmetic
#define __pyx_n_s_test_dt_conversion __pyx_mstate_global->__pyx_n_s_test_dt_conversion
#define __pyx_n_s_test_dt_generate __pyx_mstate_global->__pyx_n_s_test_dt_generate
#define __pyx_n_s_test_dt_mainipulate __pyx_mstate_global->__pyx_n_s_test_dt_mainipulate
#define __pyx_n_s_test_dt_type_check __pyx_mstate_global->__pyx_n_s_test_dt_type_check
#define __pyx_n_s_test_dt_type_check_locals_Custo __pyx_mstate_global->__pyx_n_s_test_dt_type_check_locals_Custo
#define __pyx_n_s_test_dt_tzinfo __pyx_mstate_global->__pyx_n_s_test_dt_tzinfo
#define __pyx_n_s_test_is_leap_year __pyx_mstate_global->__pyx_n_s_test_is_leap_year
#define __pyx_n_s_test_iso_1st_monday __pyx_mstate_global->__pyx_n_s_test_iso_1st_monday
#define __pyx_n_s_test_isocalendar __pyx_mstate_global->__pyx_n_s_test_isocalendar
#define __pyx_n_s_test_localtime_n_gmtime __pyx_mstate_global->__pyx_n_s_test_localtime_n_gmtime
#define __pyx_n_s_test_ndarray_dt64_conversion __pyx_mstate_global->__pyx_n_s_test_ndarray_dt64_conversion
#define __pyx_n_s_test_ndarray_dt64_type_check __pyx_mstate_global->__pyx_n_s_test_ndarray_dt64_type_check
#define __pyx_n_s_test_ndarray_td64_conversion __pyx_mstate_global->__pyx_n_s_test_ndarray_td64_conversion
#define __pyx_n_s_test_ndarray_td64_type_check __pyx_mstate_global->__pyx_n_s_test_ndarray_td64_type_check
#define __pyx_n_s_test_ndarray_type_check __pyx_mstate_global->__pyx_n_s_test_ndarray_type_check
#define __pyx_n_s_test_numpy_share __pyx_mstate_global->__pyx_n_s_test_numpy_share
#define __pyx_n_s_test_parser __pyx_mstate_global->__pyx_n_s_test_parser
#define __pyx_n_s_test_quarter_of_month __pyx_mstate_global->__pyx_n_s_test_quarter_of_month
#define __pyx_n_s_test_time_conversion __pyx_mstate_global->__pyx_n_s_test_time_conversion
#define __pyx_n_s_test_time_conversion_locals_Cus __pyx_mstate_global->__pyx_n_s_test_time_conversion_locals_Cus
#define __pyx_n_s_test_time_generate __pyx_mstate_global->__pyx_n_s_test_time_generate
#define __pyx_n_s_test_time_type_check __pyx_mstate_global->__pyx_n_s_test_time_type_check
#define __pyx_n_s_test_time_type_check_locals_Cus __pyx_mstate_global->__pyx_n_s_test_time_type_check_locals_Cus
#define __pyx_n_s_test_time_tzinfo __pyx_mstate_global->__pyx_n_s_test_time_tzinfo
#define __pyx_n_s_test_timedelta64_conversion __pyx_mstate_global->__pyx_n_s_test_timedelta64_conversion
#define __pyx_n_s_test_timedelta64_type_check __pyx_mstate_global->__pyx_n_s_test_timedelta64_type_check
#define __pyx_n_s_test_timedelta_conversion __pyx_mstate_global->__pyx_n_s_test_timedelta_conversion
#define __pyx_n_s_test_timedelta_conversion_local __pyx_mstate_global->__pyx_n_s_test_timedelta_conversion_local
#define __pyx_n_s_test_timedelta_generate __pyx_mstate_global->__pyx_n_s_test_timedelta_generate
#define __pyx_n_s_test_timedelta_type_check __pyx_mstate_global->__pyx_n_s_test_timedelta_type_check
#define __pyx_n_s_test_timedelta_type_check_local __pyx_mstate_global->__pyx_n_s_test_timedelta_type_check_local
#define __pyx_n_s_test_tzinfo_access __pyx_mstate_global->__pyx_n_s_test_tzinfo_access
#define __pyx_n_s_test_tzinfo_generate __pyx_mstate_global->__pyx_n_s_test_tzinfo_generate
#define __pyx_n_s_test_tzinfo_type_check __pyx_mstate_global->__pyx_n_s_test_tzinfo_type_check
#define __pyx_n_s_test_utils __pyx_mstate_global->__pyx_n_s_test_utils
#define __pyx_n_s_test_weekday __pyx_mstate_global->__pyx_n_s_test_weekday
#define __pyx_n_s_test_ymd_fr_isocalendar __pyx_mstate_global->__pyx_n_s_test_ymd_fr_isocalendar
#define __pyx_n_s_test_ymd_fr_ordinal __pyx_mstate_global->__pyx_n_s_test_ymd_fr_ordinal
#define __pyx_n_s_test_ymd_to_ordinal __pyx_mstate_global->__pyx_n_s_test_ymd_to_ordinal
#define __pyx_n_s_time __pyx_mstate_global->__pyx_n_s_time
#define __pyx_n_s_time1 __pyx_mstate_global->__pyx_n_s_time1
#define __pyx_n_s_time2 __pyx_mstate_global->__pyx_n_s_time2
#define __pyx_n_s_time_tz1 __pyx_mstate_global->__pyx_n_s_time_tz1
#define __pyx_n_s_time_tz2 __pyx_mstate_global->__pyx_n_s_time_tz2
#define __pyx_n_s_timedelta __pyx_mstate_global->__pyx_n_s_timedelta
#define __pyx_n_s_timedelta64 __pyx_mstate_global->__pyx_n_s_timedelta64
#define __pyx_n_u_timedelta64 __pyx_mstate_global->__pyx_n_u_timedelta64
#define __pyx_kp_u_timedelta64_2 __pyx_mstate_global->__pyx_kp_u_timedelta64_2
#define __pyx_kp_u_timedelta64_ns __pyx_mstate_global->__pyx_kp_u_timedelta64_ns
#define __pyx_kp_u_timedelta64_s __pyx_mstate_global->__pyx_kp_u_timedelta64_s
#define __pyx_kp_u_timedelta64_us __pyx_mstate_global->__pyx_kp_u_timedelta64_us
#define __pyx_n_s_timestamp __pyx_mstate_global->__pyx_n_s_timestamp
#define __pyx_n_s_timetuple __pyx_mstate_global->__pyx_n_s_timetuple
#define __pyx_n_s_timetz __pyx_mstate_global->__pyx_n_s_timetz
#define __pyx_n_s_timezone __pyx_mstate_global->__pyx_n_s_timezone
#define __pyx_kp_u_timezone_offset_s_seconds_out_of __pyx_mstate_global->__pyx_kp_u_timezone_offset_s_seconds_out_of
#define __pyx_n_s_tm __pyx_mstate_global->__pyx_n_s_tm
#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_tmp __pyx_mstate_global->__pyx_n_s_tmp
#define __pyx_n_s_tmp1 __pyx_mstate_global->__pyx_n_s_tmp1
#define __pyx_n_s_tmp2 __pyx_mstate_global->__pyx_n_s_tmp2
#define __pyx_n_s_tmp3 __pyx_mstate_global->__pyx_n_s_tmp3
#define __pyx_kp_u_to __pyx_mstate_global->__pyx_kp_u_to
#define __pyx_kp_u_to_2 __pyx_mstate_global->__pyx_kp_u_to_2
#define __pyx_kp_u_to_an_integer_under __pyx_mstate_global->__pyx_kp_u_to_an_integer_under
#define __pyx_kp_u_to_an_integer_under_2 __pyx_mstate_global->__pyx_kp_u_to_an_integer_under_2
#define __pyx_kp_u_to_datetime64 __pyx_mstate_global->__pyx_kp_u_to_datetime64
#define __pyx_kp_u_to_int64_under __pyx_mstate_global->__pyx_kp_u_to_int64_under
#define __pyx_kp_u_to_int64_under_2 __pyx_mstate_global->__pyx_kp_u_to_int64_under_2
#define __pyx_kp_u_to_int64_under_3 __pyx_mstate_global->__pyx_kp_u_to_int64_under_3
#define __pyx_n_s_to_unit __pyx_mstate_global->__pyx_n_s_to_unit
#define __pyx_n_s_today __pyx_mstate_global->__pyx_n_s_today
#define __pyx_n_s_toordinal __pyx_mstate_global->__pyx_n_s_toordinal
#define __pyx_n_s_total_seconds __pyx_mstate_global->__pyx_n_s_total_seconds
#define __pyx_n_s_ts __pyx_mstate_global->__pyx_n_s_ts
#define __pyx_n_s_typeref __pyx_mstate_global->__pyx_n_s_typeref
#define __pyx_n_s_tz __pyx_mstate_global->__pyx_n_s_tz
#define __pyx_n_s_tz1 __pyx_mstate_global->__pyx_n_s_tz1
#define __pyx_n_s_tz2 __pyx_mstate_global->__pyx_n_s_tz2
#define __pyx_n_s_tz3 __pyx_mstate_global->__pyx_n_s_tz3
#define __pyx_n_s_tz4 __pyx_mstate_global->__pyx_n_s_tz4
#define __pyx_n_s_tz_str __pyx_mstate_global->__pyx_n_s_tz_str
#define __pyx_n_s_tzinfo __pyx_mstate_global->__pyx_n_s_tzinfo
#define __pyx_n_s_tzname __pyx_mstate_global->__pyx_n_s_tzname
#define __pyx_kp_u_unable_to_parse_datetime_unit_fr __pyx_mstate_global->__pyx_kp_u_unable_to_parse_datetime_unit_fr
#define __pyx_n_s_unit __pyx_mstate_global->__pyx_n_s_unit
#define __pyx_n_s_units __pyx_mstate_global->__pyx_n_s_units
#define __pyx_kp_u_unknown_datetime_unit_d __pyx_mstate_global->__pyx_kp_u_unknown_datetime_unit_d
#define __pyx_kp_u_unknown_datetime_unit_s __pyx_mstate_global->__pyx_kp_u_unknown_datetime_unit_s
#define __pyx_kp_u_unsupported_datetime_unit_s __pyx_mstate_global->__pyx_kp_u_unsupported_datetime_unit_s
#define __pyx_kp_u_unsupported_factor_d_for_timedel __pyx_mstate_global->__pyx_kp_u_unsupported_factor_d_for_timedel
#define __pyx_kp_u_unsupported_factor_d_for_timedel_2 __pyx_mstate_global->__pyx_kp_u_unsupported_factor_d_for_timedel_2
#define __pyx_n_s_us __pyx_mstate_global->__pyx_n_s_us
#define __pyx_n_u_us __pyx_mstate_global->__pyx_n_u_us
#define __pyx_n_s_utc __pyx_mstate_global->__pyx_n_s_utc
#define __pyx_n_s_utcoffset __pyx_mstate_global->__pyx_n_s_utcoffset
#define __pyx_n_s_utctimetuple __pyx_mstate_global->__pyx_n_s_utctimetuple
#define __pyx_n_s_val __pyx_mstate_global->__pyx_n_s_val
#define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value
#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_kp_u_with_datetime_unit __pyx_mstate_global->__pyx_kp_u_with_datetime_unit
#define __pyx_kp_u_without_specifying_the_array_da __pyx_mstate_global->__pyx_kp_u_without_specifying_the_array_da
#define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y
#define __pyx_n_s_year __pyx_mstate_global->__pyx_n_s_year
#define __pyx_n_s_ymd2ord __pyx_mstate_global->__pyx_n_s_ymd2ord
#define __pyx_n_s_zone __pyx_mstate_global->__pyx_n_s_zone
#define __pyx_n_s_zoneinfo __pyx_mstate_global->__pyx_n_s_zoneinfo
#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
#define __pyx_int_2 __pyx_mstate_global->__pyx_int_2
#define __pyx_int_3 __pyx_mstate_global->__pyx_int_3
#define __pyx_int_4 __pyx_mstate_global->__pyx_int_4
#define __pyx_int_5 __pyx_mstate_global->__pyx_int_5
#define __pyx_int_6 __pyx_mstate_global->__pyx_int_6
#define __pyx_int_8 __pyx_mstate_global->__pyx_int_8
#define __pyx_int_23 __pyx_mstate_global->__pyx_int_23
#define __pyx_int_59 __pyx_mstate_global->__pyx_int_59
#define __pyx_int_60 __pyx_mstate_global->__pyx_int_60
#define __pyx_int_1000 __pyx_mstate_global->__pyx_int_1000
#define __pyx_int_1970 __pyx_mstate_global->__pyx_int_1970
#define __pyx_int_2021 __pyx_mstate_global->__pyx_int_2021
#define __pyx_int_3600 __pyx_mstate_global->__pyx_int_3600
#define __pyx_int_10000 __pyx_mstate_global->__pyx_int_10000
#define __pyx_int_86399 __pyx_mstate_global->__pyx_int_86399
#define __pyx_int_86400 __pyx_mstate_global->__pyx_int_86400
#define __pyx_int_100000 __pyx_mstate_global->__pyx_int_100000
#define __pyx_int_1000000 __pyx_mstate_global->__pyx_int_1000000
#define __pyx_int_86400000000 __pyx_mstate_global->__pyx_int_86400000000
#define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1
#define __pyx_int_neg_2 __pyx_mstate_global->__pyx_int_neg_2
#define __pyx_int_neg_3 __pyx_mstate_global->__pyx_int_neg_3
#define __pyx_int_neg_23 __pyx_mstate_global->__pyx_int_neg_23
#define __pyx_int_neg_59 __pyx_mstate_global->__pyx_int_neg_59
#define __pyx_int_neg_60 __pyx_mstate_global->__pyx_int_neg_60
#define __pyx_int_neg_1000 __pyx_mstate_global->__pyx_int_neg_1000
#define __pyx_int_neg_86399 __pyx_mstate_global->__pyx_int_neg_86399
#define __pyx_int_neg_86400 __pyx_mstate_global->__pyx_int_neg_86400
#define __pyx_int_neg_100000 __pyx_mstate_global->__pyx_int_neg_100000
#define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_
#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2
#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3
#define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4
#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5
#define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6
#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7
#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8
#define __pyx_slice__99 __pyx_mstate_global->__pyx_slice__99
#define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16
#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17
#define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18
#define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20
#define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21
#define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22
#define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23
#define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24
#define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25
#define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26
#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27
#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28
#define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29
#define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30
#define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31
#define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32
#define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33
#define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34
#define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36
#define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39
#define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41
#define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42
#define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43
#define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44
#define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45
#define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46
#define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47
#define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48
#define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49
#define __pyx_tuple__50 __pyx_mstate_global->__pyx_tuple__50
#define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51
#define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52
#define __pyx_tuple__53 __pyx_mstate_global->__pyx_tuple__53
#define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54
#define __pyx_tuple__55 __pyx_mstate_global->__pyx_tuple__55
#define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56
#define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57
#define __pyx_tuple__58 __pyx_mstate_global->__pyx_tuple__58
#define __pyx_tuple__59 __pyx_mstate_global->__pyx_tuple__59
#define __pyx_tuple__60 __pyx_mstate_global->__pyx_tuple__60
#define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61
#define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62
#define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63
#define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64
#define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65
#define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66
#define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67
#define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68
#define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69
#define __pyx_tuple__70 __pyx_mstate_global->__pyx_tuple__70
#define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71
#define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72
#define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73
#define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74
#define __pyx_tuple__75 __pyx_mstate_global->__pyx_tuple__75
#define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76
#define __pyx_tuple__77 __pyx_mstate_global->__pyx_tuple__77
#define __pyx_tuple__78 __pyx_mstate_global->__pyx_tuple__78
#define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79
#define __pyx_tuple__80 __pyx_mstate_global->__pyx_tuple__80
#define __pyx_tuple__81 __pyx_mstate_global->__pyx_tuple__81
#define __pyx_tuple__82 __pyx_mstate_global->__pyx_tuple__82
#define __pyx_tuple__83 __pyx_mstate_global->__pyx_tuple__83
#define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84
#define __pyx_tuple__85 __pyx_mstate_global->__pyx_tuple__85
#define __pyx_tuple__86 __pyx_mstate_global->__pyx_tuple__86
#define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87
#define __pyx_tuple__88 __pyx_mstate_global->__pyx_tuple__88
#define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89
#define __pyx_tuple__90 __pyx_mstate_global->__pyx_tuple__90
#define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91
#define __pyx_tuple__92 __pyx_mstate_global->__pyx_tuple__92
#define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93
#define __pyx_tuple__94 __pyx_mstate_global->__pyx_tuple__94
#define __pyx_tuple__95 __pyx_mstate_global->__pyx_tuple__95
#define __pyx_tuple__96 __pyx_mstate_global->__pyx_tuple__96
#define __pyx_tuple__97 __pyx_mstate_global->__pyx_tuple__97
#define __pyx_tuple__98 __pyx_mstate_global->__pyx_tuple__98
#define __pyx_slice__100 __pyx_mstate_global->__pyx_slice__100
#define __pyx_tuple__101 __pyx_mstate_global->__pyx_tuple__101
#define __pyx_tuple__102 __pyx_mstate_global->__pyx_tuple__102
#define __pyx_tuple__103 __pyx_mstate_global->__pyx_tuple__103
#define __pyx_tuple__104 __pyx_mstate_global->__pyx_tuple__104
#define __pyx_tuple__105 __pyx_mstate_global->__pyx_tuple__105
#define __pyx_tuple__106 __pyx_mstate_global->__pyx_tuple__106
#define __pyx_tuple__107 __pyx_mstate_global->__pyx_tuple__107
#define __pyx_tuple__108 __pyx_mstate_global->__pyx_tuple__108
#define __pyx_tuple__109 __pyx_mstate_global->__pyx_tuple__109
#define __pyx_tuple__110 __pyx_mstate_global->__pyx_tuple__110
#define __pyx_tuple__111 __pyx_mstate_global->__pyx_tuple__111
#define __pyx_tuple__112 __pyx_mstate_global->__pyx_tuple__112
#define __pyx_tuple__113 __pyx_mstate_global->__pyx_tuple__113
#define __pyx_tuple__114 __pyx_mstate_global->__pyx_tuple__114
#define __pyx_tuple__115 __pyx_mstate_global->__pyx_tuple__115
#define __pyx_tuple__116 __pyx_mstate_global->__pyx_tuple__116
#define __pyx_tuple__118 __pyx_mstate_global->__pyx_tuple__118
#define __pyx_tuple__119 __pyx_mstate_global->__pyx_tuple__119
#define __pyx_tuple__120 __pyx_mstate_global->__pyx_tuple__120
#define __pyx_tuple__122 __pyx_mstate_global->__pyx_tuple__122
#define __pyx_tuple__124 __pyx_mstate_global->__pyx_tuple__124
#define __pyx_tuple__126 __pyx_mstate_global->__pyx_tuple__126
#define __pyx_tuple__128 __pyx_mstate_global->__pyx_tuple__128
#define __pyx_tuple__130 __pyx_mstate_global->__pyx_tuple__130
#define __pyx_tuple__132 __pyx_mstate_global->__pyx_tuple__132
#define __pyx_tuple__134 __pyx_mstate_global->__pyx_tuple__134
#define __pyx_tuple__136 __pyx_mstate_global->__pyx_tuple__136
#define __pyx_tuple__138 __pyx_mstate_global->__pyx_tuple__138
#define __pyx_tuple__140 __pyx_mstate_global->__pyx_tuple__140
#define __pyx_tuple__142 __pyx_mstate_global->__pyx_tuple__142
#define __pyx_tuple__144 __pyx_mstate_global->__pyx_tuple__144
#define __pyx_tuple__146 __pyx_mstate_global->__pyx_tuple__146
#define __pyx_tuple__148 __pyx_mstate_global->__pyx_tuple__148
#define __pyx_tuple__150 __pyx_mstate_global->__pyx_tuple__150
#define __pyx_tuple__152 __pyx_mstate_global->__pyx_tuple__152
#define __pyx_tuple__154 __pyx_mstate_global->__pyx_tuple__154
#define __pyx_tuple__156 __pyx_mstate_global->__pyx_tuple__156
#define __pyx_tuple__158 __pyx_mstate_global->__pyx_tuple__158
#define __pyx_tuple__160 __pyx_mstate_global->__pyx_tuple__160
#define __pyx_tuple__162 __pyx_mstate_global->__pyx_tuple__162
#define __pyx_tuple__164 __pyx_mstate_global->__pyx_tuple__164
#define __pyx_tuple__166 __pyx_mstate_global->__pyx_tuple__166
#define __pyx_tuple__168 __pyx_mstate_global->__pyx_tuple__168
#define __pyx_tuple__170 __pyx_mstate_global->__pyx_tuple__170
#define __pyx_tuple__172 __pyx_mstate_global->__pyx_tuple__172
#define __pyx_tuple__174 __pyx_mstate_global->__pyx_tuple__174
#define __pyx_tuple__176 __pyx_mstate_global->__pyx_tuple__176
#define __pyx_tuple__178 __pyx_mstate_global->__pyx_tuple__178
#define __pyx_tuple__180 __pyx_mstate_global->__pyx_tuple__180
#define __pyx_tuple__182 __pyx_mstate_global->__pyx_tuple__182
#define __pyx_tuple__185 __pyx_mstate_global->__pyx_tuple__185
#define __pyx_tuple__187 __pyx_mstate_global->__pyx_tuple__187
#define __pyx_tuple__189 __pyx_mstate_global->__pyx_tuple__189
#define __pyx_tuple__191 __pyx_mstate_global->__pyx_tuple__191
#define __pyx_tuple__193 __pyx_mstate_global->__pyx_tuple__193
#define __pyx_tuple__195 __pyx_mstate_global->__pyx_tuple__195
#define __pyx_tuple__197 __pyx_mstate_global->__pyx_tuple__197
#define __pyx_tuple__200 __pyx_mstate_global->__pyx_tuple__200
#define __pyx_tuple__203 __pyx_mstate_global->__pyx_tuple__203
#define __pyx_codeobj__121 __pyx_mstate_global->__pyx_codeobj__121
#define __pyx_codeobj__123 __pyx_mstate_global->__pyx_codeobj__123
#define __pyx_codeobj__125 __pyx_mstate_global->__pyx_codeobj__125
#define __pyx_codeobj__127 __pyx_mstate_global->__pyx_codeobj__127
#define __pyx_codeobj__129 __pyx_mstate_global->__pyx_codeobj__129
#define __pyx_codeobj__131 __pyx_mstate_global->__pyx_codeobj__131
#define __pyx_codeobj__133 __pyx_mstate_global->__pyx_codeobj__133
#define __pyx_codeobj__135 __pyx_mstate_global->__pyx_codeobj__135
#define __pyx_codeobj__137 __pyx_mstate_global->__pyx_codeobj__137
#define __pyx_codeobj__139 __pyx_mstate_global->__pyx_codeobj__139
#define __pyx_codeobj__141 __pyx_mstate_global->__pyx_codeobj__141
#define __pyx_codeobj__143 __pyx_mstate_global->__pyx_codeobj__143
#define __pyx_codeobj__145 __pyx_mstate_global->__pyx_codeobj__145
#define __pyx_codeobj__147 __pyx_mstate_global->__pyx_codeobj__147
#define __pyx_codeobj__149 __pyx_mstate_global->__pyx_codeobj__149
#define __pyx_codeobj__151 __pyx_mstate_global->__pyx_codeobj__151
#define __pyx_codeobj__153 __pyx_mstate_global->__pyx_codeobj__153
#define __pyx_codeobj__155 __pyx_mstate_global->__pyx_codeobj__155
#define __pyx_codeobj__157 __pyx_mstate_global->__pyx_codeobj__157
#define __pyx_codeobj__159 __pyx_mstate_global->__pyx_codeobj__159
#define __pyx_codeobj__161 __pyx_mstate_global->__pyx_codeobj__161
#define __pyx_codeobj__163 __pyx_mstate_global->__pyx_codeobj__163
#define __pyx_codeobj__165 __pyx_mstate_global->__pyx_codeobj__165
#define __pyx_codeobj__167 __pyx_mstate_global->__pyx_codeobj__167
#define __pyx_codeobj__169 __pyx_mstate_global->__pyx_codeobj__169
#define __pyx_codeobj__171 __pyx_mstate_global->__pyx_codeobj__171
#define __pyx_codeobj__173 __pyx_mstate_global->__pyx_codeobj__173
#define __pyx_codeobj__175 __pyx_mstate_global->__pyx_codeobj__175
#define __pyx_codeobj__177 __pyx_mstate_global->__pyx_codeobj__177
#define __pyx_codeobj__179 __pyx_mstate_global->__pyx_codeobj__179
#define __pyx_codeobj__181 __pyx_mstate_global->__pyx_codeobj__181
#define __pyx_codeobj__183 __pyx_mstate_global->__pyx_codeobj__183
#define __pyx_codeobj__184 __pyx_mstate_global->__pyx_codeobj__184
#define __pyx_codeobj__186 __pyx_mstate_global->__pyx_codeobj__186
#define __pyx_codeobj__188 __pyx_mstate_global->__pyx_codeobj__188
#define __pyx_codeobj__190 __pyx_mstate_global->__pyx_codeobj__190
#define __pyx_codeobj__192 __pyx_mstate_global->__pyx_codeobj__192
#define __pyx_codeobj__194 __pyx_mstate_global->__pyx_codeobj__194
#define __pyx_codeobj__196 __pyx_mstate_global->__pyx_codeobj__196
#define __pyx_codeobj__198 __pyx_mstate_global->__pyx_codeobj__198
#define __pyx_codeobj__199 __pyx_mstate_global->__pyx_codeobj__199
#define __pyx_codeobj__201 __pyx_mstate_global->__pyx_codeobj__201
#define __pyx_codeobj__202 __pyx_mstate_global->__pyx_codeobj__202
#define __pyx_codeobj__204 __pyx_mstate_global->__pyx_codeobj__204
/* #### Code section: module_code ### */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

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

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

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

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

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

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

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1046
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

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

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

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

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

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

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

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1052
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

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

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

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

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

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

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

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "cpython/time.pxd":52
 *         _PyTime_t tic
 * 
 *     tic = PyTime_TimeUnchecked()             # <<<<<<<<<<<<<<
 *     return PyTime_AsSecondsDouble(tic)
 * 
 */
  __pyx_v_tic = __Pyx_PyTime_TimeUnchecked();

  /* "cpython/time.pxd":53
 * 
 *     tic = PyTime_TimeUnchecked()
 *     return PyTime_AsSecondsDouble(tic)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __Pyx_PyTime_AsSecondsDouble(__pyx_v_tic);
  goto __pyx_L0;

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

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

/* "cpython/time.pxd":56
 * 
 * 
 * cdef inline int _raise_from_errno() except -1 with gil:             # <<<<<<<<<<<<<<
 *     PyErr_SetFromErrno(RuntimeError)
 *     return <int> -1  # Let the C compiler know that this function always raises.
 */

static CYTHON_INLINE int __pyx_f_7cpython_4time__raise_from_errno(void) {
  int __pyx_r;
  PyObject *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif

  /* "cpython/time.pxd":57
 * 
 * cdef inline int _raise_from_errno() except -1 with gil:
 *     PyErr_SetFromErrno(RuntimeError)             # <<<<<<<<<<<<<<
 *     return <int> -1  # Let the C compiler know that this function always raises.
 * 
 */
  __pyx_t_1 = PyErr_SetFromErrno(__pyx_builtin_RuntimeError); if (unlikely(__pyx_t_1 == ((PyObject *)NULL))) __PYX_ERR(5, 57, __pyx_L1_error)

  /* "cpython/time.pxd":58
 * cdef inline int _raise_from_errno() except -1 with gil:
 *     PyErr_SetFromErrno(RuntimeError)
 *     return <int> -1  # Let the C compiler know that this function always raises.             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((int)-1L);
  goto __pyx_L0;

  /* "cpython/time.pxd":56
 * 
 * 
 * cdef inline int _raise_from_errno() except -1 with gil:             # <<<<<<<<<<<<<<
 *     PyErr_SetFromErrno(RuntimeError)
 *     return <int> -1  # Let the C compiler know that this function always raises.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cpython.time._raise_from_errno", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "cpython/time.pxd":61
 * 
 * 
 * cdef inline tm localtime() except * nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Analogue to the stdlib time.localtime.  The returned struct
 */

static CYTHON_INLINE struct tm __pyx_f_7cpython_4time_localtime(void) {
  time_t __pyx_v_tic;
  struct tm *__pyx_v_result;
  struct tm __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif

  /* "cpython/time.pxd":67
 *     """
 *     cdef:
 *         time_t tic = <time_t>time()             # <<<<<<<<<<<<<<
 *         tm* result
 * 
 */
  __pyx_v_tic = ((time_t)__pyx_f_7cpython_4time_time());

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

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

    /* "cpython/time.pxd":72
 *     result = libc_localtime(&tic)
 *     if result is NULL:
 *         _raise_from_errno()             # <<<<<<<<<<<<<<
 *     # Fix 0-based date values (and the 1900-based year).
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 */
    __pyx_t_2 = __pyx_f_7cpython_4time__raise_from_errno(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 72, __pyx_L1_error)

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

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

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

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

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

  /* "cpython/time.pxd":79
 *     result.tm_wday = <int> ((result.tm_wday + 6) % 7)
 *     result.tm_yday += 1
 *     return result[0]             # <<<<<<<<<<<<<<
 */
  __pyx_r = (__pyx_v_result[0]);
  goto __pyx_L0;

  /* "cpython/time.pxd":61
 * 
 * 
 * cdef inline tm localtime() except * nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Analogue to the stdlib time.localtime.  The returned struct
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cpython.time.localtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  return __pyx_r;
}

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

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_math_mod(PY_LONG_LONG __pyx_v_num, PY_LONG_LONG __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_math_mod *__pyx_optional_args) {
  PY_LONG_LONG __pyx_v_offset = ((PY_LONG_LONG)0);
  int __pyx_v_neg_f;
  PY_LONG_LONG __pyx_v_r;
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("math_mod", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }

  /* "cytimes/utils.pxd":144
 *     >>> (num % factor) + offset
 *     """
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.math_mod()'.")
 * 
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":145
 *     """
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.math_mod()'.")             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 145, __pyx_L1_error)

    /* "cytimes/utils.pxd":144
 *     >>> (num % factor) + offset
 *     """
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.math_mod()'.")
 * 
 */
  }

  /* "cytimes/utils.pxd":148
 * 
 *     cdef:
 *         bint neg_f = factor < 0             # <<<<<<<<<<<<<<
 *         long long r
 * 
 */
  __pyx_v_neg_f = (__pyx_v_factor < 0);

  /* "cytimes/utils.pxd":152
 * 
 *     with cython.cdivision(True):
 *         r = num % factor             # <<<<<<<<<<<<<<
 *         if r != 0:
 *             if not neg_f:
 */
  __pyx_v_r = (__pyx_v_num % __pyx_v_factor);

  /* "cytimes/utils.pxd":153
 *     with cython.cdivision(True):
 *         r = num % factor
 *         if r != 0:             # <<<<<<<<<<<<<<
 *             if not neg_f:
 *                 if r < 0:
 */
  __pyx_t_1 = (__pyx_v_r != 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":154
 *         r = num % factor
 *         if r != 0:
 *             if not neg_f:             # <<<<<<<<<<<<<<
 *                 if r < 0:
 *                     r += factor
 */
    __pyx_t_1 = (!__pyx_v_neg_f);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":155
 *         if r != 0:
 *             if not neg_f:
 *                 if r < 0:             # <<<<<<<<<<<<<<
 *                     r += factor
 *             else:
 */
      __pyx_t_1 = (__pyx_v_r < 0);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":156
 *             if not neg_f:
 *                 if r < 0:
 *                     r += factor             # <<<<<<<<<<<<<<
 *             else:
 *                 if r > 0:
 */
        __pyx_v_r = (__pyx_v_r + __pyx_v_factor);

        /* "cytimes/utils.pxd":155
 *         if r != 0:
 *             if not neg_f:
 *                 if r < 0:             # <<<<<<<<<<<<<<
 *                     r += factor
 *             else:
 */
      }

      /* "cytimes/utils.pxd":154
 *         r = num % factor
 *         if r != 0:
 *             if not neg_f:             # <<<<<<<<<<<<<<
 *                 if r < 0:
 *                     r += factor
 */
      goto __pyx_L5;
    }

    /* "cytimes/utils.pxd":158
 *                     r += factor
 *             else:
 *                 if r > 0:             # <<<<<<<<<<<<<<
 *                     r += factor
 *     return r + offset
 */
    /*else*/ {
      __pyx_t_1 = (__pyx_v_r > 0);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":159
 *             else:
 *                 if r > 0:
 *                     r += factor             # <<<<<<<<<<<<<<
 *     return r + offset
 * 
 */
        __pyx_v_r = (__pyx_v_r + __pyx_v_factor);

        /* "cytimes/utils.pxd":158
 *                     r += factor
 *             else:
 *                 if r > 0:             # <<<<<<<<<<<<<<
 *                     r += factor
 *     return r + offset
 */
      }
    }
    __pyx_L5:;

    /* "cytimes/utils.pxd":153
 *     with cython.cdivision(True):
 *         r = num % factor
 *         if r != 0:             # <<<<<<<<<<<<<<
 *             if not neg_f:
 *                 if r < 0:
 */
  }

  /* "cytimes/utils.pxd":160
 *                 if r > 0:
 *                     r += factor
 *     return r + offset             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long math_round_div(long long num, long long factor, long long offset=0):
 */
  __pyx_r = (__pyx_v_r + __pyx_v_offset);
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.math_mod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_math_round_div(PY_LONG_LONG __pyx_v_num, PY_LONG_LONG __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_math_round_div *__pyx_optional_args) {
  PY_LONG_LONG __pyx_v_offset = ((PY_LONG_LONG)0);
  int __pyx_v_neg_f;
  PY_LONG_LONG __pyx_v_abs_f;
  PY_LONG_LONG __pyx_v_q;
  PY_LONG_LONG __pyx_v_r;
  PY_LONG_LONG __pyx_v_abs_r;
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PY_LONG_LONG __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("math_round_div", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }

  /* "cytimes/utils.pxd":170
 *     >>> round(num / factor, 0) + offset
 *     """
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.math_round_div()'.")
 * 
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":171
 *     """
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.math_round_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 171, __pyx_L1_error)

    /* "cytimes/utils.pxd":170
 *     >>> round(num / factor, 0) + offset
 *     """
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.math_round_div()'.")
 * 
 */
  }

  /* "cytimes/utils.pxd":174
 * 
 *     cdef:
 *         bint neg_f = factor < 0             # <<<<<<<<<<<<<<
 *         long long abs_f = -factor if neg_f else factor
 *         long long q, r, abs_r
 */
  __pyx_v_neg_f = (__pyx_v_factor < 0);

  /* "cytimes/utils.pxd":175
 *     cdef:
 *         bint neg_f = factor < 0
 *         long long abs_f = -factor if neg_f else factor             # <<<<<<<<<<<<<<
 *         long long q, r, abs_r
 * 
 */
  if (__pyx_v_neg_f) {
    __pyx_t_3 = (-__pyx_v_factor);
  } else {
    __pyx_t_3 = __pyx_v_factor;
  }
  __pyx_v_abs_f = __pyx_t_3;

  /* "cytimes/utils.pxd":179
 * 
 *     with cython.cdivision(True):
 *         q = num // factor             # <<<<<<<<<<<<<<
 *         r = num % factor
 *         abs_r = -r if r < 0 else r
 */
  __pyx_v_q = (__pyx_v_num / __pyx_v_factor);

  /* "cytimes/utils.pxd":180
 *     with cython.cdivision(True):
 *         q = num // factor
 *         r = num % factor             # <<<<<<<<<<<<<<
 *         abs_r = -r if r < 0 else r
 *         if abs_r * 2 >= abs_f:
 */
  __pyx_v_r = (__pyx_v_num % __pyx_v_factor);

  /* "cytimes/utils.pxd":181
 *         q = num // factor
 *         r = num % factor
 *         abs_r = -r if r < 0 else r             # <<<<<<<<<<<<<<
 *         if abs_r * 2 >= abs_f:
 *             if (not neg_f and num >= 0) or (neg_f and num < 0):
 */
  __pyx_t_1 = (__pyx_v_r < 0);
  if (__pyx_t_1) {
    __pyx_t_3 = (-__pyx_v_r);
  } else {
    __pyx_t_3 = __pyx_v_r;
  }
  __pyx_v_abs_r = __pyx_t_3;

  /* "cytimes/utils.pxd":182
 *         r = num % factor
 *         abs_r = -r if r < 0 else r
 *         if abs_r * 2 >= abs_f:             # <<<<<<<<<<<<<<
 *             if (not neg_f and num >= 0) or (neg_f and num < 0):
 *                 q += 1
 */
  __pyx_t_1 = ((__pyx_v_abs_r * 2) >= __pyx_v_abs_f);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":183
 *         abs_r = -r if r < 0 else r
 *         if abs_r * 2 >= abs_f:
 *             if (not neg_f and num >= 0) or (neg_f and num < 0):             # <<<<<<<<<<<<<<
 *                 q += 1
 *             else:
 */
    __pyx_t_4 = (!__pyx_v_neg_f);
    if (!__pyx_t_4) {
      goto __pyx_L7_next_or;
    } else {
    }
    __pyx_t_4 = (__pyx_v_num >= 0);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_1 = __pyx_t_4;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_L7_next_or:;
    if (__pyx_v_neg_f) {
    } else {
      __pyx_t_1 = __pyx_v_neg_f;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_num < 0);
    __pyx_t_1 = __pyx_t_4;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":184
 *         if abs_r * 2 >= abs_f:
 *             if (not neg_f and num >= 0) or (neg_f and num < 0):
 *                 q += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 q -= 1
 */
      __pyx_v_q = (__pyx_v_q + 1);

      /* "cytimes/utils.pxd":183
 *         abs_r = -r if r < 0 else r
 *         if abs_r * 2 >= abs_f:
 *             if (not neg_f and num >= 0) or (neg_f and num < 0):             # <<<<<<<<<<<<<<
 *                 q += 1
 *             else:
 */
      goto __pyx_L5;
    }

    /* "cytimes/utils.pxd":186
 *                 q += 1
 *             else:
 *                 q -= 1             # <<<<<<<<<<<<<<
 *     return q + offset
 * 
 */
    /*else*/ {
      __pyx_v_q = (__pyx_v_q - 1);
    }
    __pyx_L5:;

    /* "cytimes/utils.pxd":182
 *         r = num % factor
 *         abs_r = -r if r < 0 else r
 *         if abs_r * 2 >= abs_f:             # <<<<<<<<<<<<<<
 *             if (not neg_f and num >= 0) or (neg_f and num < 0):
 *                 q += 1
 */
  }

  /* "cytimes/utils.pxd":187
 *             else:
 *                 q -= 1
 *     return q + offset             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long math_ceil_div(long long num, long long factor, long long offset=0):
 */
  __pyx_r = (__pyx_v_q + __pyx_v_offset);
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.math_round_div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_math_ceil_div(PY_LONG_LONG __pyx_v_num, PY_LONG_LONG __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_math_ceil_div *__pyx_optional_args) {
  PY_LONG_LONG __pyx_v_offset = ((PY_LONG_LONG)0);
  PY_LONG_LONG __pyx_v_q;
  PY_LONG_LONG __pyx_v_r;
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("math_ceil_div", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }

  /* "cytimes/utils.pxd":197
 *     >>> math.ceil(num / factor) + offset
 *     """
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.math_ceil_div()'.")
 * 
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":198
 *     """
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.math_ceil_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     cdef long long q, r
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 198, __pyx_L1_error)

    /* "cytimes/utils.pxd":197
 *     >>> math.ceil(num / factor) + offset
 *     """
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.math_ceil_div()'.")
 * 
 */
  }

  /* "cytimes/utils.pxd":202
 *     cdef long long q, r
 *     with cython.cdivision(True):
 *         q = num // factor             # <<<<<<<<<<<<<<
 *         r = num % factor
 *         if r != 0:
 */
  __pyx_v_q = (__pyx_v_num / __pyx_v_factor);

  /* "cytimes/utils.pxd":203
 *     with cython.cdivision(True):
 *         q = num // factor
 *         r = num % factor             # <<<<<<<<<<<<<<
 *         if r != 0:
 *             if factor > 0:
 */
  __pyx_v_r = (__pyx_v_num % __pyx_v_factor);

  /* "cytimes/utils.pxd":204
 *         q = num // factor
 *         r = num % factor
 *         if r != 0:             # <<<<<<<<<<<<<<
 *             if factor > 0:
 *                 if num > 0:
 */
  __pyx_t_1 = (__pyx_v_r != 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":205
 *         r = num % factor
 *         if r != 0:
 *             if factor > 0:             # <<<<<<<<<<<<<<
 *                 if num > 0:
 *                     q += 1
 */
    __pyx_t_1 = (__pyx_v_factor > 0);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":206
 *         if r != 0:
 *             if factor > 0:
 *                 if num > 0:             # <<<<<<<<<<<<<<
 *                     q += 1
 *             else:
 */
      __pyx_t_1 = (__pyx_v_num > 0);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":207
 *             if factor > 0:
 *                 if num > 0:
 *                     q += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 if num < 0:
 */
        __pyx_v_q = (__pyx_v_q + 1);

        /* "cytimes/utils.pxd":206
 *         if r != 0:
 *             if factor > 0:
 *                 if num > 0:             # <<<<<<<<<<<<<<
 *                     q += 1
 *             else:
 */
      }

      /* "cytimes/utils.pxd":205
 *         r = num % factor
 *         if r != 0:
 *             if factor > 0:             # <<<<<<<<<<<<<<
 *                 if num > 0:
 *                     q += 1
 */
      goto __pyx_L5;
    }

    /* "cytimes/utils.pxd":209
 *                     q += 1
 *             else:
 *                 if num < 0:             # <<<<<<<<<<<<<<
 *                     q += 1
 *     return q + offset
 */
    /*else*/ {
      __pyx_t_1 = (__pyx_v_num < 0);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":210
 *             else:
 *                 if num < 0:
 *                     q += 1             # <<<<<<<<<<<<<<
 *     return q + offset
 * 
 */
        __pyx_v_q = (__pyx_v_q + 1);

        /* "cytimes/utils.pxd":209
 *                     q += 1
 *             else:
 *                 if num < 0:             # <<<<<<<<<<<<<<
 *                     q += 1
 *     return q + offset
 */
      }
    }
    __pyx_L5:;

    /* "cytimes/utils.pxd":204
 *         q = num // factor
 *         r = num % factor
 *         if r != 0:             # <<<<<<<<<<<<<<
 *             if factor > 0:
 *                 if num > 0:
 */
  }

  /* "cytimes/utils.pxd":211
 *                 if num < 0:
 *                     q += 1
 *     return q + offset             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long math_floor_div(long long num, long long factor, long long offset=0):
 */
  __pyx_r = (__pyx_v_q + __pyx_v_offset);
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.math_ceil_div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_math_floor_div(PY_LONG_LONG __pyx_v_num, PY_LONG_LONG __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_math_floor_div *__pyx_optional_args) {
  PY_LONG_LONG __pyx_v_offset = ((PY_LONG_LONG)0);
  PY_LONG_LONG __pyx_v_q;
  PY_LONG_LONG __pyx_v_r;
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("math_floor_div", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }

  /* "cytimes/utils.pxd":221
 *     >>> math.floor(num / factor) + offset
 *     """
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.math_floor_div()'.")
 * 
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":222
 *     """
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.math_floor_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     cdef long long q, r
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 222, __pyx_L1_error)

    /* "cytimes/utils.pxd":221
 *     >>> math.floor(num / factor) + offset
 *     """
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.math_floor_div()'.")
 * 
 */
  }

  /* "cytimes/utils.pxd":226
 *     cdef long long q, r
 *     with cython.cdivision(True):
 *         q = num // factor             # <<<<<<<<<<<<<<
 *         r = num % factor
 *         if r != 0:
 */
  __pyx_v_q = (__pyx_v_num / __pyx_v_factor);

  /* "cytimes/utils.pxd":227
 *     with cython.cdivision(True):
 *         q = num // factor
 *         r = num % factor             # <<<<<<<<<<<<<<
 *         if r != 0:
 *             if factor > 0:
 */
  __pyx_v_r = (__pyx_v_num % __pyx_v_factor);

  /* "cytimes/utils.pxd":228
 *         q = num // factor
 *         r = num % factor
 *         if r != 0:             # <<<<<<<<<<<<<<
 *             if factor > 0:
 *                 if num < 0:
 */
  __pyx_t_1 = (__pyx_v_r != 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":229
 *         r = num % factor
 *         if r != 0:
 *             if factor > 0:             # <<<<<<<<<<<<<<
 *                 if num < 0:
 *                     q -= 1
 */
    __pyx_t_1 = (__pyx_v_factor > 0);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":230
 *         if r != 0:
 *             if factor > 0:
 *                 if num < 0:             # <<<<<<<<<<<<<<
 *                     q -= 1
 *             else:
 */
      __pyx_t_1 = (__pyx_v_num < 0);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":231
 *             if factor > 0:
 *                 if num < 0:
 *                     q -= 1             # <<<<<<<<<<<<<<
 *             else:
 *                 if num > 0:
 */
        __pyx_v_q = (__pyx_v_q - 1);

        /* "cytimes/utils.pxd":230
 *         if r != 0:
 *             if factor > 0:
 *                 if num < 0:             # <<<<<<<<<<<<<<
 *                     q -= 1
 *             else:
 */
      }

      /* "cytimes/utils.pxd":229
 *         r = num % factor
 *         if r != 0:
 *             if factor > 0:             # <<<<<<<<<<<<<<
 *                 if num < 0:
 *                     q -= 1
 */
      goto __pyx_L5;
    }

    /* "cytimes/utils.pxd":233
 *                     q -= 1
 *             else:
 *                 if num > 0:             # <<<<<<<<<<<<<<
 *                     q -= 1
 *     return q + offset
 */
    /*else*/ {
      __pyx_t_1 = (__pyx_v_num > 0);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":234
 *             else:
 *                 if num > 0:
 *                     q -= 1             # <<<<<<<<<<<<<<
 *     return q + offset
 * 
 */
        __pyx_v_q = (__pyx_v_q - 1);

        /* "cytimes/utils.pxd":233
 *                     q -= 1
 *             else:
 *                 if num > 0:             # <<<<<<<<<<<<<<
 *                     q -= 1
 *     return q + offset
 */
      }
    }
    __pyx_L5:;

    /* "cytimes/utils.pxd":228
 *         q = num // factor
 *         r = num % factor
 *         if r != 0:             # <<<<<<<<<<<<<<
 *             if factor > 0:
 *                 if num < 0:
 */
  }

  /* "cytimes/utils.pxd":235
 *                 if num > 0:
 *                     q -= 1
 *     return q + offset             # <<<<<<<<<<<<<<
 * 
 * # Parser -----------------------------------------------------------------------------------------------
 */
  __pyx_r = (__pyx_v_q + __pyx_v_offset);
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.math_floor_div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":239
 * # Parser -----------------------------------------------------------------------------------------------
 * # . check
 * cdef inline Py_ssize_t str_count(str s, str substr) except -1:             # <<<<<<<<<<<<<<
 *     """Get the number of occurrences of a 'substr' in an unicode `<'int'>`.
 * 
 */

static CYTHON_INLINE Py_ssize_t __pyx_f_7cytimes_5utils_str_count(PyObject *__pyx_v_s, PyObject *__pyx_v_substr) {
  Py_ssize_t __pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":245
 *     >>> s.count(substr)
 *     """
 *     return PyUnicode_Count(s, substr, 0, PY_SSIZE_T_MAX)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_iso_sep(Py_UCS4 ch) except -1:
 */
  __pyx_t_1 = PyUnicode_Count(__pyx_v_s, __pyx_v_substr, 0, PY_SSIZE_T_MAX); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1L))) __PYX_ERR(0, 245, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":239
 * # Parser -----------------------------------------------------------------------------------------------
 * # . check
 * cdef inline Py_ssize_t str_count(str s, str substr) except -1:             # <<<<<<<<<<<<<<
 *     """Get the number of occurrences of a 'substr' in an unicode `<'int'>`.
 * 
 */

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

/* "cytimes/utils.pxd":247
 *     return PyUnicode_Count(s, substr, 0, PY_SSIZE_T_MAX)
 * 
 * cdef inline bint is_iso_sep(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ISO format date/time seperator (" " or "T") `<'bool'>`"""
 *     return ch in (" ", "t", "T")
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_iso_sep(Py_UCS4 __pyx_v_ch) {
  int __pyx_r;
  int __pyx_t_1;

  /* "cytimes/utils.pxd":249
 * cdef inline bint is_iso_sep(Py_UCS4 ch) except -1:
 *     """Check if the passed in 'ch' is an ISO format date/time seperator (" " or "T") `<'bool'>`"""
 *     return ch in (" ", "t", "T")             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_isodate_sep(Py_UCS4 ch) except -1:
 */
  switch (__pyx_v_ch) {
    case 32:
    case 0x74:
    case 84:
    __pyx_t_1 = 1;
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":247
 *     return PyUnicode_Count(s, substr, 0, PY_SSIZE_T_MAX)
 * 
 * cdef inline bint is_iso_sep(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ISO format date/time seperator (" " or "T") `<'bool'>`"""
 *     return ch in (" ", "t", "T")
 */

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

/* "cytimes/utils.pxd":251
 *     return ch in (" ", "t", "T")
 * 
 * cdef inline bint is_isodate_sep(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ISO format date fields separator ("-" or "/") `<'bool'>`"""
 *     return ch in ("-", "/")
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_isodate_sep(Py_UCS4 __pyx_v_ch) {
  int __pyx_r;
  int __pyx_t_1;

  /* "cytimes/utils.pxd":253
 * cdef inline bint is_isodate_sep(Py_UCS4 ch) except -1:
 *     """Check if the passed in 'ch' is an ISO format date fields separator ("-" or "/") `<'bool'>`"""
 *     return ch in ("-", "/")             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_isoweek_sep(Py_UCS4 ch) except -1:
 */
  switch (__pyx_v_ch) {
    case 45:
    case 47:
    __pyx_t_1 = 1;
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":251
 *     return ch in (" ", "t", "T")
 * 
 * cdef inline bint is_isodate_sep(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ISO format date fields separator ("-" or "/") `<'bool'>`"""
 *     return ch in ("-", "/")
 */

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

/* "cytimes/utils.pxd":255
 *     return ch in ("-", "/")
 * 
 * cdef inline bint is_isoweek_sep(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ISO format week number identifier ("W") `<'bool'>`"""
 *     return ch in ("W", "w")
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_isoweek_sep(Py_UCS4 __pyx_v_ch) {
  int __pyx_r;
  int __pyx_t_1;

  /* "cytimes/utils.pxd":257
 * cdef inline bint is_isoweek_sep(Py_UCS4 ch) except -1:
 *     """Check if the passed in 'ch' is an ISO format week number identifier ("W") `<'bool'>`"""
 *     return ch in ("W", "w")             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_isotime_sep(Py_UCS4 ch) except -1:
 */
  switch (__pyx_v_ch) {
    case 87:
    case 0x77:
    __pyx_t_1 = 1;
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":255
 *     return ch in ("-", "/")
 * 
 * cdef inline bint is_isoweek_sep(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ISO format week number identifier ("W") `<'bool'>`"""
 *     return ch in ("W", "w")
 */

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

/* "cytimes/utils.pxd":259
 *     return ch in ("W", "w")
 * 
 * cdef inline bint is_isotime_sep(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ISO format time fields separator (":") `<'bool'>`"""
 *     return ch == ":"
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_isotime_sep(Py_UCS4 __pyx_v_ch) {
  int __pyx_r;

  /* "cytimes/utils.pxd":261
 * cdef inline bint is_isotime_sep(Py_UCS4 ch) except -1:
 *     """Check if the passed in 'ch' is an ISO format time fields separator (":") `<'bool'>`"""
 *     return ch == ":"             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_ascii_digit(Py_UCS4 ch) except -1:
 */
  __pyx_r = (__pyx_v_ch == 58);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":259
 *     return ch in ("W", "w")
 * 
 * cdef inline bint is_isotime_sep(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ISO format time fields separator (":") `<'bool'>`"""
 *     return ch == ":"
 */

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

/* "cytimes/utils.pxd":263
 *     return ch == ":"
 * 
 * cdef inline bint is_ascii_digit(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ASCII digit [0-9] `<'bool'>`"""
 *     return "0" <= ch <= "9"
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_ascii_digit(Py_UCS4 __pyx_v_ch) {
  int __pyx_r;
  int __pyx_t_1;

  /* "cytimes/utils.pxd":265
 * cdef inline bint is_ascii_digit(Py_UCS4 ch) except -1:
 *     """Check if the passed in 'ch' is an ASCII digit [0-9] `<'bool'>`"""
 *     return "0" <= ch <= "9"             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_ascii_alpha_upper(Py_UCS4 ch) except -1:
 */
  __pyx_t_1 = (48 <= __pyx_v_ch);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_ch <= 57);
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":263
 *     return ch == ":"
 * 
 * cdef inline bint is_ascii_digit(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ASCII digit [0-9] `<'bool'>`"""
 *     return "0" <= ch <= "9"
 */

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

/* "cytimes/utils.pxd":267
 *     return "0" <= ch <= "9"
 * 
 * cdef inline bint is_ascii_alpha_upper(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ASCII alpha in uppercase [A-Z] `<'bool'>`."""
 *     return "A" <= ch <= "Z"
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_ascii_alpha_upper(Py_UCS4 __pyx_v_ch) {
  int __pyx_r;
  int __pyx_t_1;

  /* "cytimes/utils.pxd":269
 * cdef inline bint is_ascii_alpha_upper(Py_UCS4 ch) except -1:
 *     """Check if the passed in 'ch' is an ASCII alpha in uppercase [A-Z] `<'bool'>`."""
 *     return "A" <= ch <= "Z"             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_ascii_alpha_lower(Py_UCS4 ch) except -1:
 */
  __pyx_t_1 = (65 <= __pyx_v_ch);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_ch <= 90);
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":267
 *     return "0" <= ch <= "9"
 * 
 * cdef inline bint is_ascii_alpha_upper(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ASCII alpha in uppercase [A-Z] `<'bool'>`."""
 *     return "A" <= ch <= "Z"
 */

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

/* "cytimes/utils.pxd":271
 *     return "A" <= ch <= "Z"
 * 
 * cdef inline bint is_ascii_alpha_lower(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ASCII alpha in lowercase [a-z] `<'bool'>`."""
 *     return "a" <= ch <= "z"
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_ascii_alpha_lower(Py_UCS4 __pyx_v_ch) {
  int __pyx_r;
  int __pyx_t_1;

  /* "cytimes/utils.pxd":273
 * cdef inline bint is_ascii_alpha_lower(Py_UCS4 ch) except -1:
 *     """Check if the passed in 'ch' is an ASCII alpha in lowercase [a-z] `<'bool'>`."""
 *     return "a" <= ch <= "z"             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_ascii_alpha(Py_UCS4 ch) except -1:
 */
  __pyx_t_1 = (97 <= __pyx_v_ch);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_ch <= 0x7A);
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":271
 *     return "A" <= ch <= "Z"
 * 
 * cdef inline bint is_ascii_alpha_lower(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ASCII alpha in lowercase [a-z] `<'bool'>`."""
 *     return "a" <= ch <= "z"
 */

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

/* "cytimes/utils.pxd":275
 *     return "a" <= ch <= "z"
 * 
 * cdef inline bint is_ascii_alpha(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ASCII alpha [a-zA-Z] `<'bool'>`."""
 *     return is_ascii_alpha_lower(ch) or is_ascii_alpha_upper(ch)
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_ascii_alpha(Py_UCS4 __pyx_v_ch) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":277
 * cdef inline bint is_ascii_alpha(Py_UCS4 ch) except -1:
 *     """Check if the passed in 'ch' is an ASCII alpha [a-zA-Z] `<'bool'>`."""
 *     return is_ascii_alpha_lower(ch) or is_ascii_alpha_upper(ch)             # <<<<<<<<<<<<<<
 * 
 * # . parse
 */
  __pyx_t_2 = __pyx_f_7cytimes_5utils_is_ascii_alpha_lower(__pyx_v_ch); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 277, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = __pyx_f_7cytimes_5utils_is_ascii_alpha_upper(__pyx_v_ch); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 277, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":275
 *     return "a" <= ch <= "z"
 * 
 * cdef inline bint is_ascii_alpha(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ASCII alpha [a-zA-Z] `<'bool'>`."""
 *     return is_ascii_alpha_lower(ch) or is_ascii_alpha_upper(ch)
 */

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

/* "cytimes/utils.pxd":280
 * 
 * # . parse
 * cdef inline int parse_isoyear(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse ISO format year component (YYYY) from a string,
 *     returns `-1` for invalid ISO years `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isoyear(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  char __pyx_v_buffer[5];
  Py_UCS4 __pyx_v_ch;
  Py_ssize_t __pyx_v_i;
  int __pyx_v_year;
  int __pyx_r;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":295
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 4:
 */
  __pyx_t_1 = (__pyx_v_size <= 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":296
 *     # Validate
 *     if size <= 0:
 *         size = str_len(data)             # <<<<<<<<<<<<<<
 *     if size - pos < 4:
 *         return -1  # exit: invalid
 */
    __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_data);

    /* "cytimes/utils.pxd":295
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 4:
 */
  }

  /* "cytimes/utils.pxd":297
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 4:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  __pyx_t_1 = ((__pyx_v_size - __pyx_v_pos) < 4);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":298
 *         size = str_len(data)
 *     if size - pos < 4:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 * 
 *     # Parse values
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":297
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 4:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  }

  /* "cytimes/utils.pxd":304
 *     cdef Py_UCS4 ch
 *     cdef Py_ssize_t i
 *     for i in range(4):             # <<<<<<<<<<<<<<
 *         ch = str_read(data, pos + i)
 *         if not is_ascii_digit(ch):
 */
  for (__pyx_t_2 = 0; __pyx_t_2 < 4; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "cytimes/utils.pxd":305
 *     cdef Py_ssize_t i
 *     for i in range(4):
 *         ch = str_read(data, pos + i)             # <<<<<<<<<<<<<<
 *         if not is_ascii_digit(ch):
 *             return -1  # exit: invalid
 */
    __pyx_t_3 = PyUnicode_ReadChar(__pyx_v_data, (__pyx_v_pos + __pyx_v_i)); if (unlikely(__pyx_t_3 == ((Py_UCS4)-1))) __PYX_ERR(0, 305, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_3;

    /* "cytimes/utils.pxd":306
 *     for i in range(4):
 *         ch = str_read(data, pos + i)
 *         if not is_ascii_digit(ch):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *         buffer[i] = ch
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_ascii_digit(__pyx_v_ch); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 306, __pyx_L1_error)
    __pyx_t_4 = (!__pyx_t_1);
    if (__pyx_t_4) {

      /* "cytimes/utils.pxd":307
 *         ch = str_read(data, pos + i)
 *         if not is_ascii_digit(ch):
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *         buffer[i] = ch
 *     # . null-terminate
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":306
 *     for i in range(4):
 *         ch = str_read(data, pos + i)
 *         if not is_ascii_digit(ch):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *         buffer[i] = ch
 */
    }

    /* "cytimes/utils.pxd":308
 *         if not is_ascii_digit(ch):
 *             return -1  # exit: invalid
 *         buffer[i] = ch             # <<<<<<<<<<<<<<
 *     # . null-terminate
 *     buffer[4] = 0  # null-term
 */
    (__pyx_v_buffer[__pyx_v_i]) = __pyx_v_ch;
  }

  /* "cytimes/utils.pxd":310
 *         buffer[i] = ch
 *     # . null-terminate
 *     buffer[4] = 0  # null-term             # <<<<<<<<<<<<<<
 * 
 *     # Convert to integer
 */
  (__pyx_v_buffer[4]) = 0;

  /* "cytimes/utils.pxd":313
 * 
 *     # Convert to integer
 *     cdef int year = strtoll(buffer, NULL, 10)             # <<<<<<<<<<<<<<
 *     return year if year != 0 else -1
 * 
 */
  __pyx_v_year = strtoll(__pyx_v_buffer, NULL, 10);

  /* "cytimes/utils.pxd":314
 *     # Convert to integer
 *     cdef int year = strtoll(buffer, NULL, 10)
 *     return year if year != 0 else -1             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_isomonth(str data, Py_ssize_t pos, Py_ssize_t size)  except -2:
 */
  __pyx_t_4 = (__pyx_v_year != 0);
  if (__pyx_t_4) {
    __pyx_t_5 = __pyx_v_year;
  } else {
    __pyx_t_5 = -1;
  }
  __pyx_r = __pyx_t_5;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":280
 * 
 * # . parse
 * cdef inline int parse_isoyear(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse ISO format year component (YYYY) from a string,
 *     returns `-1` for invalid ISO years `<'int'>`.
 */

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

/* "cytimes/utils.pxd":316
 *     return year if year != 0 else -1
 * 
 * cdef inline int parse_isomonth(str data, Py_ssize_t pos, Py_ssize_t size)  except -2:             # <<<<<<<<<<<<<<
 *     """Parse ISO format month component (MM) from a string,
 *     returns `-1` for invalid ISO months `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isomonth(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  char __pyx_v_buffer[3];
  Py_UCS4 __pyx_v_ch1;
  Py_UCS4 __pyx_v_ch2;
  int __pyx_r;
  int __pyx_t_1;
  Py_UCS4 __pyx_t_2;
  int __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":331
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  __pyx_t_1 = (__pyx_v_size <= 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":332
 *     # Validate
 *     if size <= 0:
 *         size = str_len(data)             # <<<<<<<<<<<<<<
 *     if size - pos < 2:
 *         return -1  # exit: invalid
 */
    __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_data);

    /* "cytimes/utils.pxd":331
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  }

  /* "cytimes/utils.pxd":333
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  __pyx_t_1 = ((__pyx_v_size - __pyx_v_pos) < 2);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":334
 *         size = str_len(data)
 *     if size - pos < 2:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 * 
 *     # Parse values
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":333
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  }

  /* "cytimes/utils.pxd":338
 *     # Parse values
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)             # <<<<<<<<<<<<<<
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 == "0":
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, __pyx_v_pos); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(0, 338, __pyx_L1_error)
  __pyx_v_ch1 = __pyx_t_2;

  /* "cytimes/utils.pxd":339
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)             # <<<<<<<<<<<<<<
 *     if ch1 == "0":
 *         if not "1" <= ch2 <= "9":
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, (__pyx_v_pos + 1)); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(0, 339, __pyx_L1_error)
  __pyx_v_ch2 = __pyx_t_2;

  /* "cytimes/utils.pxd":340
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 == "0":             # <<<<<<<<<<<<<<
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid
 */
  switch (__pyx_v_ch1) {
    case 48:

    /* "cytimes/utils.pxd":341
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 == "0":
 *         if not "1" <= ch2 <= "9":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "1":
 */
    __pyx_t_1 = (49 <= __pyx_v_ch2);
    if (__pyx_t_1) {
      __pyx_t_1 = (__pyx_v_ch2 <= 57);
    }
    __pyx_t_3 = (!__pyx_t_1);
    if (__pyx_t_3) {

      /* "cytimes/utils.pxd":342
 *     if ch1 == "0":
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     elif ch1 == "1":
 *         if not "0" <= ch2 <= "2":
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":341
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 == "0":
 *         if not "1" <= ch2 <= "9":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "1":
 */
    }

    /* "cytimes/utils.pxd":340
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 == "0":             # <<<<<<<<<<<<<<
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid
 */
    break;
    case 49:

    /* "cytimes/utils.pxd":344
 *             return -1  # exit: invalid
 *     elif ch1 == "1":
 *         if not "0" <= ch2 <= "2":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     else:
 */
    __pyx_t_3 = (48 <= __pyx_v_ch2);
    if (__pyx_t_3) {
      __pyx_t_3 = (__pyx_v_ch2 <= 50);
    }
    __pyx_t_1 = (!__pyx_t_3);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":345
 *     elif ch1 == "1":
 *         if not "0" <= ch2 <= "2":
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     else:
 *         return -1  # exit: invalid
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":344
 *             return -1  # exit: invalid
 *     elif ch1 == "1":
 *         if not "0" <= ch2 <= "2":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     else:
 */
    }

    /* "cytimes/utils.pxd":343
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid
 *     elif ch1 == "1":             # <<<<<<<<<<<<<<
 *         if not "0" <= ch2 <= "2":
 *             return -1  # exit: invalid
 */
    break;
    default:

    /* "cytimes/utils.pxd":347
 *             return -1  # exit: invalid
 *     else:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 */
    __pyx_r = -1;
    goto __pyx_L0;
    break;
  }

  /* "cytimes/utils.pxd":349
 *         return -1  # exit: invalid
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2             # <<<<<<<<<<<<<<
 *     buffer[2] = 0  # null-term
 * 
 */
  __pyx_t_2 = __pyx_v_ch1;
  __pyx_t_4 = __pyx_v_ch2;
  (__pyx_v_buffer[0]) = __pyx_t_2;
  (__pyx_v_buffer[1]) = __pyx_t_4;

  /* "cytimes/utils.pxd":350
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 *     buffer[2] = 0  # null-term             # <<<<<<<<<<<<<<
 * 
 *     # Convert to integer
 */
  (__pyx_v_buffer[2]) = 0;

  /* "cytimes/utils.pxd":353
 * 
 *     # Convert to integer
 *     return strtoll(buffer, NULL, 10)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_isoday(str data, Py_ssize_t pos, Py_ssize_t size) except -2:
 */
  __pyx_r = strtoll(__pyx_v_buffer, NULL, 10);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":316
 *     return year if year != 0 else -1
 * 
 * cdef inline int parse_isomonth(str data, Py_ssize_t pos, Py_ssize_t size)  except -2:             # <<<<<<<<<<<<<<
 *     """Parse ISO format month component (MM) from a string,
 *     returns `-1` for invalid ISO months `<'int'>`.
 */

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

/* "cytimes/utils.pxd":355
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isoday(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse ISO format day component (DD) from a string,
 *     returns `-1` for invalid ISO days `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isoday(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  char __pyx_v_buffer[3];
  Py_UCS4 __pyx_v_ch1;
  Py_UCS4 __pyx_v_ch2;
  int __pyx_r;
  int __pyx_t_1;
  Py_UCS4 __pyx_t_2;
  int __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":370
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  __pyx_t_1 = (__pyx_v_size <= 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":371
 *     # Validate
 *     if size <= 0:
 *         size = str_len(data)             # <<<<<<<<<<<<<<
 *     if size - pos < 2:
 *         return -1  # exit: invalid
 */
    __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_data);

    /* "cytimes/utils.pxd":370
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  }

  /* "cytimes/utils.pxd":372
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  __pyx_t_1 = ((__pyx_v_size - __pyx_v_pos) < 2);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":373
 *         size = str_len(data)
 *     if size - pos < 2:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 * 
 *     # Parse values
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":372
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  }

  /* "cytimes/utils.pxd":377
 *     # Parse values
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)             # <<<<<<<<<<<<<<
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("1", "2"):
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, __pyx_v_pos); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(0, 377, __pyx_L1_error)
  __pyx_v_ch1 = __pyx_t_2;

  /* "cytimes/utils.pxd":378
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)             # <<<<<<<<<<<<<<
 *     if ch1 in ("1", "2"):
 *         if not is_ascii_digit(ch2):
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, (__pyx_v_pos + 1)); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(0, 378, __pyx_L1_error)
  __pyx_v_ch2 = __pyx_t_2;

  /* "cytimes/utils.pxd":379
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("1", "2"):             # <<<<<<<<<<<<<<
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 */
  switch (__pyx_v_ch1) {
    case 49:
    case 50:

    /* "cytimes/utils.pxd":380
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("1", "2"):
 *         if not is_ascii_digit(ch2):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "0":
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_ascii_digit(__pyx_v_ch2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 380, __pyx_L1_error)
    __pyx_t_3 = (!__pyx_t_1);
    if (__pyx_t_3) {

      /* "cytimes/utils.pxd":381
 *     if ch1 in ("1", "2"):
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     elif ch1 == "0":
 *         if not "1" <= ch2 <= "9":
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":380
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("1", "2"):
 *         if not is_ascii_digit(ch2):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "0":
 */
    }

    /* "cytimes/utils.pxd":379
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("1", "2"):             # <<<<<<<<<<<<<<
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 */
    break;
    case 48:

    /* "cytimes/utils.pxd":383
 *             return -1  # exit: invalid
 *     elif ch1 == "0":
 *         if not "1" <= ch2 <= "9":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "3":
 */
    __pyx_t_3 = (49 <= __pyx_v_ch2);
    if (__pyx_t_3) {
      __pyx_t_3 = (__pyx_v_ch2 <= 57);
    }
    __pyx_t_1 = (!__pyx_t_3);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":384
 *     elif ch1 == "0":
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     elif ch1 == "3":
 *         if not ch2 in ("0", "1"):
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":383
 *             return -1  # exit: invalid
 *     elif ch1 == "0":
 *         if not "1" <= ch2 <= "9":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "3":
 */
    }

    /* "cytimes/utils.pxd":382
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 *     elif ch1 == "0":             # <<<<<<<<<<<<<<
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid
 */
    break;
    case 51:

    /* "cytimes/utils.pxd":386
 *             return -1  # exit: invalid
 *     elif ch1 == "3":
 *         if not ch2 in ("0", "1"):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     else:
 */
    switch (__pyx_v_ch2) {
      case 48:
      case 49:
      __pyx_t_1 = 0;
      break;
      default:
      __pyx_t_1 = 1;
      break;
    }
    __pyx_t_3 = __pyx_t_1;
    if (__pyx_t_3) {

      /* "cytimes/utils.pxd":387
 *     elif ch1 == "3":
 *         if not ch2 in ("0", "1"):
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     else:
 *         return -1  # exit: invalid
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":386
 *             return -1  # exit: invalid
 *     elif ch1 == "3":
 *         if not ch2 in ("0", "1"):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     else:
 */
    }

    /* "cytimes/utils.pxd":385
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid
 *     elif ch1 == "3":             # <<<<<<<<<<<<<<
 *         if not ch2 in ("0", "1"):
 *             return -1  # exit: invalid
 */
    break;
    default:

    /* "cytimes/utils.pxd":389
 *             return -1  # exit: invalid
 *     else:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 */
    __pyx_r = -1;
    goto __pyx_L0;
    break;
  }

  /* "cytimes/utils.pxd":391
 *         return -1  # exit: invalid
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2             # <<<<<<<<<<<<<<
 *     buffer[2] = 0  # null-term
 * 
 */
  __pyx_t_2 = __pyx_v_ch1;
  __pyx_t_4 = __pyx_v_ch2;
  (__pyx_v_buffer[0]) = __pyx_t_2;
  (__pyx_v_buffer[1]) = __pyx_t_4;

  /* "cytimes/utils.pxd":392
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 *     buffer[2] = 0  # null-term             # <<<<<<<<<<<<<<
 * 
 *     # Convert to integer
 */
  (__pyx_v_buffer[2]) = 0;

  /* "cytimes/utils.pxd":395
 * 
 *     # Convert to integer
 *     return strtoll(buffer, NULL, 10)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_isoweek(str data, Py_ssize_t pos, Py_ssize_t size) except -2:
 */
  __pyx_r = strtoll(__pyx_v_buffer, NULL, 10);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":355
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isoday(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse ISO format day component (DD) from a string,
 *     returns `-1` for invalid ISO days `<'int'>`.
 */

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

/* "cytimes/utils.pxd":397
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isoweek(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Prase an ISO format week number component (WW) from a string,
 *     returns `-1` for invalid ISO week number `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isoweek(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  char __pyx_v_buffer[3];
  Py_UCS4 __pyx_v_ch1;
  Py_UCS4 __pyx_v_ch2;
  int __pyx_r;
  int __pyx_t_1;
  Py_UCS4 __pyx_t_2;
  int __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":412
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  __pyx_t_1 = (__pyx_v_size <= 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":413
 *     # Validate
 *     if size <= 0:
 *         size = str_len(data)             # <<<<<<<<<<<<<<
 *     if size - pos < 2:
 *         return -1  # exit: invalid
 */
    __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_data);

    /* "cytimes/utils.pxd":412
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  }

  /* "cytimes/utils.pxd":414
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  __pyx_t_1 = ((__pyx_v_size - __pyx_v_pos) < 2);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":415
 *         size = str_len(data)
 *     if size - pos < 2:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 * 
 *     # Parse values
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":414
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  }

  /* "cytimes/utils.pxd":419
 *     # Parse values
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)             # <<<<<<<<<<<<<<
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if "1" <= ch1 <= "4":
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, __pyx_v_pos); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(0, 419, __pyx_L1_error)
  __pyx_v_ch1 = __pyx_t_2;

  /* "cytimes/utils.pxd":420
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)             # <<<<<<<<<<<<<<
 *     if "1" <= ch1 <= "4":
 *         if not is_ascii_digit(ch2):
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, (__pyx_v_pos + 1)); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(0, 420, __pyx_L1_error)
  __pyx_v_ch2 = __pyx_t_2;

  /* "cytimes/utils.pxd":421
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if "1" <= ch1 <= "4":             # <<<<<<<<<<<<<<
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 */
  __pyx_t_1 = (49 <= __pyx_v_ch1);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_ch1 <= 52);
  }
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":422
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if "1" <= ch1 <= "4":
 *         if not is_ascii_digit(ch2):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "0":
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_ascii_digit(__pyx_v_ch2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 422, __pyx_L1_error)
    __pyx_t_3 = (!__pyx_t_1);
    if (__pyx_t_3) {

      /* "cytimes/utils.pxd":423
 *     if "1" <= ch1 <= "4":
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     elif ch1 == "0":
 *         if not "1" <= ch2 <= "9":
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":422
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if "1" <= ch1 <= "4":
 *         if not is_ascii_digit(ch2):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "0":
 */
    }

    /* "cytimes/utils.pxd":421
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if "1" <= ch1 <= "4":             # <<<<<<<<<<<<<<
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 */
    goto __pyx_L5;
  }

  /* "cytimes/utils.pxd":424
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 *     elif ch1 == "0":             # <<<<<<<<<<<<<<
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid
 */
  __pyx_t_3 = (__pyx_v_ch1 == 48);
  if (__pyx_t_3) {

    /* "cytimes/utils.pxd":425
 *             return -1  # exit: invalid
 *     elif ch1 == "0":
 *         if not "1" <= ch2 <= "9":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "5":
 */
    __pyx_t_3 = (49 <= __pyx_v_ch2);
    if (__pyx_t_3) {
      __pyx_t_3 = (__pyx_v_ch2 <= 57);
    }
    __pyx_t_1 = (!__pyx_t_3);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":426
 *     elif ch1 == "0":
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     elif ch1 == "5":
 *         if not "0" <= ch2 <= "3":
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":425
 *             return -1  # exit: invalid
 *     elif ch1 == "0":
 *         if not "1" <= ch2 <= "9":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "5":
 */
    }

    /* "cytimes/utils.pxd":424
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 *     elif ch1 == "0":             # <<<<<<<<<<<<<<
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid
 */
    goto __pyx_L5;
  }

  /* "cytimes/utils.pxd":427
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid
 *     elif ch1 == "5":             # <<<<<<<<<<<<<<
 *         if not "0" <= ch2 <= "3":
 *             return -1  # exit: invalid
 */
  __pyx_t_1 = (__pyx_v_ch1 == 53);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":428
 *             return -1  # exit: invalid
 *     elif ch1 == "5":
 *         if not "0" <= ch2 <= "3":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     else:
 */
    __pyx_t_1 = (48 <= __pyx_v_ch2);
    if (__pyx_t_1) {
      __pyx_t_1 = (__pyx_v_ch2 <= 51);
    }
    __pyx_t_3 = (!__pyx_t_1);
    if (__pyx_t_3) {

      /* "cytimes/utils.pxd":429
 *     elif ch1 == "5":
 *         if not "0" <= ch2 <= "3":
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     else:
 *         return -1  # exit: invalid
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":428
 *             return -1  # exit: invalid
 *     elif ch1 == "5":
 *         if not "0" <= ch2 <= "3":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     else:
 */
    }

    /* "cytimes/utils.pxd":427
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid
 *     elif ch1 == "5":             # <<<<<<<<<<<<<<
 *         if not "0" <= ch2 <= "3":
 *             return -1  # exit: invalid
 */
    goto __pyx_L5;
  }

  /* "cytimes/utils.pxd":431
 *             return -1  # exit: invalid
 *     else:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 */
  /*else*/ {
    __pyx_r = -1;
    goto __pyx_L0;
  }
  __pyx_L5:;

  /* "cytimes/utils.pxd":433
 *         return -1  # exit: invalid
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2             # <<<<<<<<<<<<<<
 *     buffer[2] = 0  # null-term
 * 
 */
  __pyx_t_2 = __pyx_v_ch1;
  __pyx_t_4 = __pyx_v_ch2;
  (__pyx_v_buffer[0]) = __pyx_t_2;
  (__pyx_v_buffer[1]) = __pyx_t_4;

  /* "cytimes/utils.pxd":434
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 *     buffer[2] = 0  # null-term             # <<<<<<<<<<<<<<
 * 
 *     # Convert to integer
 */
  (__pyx_v_buffer[2]) = 0;

  /* "cytimes/utils.pxd":437
 * 
 *     # Convert to integer
 *     return strtoll(buffer, NULL, 10)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_isoweekday(str data, Py_ssize_t pos, Py_ssize_t size) except -2:
 */
  __pyx_r = strtoll(__pyx_v_buffer, NULL, 10);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":397
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isoweek(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Prase an ISO format week number component (WW) from a string,
 *     returns `-1` for invalid ISO week number `<'int'>`.
 */

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

/* "cytimes/utils.pxd":439
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isoweekday(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Prase an ISO format weekday component (D) from a string,
 *     returns `-1` for invalid ISO weekdays `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isoweekday(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  Py_UCS4 __pyx_v_ch;
  int __pyx_r;
  int __pyx_t_1;
  Py_UCS4 __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":453
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 1:
 */
  __pyx_t_1 = (__pyx_v_size <= 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":454
 *     # Validate
 *     if size <= 0:
 *         size = str_len(data)             # <<<<<<<<<<<<<<
 *     if size - pos < 1:
 *         return -1  # exit: invalid
 */
    __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_data);

    /* "cytimes/utils.pxd":453
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 1:
 */
  }

  /* "cytimes/utils.pxd":455
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 1:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  __pyx_t_1 = ((__pyx_v_size - __pyx_v_pos) < 1);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":456
 *         size = str_len(data)
 *     if size - pos < 1:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 * 
 *     # Parse values
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":455
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 1:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  }

  /* "cytimes/utils.pxd":459
 * 
 *     # Parse values
 *     cdef Py_UCS4 ch = str_read(data, pos)             # <<<<<<<<<<<<<<
 *     if not "1" <= ch <= "7":
 *         return -1  # exit: invalid
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, __pyx_v_pos); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(0, 459, __pyx_L1_error)
  __pyx_v_ch = __pyx_t_2;

  /* "cytimes/utils.pxd":460
 *     # Parse values
 *     cdef Py_UCS4 ch = str_read(data, pos)
 *     if not "1" <= ch <= "7":             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 *     return ord(ch) - 48
 */
  __pyx_t_1 = (49 <= __pyx_v_ch);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_ch <= 55);
  }
  __pyx_t_3 = (!__pyx_t_1);
  if (__pyx_t_3) {

    /* "cytimes/utils.pxd":461
 *     cdef Py_UCS4 ch = str_read(data, pos)
 *     if not "1" <= ch <= "7":
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     return ord(ch) - 48
 * 
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":460
 *     # Parse values
 *     cdef Py_UCS4 ch = str_read(data, pos)
 *     if not "1" <= ch <= "7":             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 *     return ord(ch) - 48
 */
  }

  /* "cytimes/utils.pxd":462
 *     if not "1" <= ch <= "7":
 *         return -1  # exit: invalid
 *     return ord(ch) - 48             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_isoyearday(str data, Py_ssize_t pos, Py_ssize_t size) except -2:
 */
  __pyx_r = (__Pyx_long_cast(__pyx_v_ch) - 48);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":439
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isoweekday(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Prase an ISO format weekday component (D) from a string,
 *     returns `-1` for invalid ISO weekdays `<'int'>`.
 */

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

/* "cytimes/utils.pxd":464
 *     return ord(ch) - 48
 * 
 * cdef inline int parse_isoyearday(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Prase an ISO format day of the year component (DDD) from a string,
 *     returns `-1` for invalid ISO day of the year `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isoyearday(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  char __pyx_v_buffer[4];
  Py_UCS4 __pyx_v_ch;
  Py_ssize_t __pyx_v_i;
  int __pyx_v_days;
  int __pyx_r;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":479
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 3:
 */
  __pyx_t_1 = (__pyx_v_size <= 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":480
 *     # Validate
 *     if size <= 0:
 *         size = str_len(data)             # <<<<<<<<<<<<<<
 *     if size - pos < 3:
 *         return -1  # exit: invalid
 */
    __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_data);

    /* "cytimes/utils.pxd":479
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 3:
 */
  }

  /* "cytimes/utils.pxd":481
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 3:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  __pyx_t_1 = ((__pyx_v_size - __pyx_v_pos) < 3);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":482
 *         size = str_len(data)
 *     if size - pos < 3:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 * 
 *     # Parse values
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":481
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 3:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  }

  /* "cytimes/utils.pxd":488
 *     cdef Py_UCS4 ch
 *     cdef Py_ssize_t i
 *     for i in range(3):             # <<<<<<<<<<<<<<
 *         ch = str_read(data, pos + i)
 *         if not is_ascii_digit(ch):
 */
  for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "cytimes/utils.pxd":489
 *     cdef Py_ssize_t i
 *     for i in range(3):
 *         ch = str_read(data, pos + i)             # <<<<<<<<<<<<<<
 *         if not is_ascii_digit(ch):
 *             return -1  # exit: invalid
 */
    __pyx_t_3 = PyUnicode_ReadChar(__pyx_v_data, (__pyx_v_pos + __pyx_v_i)); if (unlikely(__pyx_t_3 == ((Py_UCS4)-1))) __PYX_ERR(0, 489, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_3;

    /* "cytimes/utils.pxd":490
 *     for i in range(3):
 *         ch = str_read(data, pos + i)
 *         if not is_ascii_digit(ch):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *         buffer[i] = ch
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_ascii_digit(__pyx_v_ch); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 490, __pyx_L1_error)
    __pyx_t_4 = (!__pyx_t_1);
    if (__pyx_t_4) {

      /* "cytimes/utils.pxd":491
 *         ch = str_read(data, pos + i)
 *         if not is_ascii_digit(ch):
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *         buffer[i] = ch
 *     # . null-terminate
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":490
 *     for i in range(3):
 *         ch = str_read(data, pos + i)
 *         if not is_ascii_digit(ch):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *         buffer[i] = ch
 */
    }

    /* "cytimes/utils.pxd":492
 *         if not is_ascii_digit(ch):
 *             return -1  # exit: invalid
 *         buffer[i] = ch             # <<<<<<<<<<<<<<
 *     # . null-terminate
 *     buffer[3] = 0
 */
    (__pyx_v_buffer[__pyx_v_i]) = __pyx_v_ch;
  }

  /* "cytimes/utils.pxd":494
 *         buffer[i] = ch
 *     # . null-terminate
 *     buffer[3] = 0             # <<<<<<<<<<<<<<
 * 
 *     # Convert to integer
 */
  (__pyx_v_buffer[3]) = 0;

  /* "cytimes/utils.pxd":497
 * 
 *     # Convert to integer
 *     cdef int days = strtoll(buffer, NULL, 10)             # <<<<<<<<<<<<<<
 *     return days if 1 <= days <= 366 else -1
 * 
 */
  __pyx_v_days = strtoll(__pyx_v_buffer, NULL, 10);

  /* "cytimes/utils.pxd":498
 *     # Convert to integer
 *     cdef int days = strtoll(buffer, NULL, 10)
 *     return days if 1 <= days <= 366 else -1             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_isohour(str data, Py_ssize_t pos, Py_ssize_t size) except -2:
 */
  __pyx_t_4 = (1 <= __pyx_v_days);
  if (__pyx_t_4) {
    __pyx_t_4 = (__pyx_v_days <= 0x16E);
  }
  if (__pyx_t_4) {
    __pyx_t_5 = __pyx_v_days;
  } else {
    __pyx_t_5 = -1;
  }
  __pyx_r = __pyx_t_5;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":464
 *     return ord(ch) - 48
 * 
 * cdef inline int parse_isoyearday(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Prase an ISO format day of the year component (DDD) from a string,
 *     returns `-1` for invalid ISO day of the year `<'int'>`.
 */

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

/* "cytimes/utils.pxd":500
 *     return days if 1 <= days <= 366 else -1
 * 
 * cdef inline int parse_isohour(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse an ISO format hour (HH) component from a string,
 *     returns `-1` for invalid ISO hours `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isohour(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  char __pyx_v_buffer[3];
  Py_UCS4 __pyx_v_ch1;
  Py_UCS4 __pyx_v_ch2;
  int __pyx_r;
  int __pyx_t_1;
  Py_UCS4 __pyx_t_2;
  int __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":515
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  __pyx_t_1 = (__pyx_v_size <= 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":516
 *     # Validate
 *     if size <= 0:
 *         size = str_len(data)             # <<<<<<<<<<<<<<
 *     if size - pos < 2:
 *         return -1  # exit: invalid
 */
    __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_data);

    /* "cytimes/utils.pxd":515
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  }

  /* "cytimes/utils.pxd":517
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  __pyx_t_1 = ((__pyx_v_size - __pyx_v_pos) < 2);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":518
 *         size = str_len(data)
 *     if size - pos < 2:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 * 
 *     # Parse values
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":517
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  }

  /* "cytimes/utils.pxd":522
 *     # Parse values
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)             # <<<<<<<<<<<<<<
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("0", "1"):
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, __pyx_v_pos); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(0, 522, __pyx_L1_error)
  __pyx_v_ch1 = __pyx_t_2;

  /* "cytimes/utils.pxd":523
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)             # <<<<<<<<<<<<<<
 *     if ch1 in ("0", "1"):
 *         if not is_ascii_digit(ch2):
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, (__pyx_v_pos + 1)); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(0, 523, __pyx_L1_error)
  __pyx_v_ch2 = __pyx_t_2;

  /* "cytimes/utils.pxd":524
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("0", "1"):             # <<<<<<<<<<<<<<
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 */
  switch (__pyx_v_ch1) {
    case 48:
    case 49:

    /* "cytimes/utils.pxd":525
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("0", "1"):
 *         if not is_ascii_digit(ch2):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "2":
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_ascii_digit(__pyx_v_ch2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 525, __pyx_L1_error)
    __pyx_t_3 = (!__pyx_t_1);
    if (__pyx_t_3) {

      /* "cytimes/utils.pxd":526
 *     if ch1 in ("0", "1"):
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     elif ch1 == "2":
 *         if not "0" <= ch2 <= "3":
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":525
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("0", "1"):
 *         if not is_ascii_digit(ch2):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "2":
 */
    }

    /* "cytimes/utils.pxd":524
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("0", "1"):             # <<<<<<<<<<<<<<
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 */
    break;
    case 50:

    /* "cytimes/utils.pxd":528
 *             return -1  # exit: invalid
 *     elif ch1 == "2":
 *         if not "0" <= ch2 <= "3":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     else:
 */
    __pyx_t_3 = (48 <= __pyx_v_ch2);
    if (__pyx_t_3) {
      __pyx_t_3 = (__pyx_v_ch2 <= 51);
    }
    __pyx_t_1 = (!__pyx_t_3);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":529
 *     elif ch1 == "2":
 *         if not "0" <= ch2 <= "3":
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     else:
 *         return -1  # exit: invalid
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":528
 *             return -1  # exit: invalid
 *     elif ch1 == "2":
 *         if not "0" <= ch2 <= "3":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     else:
 */
    }

    /* "cytimes/utils.pxd":527
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 *     elif ch1 == "2":             # <<<<<<<<<<<<<<
 *         if not "0" <= ch2 <= "3":
 *             return -1  # exit: invalid
 */
    break;
    default:

    /* "cytimes/utils.pxd":531
 *             return -1  # exit: invalid
 *     else:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 */
    __pyx_r = -1;
    goto __pyx_L0;
    break;
  }

  /* "cytimes/utils.pxd":533
 *         return -1  # exit: invalid
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2             # <<<<<<<<<<<<<<
 *     buffer[2] = 0  # null-term
 * 
 */
  __pyx_t_2 = __pyx_v_ch1;
  __pyx_t_4 = __pyx_v_ch2;
  (__pyx_v_buffer[0]) = __pyx_t_2;
  (__pyx_v_buffer[1]) = __pyx_t_4;

  /* "cytimes/utils.pxd":534
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 *     buffer[2] = 0  # null-term             # <<<<<<<<<<<<<<
 * 
 *     # Convert to integer
 */
  (__pyx_v_buffer[2]) = 0;

  /* "cytimes/utils.pxd":537
 * 
 *     # Convert to integer
 *     return strtoll(buffer, NULL, 10)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_isominute(str data, Py_ssize_t pos, Py_ssize_t size) except -2:
 */
  __pyx_r = strtoll(__pyx_v_buffer, NULL, 10);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":500
 *     return days if 1 <= days <= 366 else -1
 * 
 * cdef inline int parse_isohour(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse an ISO format hour (HH) component from a string,
 *     returns `-1` for invalid ISO hours `<'int'>`.
 */

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

/* "cytimes/utils.pxd":539
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isominute(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse an ISO format minute (MM) component from a string,
 *     returns `-1` for invalid ISO minutes `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isominute(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  char __pyx_v_buffer[3];
  Py_UCS4 __pyx_v_ch1;
  Py_UCS4 __pyx_v_ch2;
  int __pyx_r;
  int __pyx_t_1;
  Py_UCS4 __pyx_t_2;
  int __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":554
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  __pyx_t_1 = (__pyx_v_size <= 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":555
 *     # Validate
 *     if size <= 0:
 *         size = str_len(data)             # <<<<<<<<<<<<<<
 *     if size - pos < 2:
 *         return -1  # exit: invalid
 */
    __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_data);

    /* "cytimes/utils.pxd":554
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  }

  /* "cytimes/utils.pxd":556
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  __pyx_t_1 = ((__pyx_v_size - __pyx_v_pos) < 2);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":557
 *         size = str_len(data)
 *     if size - pos < 2:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 * 
 *     # Parse values
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":556
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  }

  /* "cytimes/utils.pxd":561
 *     # Parse values
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)             # <<<<<<<<<<<<<<
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if not "0" <= ch1 <= "5":
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, __pyx_v_pos); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(0, 561, __pyx_L1_error)
  __pyx_v_ch1 = __pyx_t_2;

  /* "cytimes/utils.pxd":562
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)             # <<<<<<<<<<<<<<
 *     if not "0" <= ch1 <= "5":
 *         return -1  # exit: invalid
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, (__pyx_v_pos + 1)); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(0, 562, __pyx_L1_error)
  __pyx_v_ch2 = __pyx_t_2;

  /* "cytimes/utils.pxd":563
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if not "0" <= ch1 <= "5":             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 *     if not is_ascii_digit(ch2):
 */
  __pyx_t_1 = (48 <= __pyx_v_ch1);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_ch1 <= 53);
  }
  __pyx_t_3 = (!__pyx_t_1);
  if (__pyx_t_3) {

    /* "cytimes/utils.pxd":564
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if not "0" <= ch1 <= "5":
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     if not is_ascii_digit(ch2):
 *         return -1  # exit: invalid
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":563
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if not "0" <= ch1 <= "5":             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 *     if not is_ascii_digit(ch2):
 */
  }

  /* "cytimes/utils.pxd":565
 *     if not "0" <= ch1 <= "5":
 *         return -1  # exit: invalid
 *     if not is_ascii_digit(ch2):             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 *     # . assign values
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_is_ascii_digit(__pyx_v_ch2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 565, __pyx_L1_error)
  __pyx_t_1 = (!__pyx_t_3);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":566
 *         return -1  # exit: invalid
 *     if not is_ascii_digit(ch2):
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":565
 *     if not "0" <= ch1 <= "5":
 *         return -1  # exit: invalid
 *     if not is_ascii_digit(ch2):             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 *     # . assign values
 */
  }

  /* "cytimes/utils.pxd":568
 *         return -1  # exit: invalid
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2             # <<<<<<<<<<<<<<
 *     buffer[2] = 0  # null-term
 * 
 */
  __pyx_t_2 = __pyx_v_ch1;
  __pyx_t_4 = __pyx_v_ch2;
  (__pyx_v_buffer[0]) = __pyx_t_2;
  (__pyx_v_buffer[1]) = __pyx_t_4;

  /* "cytimes/utils.pxd":569
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 *     buffer[2] = 0  # null-term             # <<<<<<<<<<<<<<
 * 
 *     # Convert to integer
 */
  (__pyx_v_buffer[2]) = 0;

  /* "cytimes/utils.pxd":572
 * 
 *     # Convert to integer
 *     return strtoll(buffer, NULL, 10)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_isosecond(str data, Py_ssize_t pos, Py_ssize_t size) except -2:
 */
  __pyx_r = strtoll(__pyx_v_buffer, NULL, 10);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":539
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isominute(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse an ISO format minute (MM) component from a string,
 *     returns `-1` for invalid ISO minutes `<'int'>`.
 */

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

/* "cytimes/utils.pxd":574
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isosecond(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse an ISO format second (SS) component from a string,
 *     returns `-1` for invalid ISO seconds `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isosecond(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":588
 *         If 'size <= 0', the function computes the size of the 'data' string internally.
 *     """
 *     return parse_isominute(data, pos, size)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_isofraction(str data, Py_ssize_t pos, Py_ssize_t size) except -2:
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_parse_isominute(__pyx_v_data, __pyx_v_pos, __pyx_v_size); if (unlikely(__pyx_t_1 == ((int)-2))) __PYX_ERR(0, 588, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":574
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isosecond(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse an ISO format second (SS) component from a string,
 *     returns `-1` for invalid ISO seconds `<'int'>`.
 */

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

/* "cytimes/utils.pxd":590
 *     return parse_isominute(data, pos, size)
 * 
 * cdef inline int parse_isofraction(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse an ISO fractional time component (fractions of a second) from a string,
 *     returns `-1` for invalid ISO fraction `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isofraction(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  char __pyx_v_buffer[7];
  Py_UCS4 __pyx_v_ch;
  Py_ssize_t __pyx_v_idx;
  Py_ssize_t __pyx_v_i;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":605
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 * 
 */
  __pyx_t_1 = (__pyx_v_size <= 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":606
 *     # Validate
 *     if size <= 0:
 *         size = str_len(data)             # <<<<<<<<<<<<<<
 * 
 *     # Parse value
 */
    __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_data);

    /* "cytimes/utils.pxd":605
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 * 
 */
  }

  /* "cytimes/utils.pxd":611
 *     cdef char buffer[7]
 *     cdef Py_UCS4 ch
 *     cdef Py_ssize_t idx = 0             # <<<<<<<<<<<<<<
 *     while pos < size and idx < 6:
 *         ch = str_read(data, pos)
 */
  __pyx_v_idx = 0;

  /* "cytimes/utils.pxd":612
 *     cdef Py_UCS4 ch
 *     cdef Py_ssize_t idx = 0
 *     while pos < size and idx < 6:             # <<<<<<<<<<<<<<
 *         ch = str_read(data, pos)
 *         if not is_ascii_digit(ch):
 */
  while (1) {
    __pyx_t_2 = (__pyx_v_pos < __pyx_v_size);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_idx < 6);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L6_bool_binop_done:;
    if (!__pyx_t_1) break;

    /* "cytimes/utils.pxd":613
 *     cdef Py_ssize_t idx = 0
 *     while pos < size and idx < 6:
 *         ch = str_read(data, pos)             # <<<<<<<<<<<<<<
 *         if not is_ascii_digit(ch):
 *             break
 */
    __pyx_t_3 = PyUnicode_ReadChar(__pyx_v_data, __pyx_v_pos); if (unlikely(__pyx_t_3 == ((Py_UCS4)-1))) __PYX_ERR(0, 613, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_3;

    /* "cytimes/utils.pxd":614
 *     while pos < size and idx < 6:
 *         ch = str_read(data, pos)
 *         if not is_ascii_digit(ch):             # <<<<<<<<<<<<<<
 *             break
 *         buffer[idx], pos, idx = ch, pos + 1, idx + 1
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_ascii_digit(__pyx_v_ch); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 614, __pyx_L1_error)
    __pyx_t_2 = (!__pyx_t_1);
    if (__pyx_t_2) {

      /* "cytimes/utils.pxd":615
 *         ch = str_read(data, pos)
 *         if not is_ascii_digit(ch):
 *             break             # <<<<<<<<<<<<<<
 *         buffer[idx], pos, idx = ch, pos + 1, idx + 1
 *     # . invalid
 */
      goto __pyx_L5_break;

      /* "cytimes/utils.pxd":614
 *     while pos < size and idx < 6:
 *         ch = str_read(data, pos)
 *         if not is_ascii_digit(ch):             # <<<<<<<<<<<<<<
 *             break
 *         buffer[idx], pos, idx = ch, pos + 1, idx + 1
 */
    }

    /* "cytimes/utils.pxd":616
 *         if not is_ascii_digit(ch):
 *             break
 *         buffer[idx], pos, idx = ch, pos + 1, idx + 1             # <<<<<<<<<<<<<<
 *     # . invalid
 *     if idx == 0:
 */
    __pyx_t_3 = __pyx_v_ch;
    __pyx_t_4 = (__pyx_v_pos + 1);
    __pyx_t_5 = (__pyx_v_idx + 1);
    (__pyx_v_buffer[__pyx_v_idx]) = __pyx_t_3;
    __pyx_v_pos = __pyx_t_4;
    __pyx_v_idx = __pyx_t_5;
  }
  __pyx_L5_break:;

  /* "cytimes/utils.pxd":618
 *         buffer[idx], pos, idx = ch, pos + 1, idx + 1
 *     # . invalid
 *     if idx == 0:             # <<<<<<<<<<<<<<
 *         return -1  # exit:
 *     # . compensate missing digits
 */
  __pyx_t_2 = (__pyx_v_idx == 0);
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":619
 *     # . invalid
 *     if idx == 0:
 *         return -1  # exit:             # <<<<<<<<<<<<<<
 *     # . compensate missing digits
 *     if idx < 6:
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":618
 *         buffer[idx], pos, idx = ch, pos + 1, idx + 1
 *     # . invalid
 *     if idx == 0:             # <<<<<<<<<<<<<<
 *         return -1  # exit:
 *     # . compensate missing digits
 */
  }

  /* "cytimes/utils.pxd":621
 *         return -1  # exit:
 *     # . compensate missing digits
 *     if idx < 6:             # <<<<<<<<<<<<<<
 *         ch = "0"
 *         for i in range(idx, 6):
 */
  __pyx_t_2 = (__pyx_v_idx < 6);
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":622
 *     # . compensate missing digits
 *     if idx < 6:
 *         ch = "0"             # <<<<<<<<<<<<<<
 *         for i in range(idx, 6):
 *             buffer[i] = ch
 */
    __pyx_v_ch = 48;

    /* "cytimes/utils.pxd":623
 *     if idx < 6:
 *         ch = "0"
 *         for i in range(idx, 6):             # <<<<<<<<<<<<<<
 *             buffer[i] = ch
 *     # . null-terminate
 */
    for (__pyx_t_5 = __pyx_v_idx; __pyx_t_5 < 6; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "cytimes/utils.pxd":624
 *         ch = "0"
 *         for i in range(idx, 6):
 *             buffer[i] = ch             # <<<<<<<<<<<<<<
 *     # . null-terminate
 *     buffer[6] = 0
 */
      (__pyx_v_buffer[__pyx_v_i]) = __pyx_v_ch;
    }

    /* "cytimes/utils.pxd":621
 *         return -1  # exit:
 *     # . compensate missing digits
 *     if idx < 6:             # <<<<<<<<<<<<<<
 *         ch = "0"
 *         for i in range(idx, 6):
 */
  }

  /* "cytimes/utils.pxd":626
 *             buffer[i] = ch
 *     # . null-terminate
 *     buffer[6] = 0             # <<<<<<<<<<<<<<
 * 
 *     # Convert to integer
 */
  (__pyx_v_buffer[6]) = 0;

  /* "cytimes/utils.pxd":629
 * 
 *     # Convert to integer
 *     return strtoll(buffer, NULL, 10)             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long slice_to_uint(str data, Py_ssize_t start, Py_ssize_t size) except -2:
 */
  __pyx_r = strtoll(__pyx_v_buffer, NULL, 10);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":590
 *     return parse_isominute(data, pos, size)
 * 
 * cdef inline int parse_isofraction(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse an ISO fractional time component (fractions of a second) from a string,
 *     returns `-1` for invalid ISO fraction `<'int'>`.
 */

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

/* "cytimes/utils.pxd":631
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline long long slice_to_uint(str data, Py_ssize_t start, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Slice a substring from a string and convert to an unsigned integer `<'int'>`.
 * 
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_slice_to_uint(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_size) {
  char *__pyx_v_buffer;
  Py_ssize_t __pyx_v_i;
  Py_UCS4 __pyx_v_ch;
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PY_LONG_LONG __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("slice_to_uint", 1);

  /* "cytimes/utils.pxd":644
 *     """
 *     # Allocate memory
 *     cdef char* buffer = <char*> malloc(size + 1)             # <<<<<<<<<<<<<<
 *     if buffer == NULL:
 *         raise MemoryError("failed to allocate memory for string slice.")
 */
  __pyx_v_buffer = ((char *)malloc((__pyx_v_size + 1)));

  /* "cytimes/utils.pxd":645
 *     # Allocate memory
 *     cdef char* buffer = <char*> malloc(size + 1)
 *     if buffer == NULL:             # <<<<<<<<<<<<<<
 *         raise MemoryError("failed to allocate memory for string slice.")
 * 
 */
  __pyx_t_1 = (__pyx_v_buffer == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":646
 *     cdef char* buffer = <char*> malloc(size + 1)
 *     if buffer == NULL:
 *         raise MemoryError("failed to allocate memory for string slice.")             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t i
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 646, __pyx_L1_error)

    /* "cytimes/utils.pxd":645
 *     # Allocate memory
 *     cdef char* buffer = <char*> malloc(size + 1)
 *     if buffer == NULL:             # <<<<<<<<<<<<<<
 *         raise MemoryError("failed to allocate memory for string slice.")
 * 
 */
  }

  /* "cytimes/utils.pxd":650
 *     cdef Py_ssize_t i
 *     cdef Py_UCS4 ch
 *     try:             # <<<<<<<<<<<<<<
 *         # Parse value
 *         for i in range(size):
 */
  /*try:*/ {

    /* "cytimes/utils.pxd":652
 *     try:
 *         # Parse value
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             ch = str_read(data, start + i)
 *             if not is_ascii_digit(ch):
 */
    __pyx_t_3 = __pyx_v_size;
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "cytimes/utils.pxd":653
 *         # Parse value
 *         for i in range(size):
 *             ch = str_read(data, start + i)             # <<<<<<<<<<<<<<
 *             if not is_ascii_digit(ch):
 *                 raise ValueError("invalid character '%s' as an integer." % str_chr(ch))
 */
      __pyx_t_6 = PyUnicode_ReadChar(__pyx_v_data, (__pyx_v_start + __pyx_v_i)); if (unlikely(__pyx_t_6 == ((Py_UCS4)-1))) __PYX_ERR(0, 653, __pyx_L5_error)
      __pyx_v_ch = __pyx_t_6;

      /* "cytimes/utils.pxd":654
 *         for i in range(size):
 *             ch = str_read(data, start + i)
 *             if not is_ascii_digit(ch):             # <<<<<<<<<<<<<<
 *                 raise ValueError("invalid character '%s' as an integer." % str_chr(ch))
 *             buffer[i] = ch
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_ascii_digit(__pyx_v_ch); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 654, __pyx_L5_error)
      __pyx_t_7 = (!__pyx_t_1);
      if (unlikely(__pyx_t_7)) {

        /* "cytimes/utils.pxd":655
 *             ch = str_read(data, start + i)
 *             if not is_ascii_digit(ch):
 *                 raise ValueError("invalid character '%s' as an integer." % str_chr(ch))             # <<<<<<<<<<<<<<
 *             buffer[i] = ch
 *         # . null-terminate
 */
        __pyx_t_2 = PyUnicode_FromOrdinal(__pyx_v_ch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_invalid_character_s_as_an_intege, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 655, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 655, __pyx_L5_error)

        /* "cytimes/utils.pxd":654
 *         for i in range(size):
 *             ch = str_read(data, start + i)
 *             if not is_ascii_digit(ch):             # <<<<<<<<<<<<<<
 *                 raise ValueError("invalid character '%s' as an integer." % str_chr(ch))
 *             buffer[i] = ch
 */
      }

      /* "cytimes/utils.pxd":656
 *             if not is_ascii_digit(ch):
 *                 raise ValueError("invalid character '%s' as an integer." % str_chr(ch))
 *             buffer[i] = ch             # <<<<<<<<<<<<<<
 *         # . null-terminate
 *         buffer[size] = 0
 */
      (__pyx_v_buffer[__pyx_v_i]) = __pyx_v_ch;
    }

    /* "cytimes/utils.pxd":658
 *             buffer[i] = ch
 *         # . null-terminate
 *         buffer[size] = 0             # <<<<<<<<<<<<<<
 * 
 *         # Convert to integer
 */
    (__pyx_v_buffer[__pyx_v_size]) = 0;

    /* "cytimes/utils.pxd":661
 * 
 *         # Convert to integer
 *         return strtoll(buffer, NULL, 10)             # <<<<<<<<<<<<<<
 *     finally:
 *         free(buffer)
 */
    __pyx_r = strtoll(__pyx_v_buffer, NULL, 10);
    goto __pyx_L4_return;
  }

  /* "cytimes/utils.pxd":663
 *         return strtoll(buffer, NULL, 10)
 *     finally:
 *         free(buffer)             # <<<<<<<<<<<<<<
 * 
 * # Time -------------------------------------------------------------------------------------------------
 */
  /*finally:*/ {
    __pyx_L5_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
      {
        free(__pyx_v_buffer);
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
      goto __pyx_L1_error;
    }
    __pyx_L4_return: {
      __pyx_t_18 = __pyx_r;
      free(__pyx_v_buffer);
      __pyx_r = __pyx_t_18;
      goto __pyx_L0;
    }
  }

  /* "cytimes/utils.pxd":631
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline long long slice_to_uint(str data, Py_ssize_t start, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Slice a substring from a string and convert to an unsigned integer `<'int'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cytimes.utils.slice_to_uint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -2LL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":666
 * 
 * # Time -------------------------------------------------------------------------------------------------
 * cdef inline tm tm_gmtime(double ts) except * nogil:             # <<<<<<<<<<<<<<
 *     """Convert a timestamp to 'struct:tm' expressing UTC time `<'struct:tm'>`.
 * 
 */

static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_tm_gmtime(double __pyx_v_ts) {
  time_t __pyx_v_tic;
  struct tm *__pyx_v_t;
  struct tm __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  long __pyx_t_3;
  long __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif

  /* "cytimes/utils.pxd":673
 *     but implemented in Cython for efficiency.
 *     """
 *     cdef time_t tic = <time_t> ts             # <<<<<<<<<<<<<<
 *     cdef tm* t = libc_gmtime(&tic)
 *     if t is NULL:
 */
  __pyx_v_tic = ((time_t)__pyx_v_ts);

  /* "cytimes/utils.pxd":674
 *     """
 *     cdef time_t tic = <time_t> ts
 *     cdef tm* t = libc_gmtime(&tic)             # <<<<<<<<<<<<<<
 *     if t is NULL:
 *         _raise_from_errno()
 */
  __pyx_v_t = gmtime((&__pyx_v_tic));

  /* "cytimes/utils.pxd":675
 *     cdef time_t tic = <time_t> ts
 *     cdef tm* t = libc_gmtime(&tic)
 *     if t is NULL:             # <<<<<<<<<<<<<<
 *         _raise_from_errno()
 *     # Fix 0-based date values (and the 1900-based year).
 */
  __pyx_t_1 = (__pyx_v_t == NULL);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":676
 *     cdef tm* t = libc_gmtime(&tic)
 *     if t is NULL:
 *         _raise_from_errno()             # <<<<<<<<<<<<<<
 *     # Fix 0-based date values (and the 1900-based year).
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils__raise_from_errno(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 676, __pyx_L1_error)

    /* "cytimes/utils.pxd":675
 *     cdef time_t tic = <time_t> ts
 *     cdef tm* t = libc_gmtime(&tic)
 *     if t is NULL:             # <<<<<<<<<<<<<<
 *         _raise_from_errno()
 *     # Fix 0-based date values (and the 1900-based year).
 */
  }

  /* "cytimes/utils.pxd":679
 *     # Fix 0-based date values (and the 1900-based year).
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 *     t.tm_year += 1900             # <<<<<<<<<<<<<<
 *     t.tm_mon += 1
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds
 */
  __pyx_v_t->tm_year = (__pyx_v_t->tm_year + 0x76C);

  /* "cytimes/utils.pxd":680
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 *     t.tm_year += 1900
 *     t.tm_mon += 1             # <<<<<<<<<<<<<<
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds
 *     t.tm_wday = (t.tm_wday + 6) % 7
 */
  __pyx_v_t->tm_mon = (__pyx_v_t->tm_mon + 1);

  /* "cytimes/utils.pxd":681
 *     t.tm_year += 1900
 *     t.tm_mon += 1
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds             # <<<<<<<<<<<<<<
 *     t.tm_wday = (t.tm_wday + 6) % 7
 *     t.tm_yday += 1
 */
  __pyx_t_3 = 59;
  __pyx_t_2 = __pyx_v_t->tm_sec;
  __pyx_t_1 = (__pyx_t_3 < __pyx_t_2);
  if (__pyx_t_1) {
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_t->tm_sec = __pyx_t_4;

  /* "cytimes/utils.pxd":682
 *     t.tm_mon += 1
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds
 *     t.tm_wday = (t.tm_wday + 6) % 7             # <<<<<<<<<<<<<<
 *     t.tm_yday += 1
 *     return t[0]
 */
  __pyx_v_t->tm_wday = __Pyx_mod_long((__pyx_v_t->tm_wday + 6), 7);

  /* "cytimes/utils.pxd":683
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds
 *     t.tm_wday = (t.tm_wday + 6) % 7
 *     t.tm_yday += 1             # <<<<<<<<<<<<<<
 *     return t[0]
 * 
 */
  __pyx_v_t->tm_yday = (__pyx_v_t->tm_yday + 1);

  /* "cytimes/utils.pxd":684
 *     t.tm_wday = (t.tm_wday + 6) % 7
 *     t.tm_yday += 1
 *     return t[0]             # <<<<<<<<<<<<<<
 * 
 * cdef inline tm tm_localtime(double ts) except * nogil:
 */
  __pyx_r = (__pyx_v_t[0]);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":666
 * 
 * # Time -------------------------------------------------------------------------------------------------
 * cdef inline tm tm_gmtime(double ts) except * nogil:             # <<<<<<<<<<<<<<
 *     """Convert a timestamp to 'struct:tm' expressing UTC time `<'struct:tm'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cytimes.utils.tm_gmtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/utils.pxd":686
 *     return t[0]
 * 
 * cdef inline tm tm_localtime(double ts) except * nogil:             # <<<<<<<<<<<<<<
 *     """Convert a timestamp to 'struct:tm' expressing local time `<'struct:tm'>`.
 * 
 */

static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_tm_localtime(double __pyx_v_ts) {
  time_t __pyx_v_tic;
  struct tm *__pyx_v_t;
  struct tm __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  long __pyx_t_3;
  long __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif

  /* "cytimes/utils.pxd":693
 *     Python but implemented in Cython for efficiency.
 *     """
 *     cdef time_t tic = <time_t> ts             # <<<<<<<<<<<<<<
 *     cdef tm* t = libc_localtime(&tic)
 *     if t is NULL:
 */
  __pyx_v_tic = ((time_t)__pyx_v_ts);

  /* "cytimes/utils.pxd":694
 *     """
 *     cdef time_t tic = <time_t> ts
 *     cdef tm* t = libc_localtime(&tic)             # <<<<<<<<<<<<<<
 *     if t is NULL:
 *         _raise_from_errno()
 */
  __pyx_v_t = localtime((&__pyx_v_tic));

  /* "cytimes/utils.pxd":695
 *     cdef time_t tic = <time_t> ts
 *     cdef tm* t = libc_localtime(&tic)
 *     if t is NULL:             # <<<<<<<<<<<<<<
 *         _raise_from_errno()
 *     # Fix 0-based date values (and the 1900-based year).
 */
  __pyx_t_1 = (__pyx_v_t == NULL);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":696
 *     cdef tm* t = libc_localtime(&tic)
 *     if t is NULL:
 *         _raise_from_errno()             # <<<<<<<<<<<<<<
 *     # Fix 0-based date values (and the 1900-based year).
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils__raise_from_errno(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 696, __pyx_L1_error)

    /* "cytimes/utils.pxd":695
 *     cdef time_t tic = <time_t> ts
 *     cdef tm* t = libc_localtime(&tic)
 *     if t is NULL:             # <<<<<<<<<<<<<<
 *         _raise_from_errno()
 *     # Fix 0-based date values (and the 1900-based year).
 */
  }

  /* "cytimes/utils.pxd":699
 *     # Fix 0-based date values (and the 1900-based year).
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 *     t.tm_year += 1900             # <<<<<<<<<<<<<<
 *     t.tm_mon += 1
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds
 */
  __pyx_v_t->tm_year = (__pyx_v_t->tm_year + 0x76C);

  /* "cytimes/utils.pxd":700
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 *     t.tm_year += 1900
 *     t.tm_mon += 1             # <<<<<<<<<<<<<<
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds
 *     t.tm_wday = (t.tm_wday + 6) % 7
 */
  __pyx_v_t->tm_mon = (__pyx_v_t->tm_mon + 1);

  /* "cytimes/utils.pxd":701
 *     t.tm_year += 1900
 *     t.tm_mon += 1
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds             # <<<<<<<<<<<<<<
 *     t.tm_wday = (t.tm_wday + 6) % 7
 *     t.tm_yday += 1
 */
  __pyx_t_3 = 59;
  __pyx_t_2 = __pyx_v_t->tm_sec;
  __pyx_t_1 = (__pyx_t_3 < __pyx_t_2);
  if (__pyx_t_1) {
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_t->tm_sec = __pyx_t_4;

  /* "cytimes/utils.pxd":702
 *     t.tm_mon += 1
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds
 *     t.tm_wday = (t.tm_wday + 6) % 7             # <<<<<<<<<<<<<<
 *     t.tm_yday += 1
 *     return t[0]
 */
  __pyx_v_t->tm_wday = __Pyx_mod_long((__pyx_v_t->tm_wday + 6), 7);

  /* "cytimes/utils.pxd":703
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds
 *     t.tm_wday = (t.tm_wday + 6) % 7
 *     t.tm_yday += 1             # <<<<<<<<<<<<<<
 *     return t[0]
 * 
 */
  __pyx_v_t->tm_yday = (__pyx_v_t->tm_yday + 1);

  /* "cytimes/utils.pxd":704
 *     t.tm_wday = (t.tm_wday + 6) % 7
 *     t.tm_yday += 1
 *     return t[0]             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long ts_gmtime(double ts):
 */
  __pyx_r = (__pyx_v_t[0]);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":686
 *     return t[0]
 * 
 * cdef inline tm tm_localtime(double ts) except * nogil:             # <<<<<<<<<<<<<<
 *     """Convert a timestamp to 'struct:tm' expressing local time `<'struct:tm'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cytimes.utils.tm_localtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/utils.pxd":706
 *     return t[0]
 * 
 * cdef inline long long ts_gmtime(double ts):             # <<<<<<<<<<<<<<
 *     """Convert a timestamp to UTC seconds since the Unix Epoch `<'int'>`.
 * 
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_ts_gmtime(double __pyx_v_ts) {
  struct tm __pyx_v__tm;
  PY_LONG_LONG __pyx_v_ordinal;
  PY_LONG_LONG __pyx_r;
  struct tm __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":712
 *     seconds since the Unix Epoch, representing the UTC time.
 *     """
 *     cdef tm _tm = tm_gmtime(ts)             # <<<<<<<<<<<<<<
 *     cdef long long ordinal = ymd_to_ordinal(_tm.tm_year, _tm.tm_mon, _tm.tm_mday)
 *     return (
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_tm_gmtime(__pyx_v_ts); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 712, __pyx_L1_error)
  __pyx_v__tm = __pyx_t_1;

  /* "cytimes/utils.pxd":713
 *     """
 *     cdef tm _tm = tm_gmtime(ts)
 *     cdef long long ordinal = ymd_to_ordinal(_tm.tm_year, _tm.tm_mon, _tm.tm_mday)             # <<<<<<<<<<<<<<
 *     return (
 *         (ordinal - EPOCH_DAY) * SS_DAY
 */
  __pyx_t_2 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_v__tm.tm_year, __pyx_v__tm.tm_mon, __pyx_v__tm.tm_mday); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 713, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_2;

  /* "cytimes/utils.pxd":718
 *         + _tm.tm_hour * SS_HOUR
 *         + _tm.tm_min * SS_MINUTE
 *         + _tm.tm_sec             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_r = (((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_SS_DAY) + (__pyx_v__tm.tm_hour * __pyx_v_7cytimes_5utils_SS_HOUR)) + (__pyx_v__tm.tm_min * __pyx_v_7cytimes_5utils_SS_MINUTE)) + __pyx_v__tm.tm_sec);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":706
 *     return t[0]
 * 
 * cdef inline long long ts_gmtime(double ts):             # <<<<<<<<<<<<<<
 *     """Convert a timestamp to UTC seconds since the Unix Epoch `<'int'>`.
 * 
 */

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

/* "cytimes/utils.pxd":721
 *     )
 * 
 * cdef inline long long ts_localtime(double ts):             # <<<<<<<<<<<<<<
 *     """Convert a timestamp to local seconds since the Unix Epoch `<'int'>`.
 * 
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_ts_localtime(double __pyx_v_ts) {
  struct tm __pyx_v__tm;
  PY_LONG_LONG __pyx_v_ordinal;
  PY_LONG_LONG __pyx_r;
  struct tm __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":727
 *     seconds since the Unix Epoch, representing the local time.
 *     """
 *     cdef tm _tm = tm_localtime(ts)             # <<<<<<<<<<<<<<
 *     cdef long long ordinal = ymd_to_ordinal(_tm.tm_year, _tm.tm_mon, _tm.tm_mday)
 *     return (
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_tm_localtime(__pyx_v_ts); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 727, __pyx_L1_error)
  __pyx_v__tm = __pyx_t_1;

  /* "cytimes/utils.pxd":728
 *     """
 *     cdef tm _tm = tm_localtime(ts)
 *     cdef long long ordinal = ymd_to_ordinal(_tm.tm_year, _tm.tm_mon, _tm.tm_mday)             # <<<<<<<<<<<<<<
 *     return (
 *         (ordinal - EPOCH_DAY) * SS_DAY
 */
  __pyx_t_2 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_v__tm.tm_year, __pyx_v__tm.tm_mon, __pyx_v__tm.tm_mday); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 728, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_2;

  /* "cytimes/utils.pxd":733
 *         + _tm.tm_hour * SS_HOUR
 *         + _tm.tm_min * SS_MINUTE
 *         + _tm.tm_sec             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_r = (((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_SS_DAY) + (__pyx_v__tm.tm_hour * __pyx_v_7cytimes_5utils_SS_HOUR)) + (__pyx_v__tm.tm_min * __pyx_v_7cytimes_5utils_SS_MINUTE)) + __pyx_v__tm.tm_sec);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":721
 *     )
 * 
 * cdef inline long long ts_localtime(double ts):             # <<<<<<<<<<<<<<
 *     """Convert a timestamp to local seconds since the Unix Epoch `<'int'>`.
 * 
 */

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

/* "cytimes/utils.pxd":736
 *     )
 * 
 * cdef inline int _raise_from_errno() except -1 with gil:             # <<<<<<<<<<<<<<
 *     """(internal) Error handling for 'ts_gmtime/ts_localtime' functions."""
 *     PyErr_SetFromErrno(RuntimeError)
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_from_errno(void) {
  int __pyx_r;
  PyObject *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif

  /* "cytimes/utils.pxd":738
 * cdef inline int _raise_from_errno() except -1 with gil:
 *     """(internal) Error handling for 'ts_gmtime/ts_localtime' functions."""
 *     PyErr_SetFromErrno(RuntimeError)             # <<<<<<<<<<<<<<
 *     return <int> -1  # type: ignore
 * 
 */
  __pyx_t_1 = PyErr_SetFromErrno(__pyx_builtin_RuntimeError); if (unlikely(__pyx_t_1 == ((PyObject *)NULL))) __PYX_ERR(0, 738, __pyx_L1_error)

  /* "cytimes/utils.pxd":739
 *     """(internal) Error handling for 'ts_gmtime/ts_localtime' functions."""
 *     PyErr_SetFromErrno(RuntimeError)
 *     return <int> -1  # type: ignore             # <<<<<<<<<<<<<<
 * 
 * # . conversion
 */
  __pyx_r = ((int)-1L);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":736
 *     )
 * 
 * cdef inline int _raise_from_errno() except -1 with gil:             # <<<<<<<<<<<<<<
 *     """(internal) Error handling for 'ts_gmtime/ts_localtime' functions."""
 *     PyErr_SetFromErrno(RuntimeError)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils._raise_from_errno", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "cytimes/utils.pxd":742
 * 
 * # . conversion
 * cdef inline str tm_strftime(tm t, str fmt):             # <<<<<<<<<<<<<<
 *     """Convert 'struct:tm' to string according to the given format `<'str'>`."""
 *     # Revert fields to 0-based
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tm_strftime(struct tm __pyx_v_t, PyObject *__pyx_v_fmt) {
  char __pyx_v_buffer[0x100];
  Py_ssize_t __pyx_v_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tm_strftime", 1);

  /* "cytimes/utils.pxd":745
 *     """Convert 'struct:tm' to string according to the given format `<'str'>`."""
 *     # Revert fields to 0-based
 *     t.tm_year -= 1_900             # <<<<<<<<<<<<<<
 *     t.tm_mon -= 1
 *     t.tm_wday = (t.tm_wday + 1) % 7
 */
  __pyx_v_t.tm_year = (__pyx_v_t.tm_year - 0x76C);

  /* "cytimes/utils.pxd":746
 *     # Revert fields to 0-based
 *     t.tm_year -= 1_900
 *     t.tm_mon -= 1             # <<<<<<<<<<<<<<
 *     t.tm_wday = (t.tm_wday + 1) % 7
 *     t.tm_yday -= 1
 */
  __pyx_v_t.tm_mon = (__pyx_v_t.tm_mon - 1);

  /* "cytimes/utils.pxd":747
 *     t.tm_year -= 1_900
 *     t.tm_mon -= 1
 *     t.tm_wday = (t.tm_wday + 1) % 7             # <<<<<<<<<<<<<<
 *     t.tm_yday -= 1
 * 
 */
  __pyx_v_t.tm_wday = __Pyx_mod_long((__pyx_v_t.tm_wday + 1), 7);

  /* "cytimes/utils.pxd":748
 *     t.tm_mon -= 1
 *     t.tm_wday = (t.tm_wday + 1) % 7
 *     t.tm_yday -= 1             # <<<<<<<<<<<<<<
 * 
 *     # Perform strftime
 */
  __pyx_v_t.tm_yday = (__pyx_v_t.tm_yday - 1);

  /* "cytimes/utils.pxd":752
 *     # Perform strftime
 *     cdef char buffer[256]
 *     cdef Py_ssize_t size = strftime(buffer, sizeof(buffer), PyUnicode_AsUTF8(fmt), &t)             # <<<<<<<<<<<<<<
 *     if size == 0:
 *         raise OverflowError("strftime format is too long:\n'%s'" % fmt)
 */
  __pyx_t_1 = PyUnicode_AsUTF8(__pyx_v_fmt); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(0, 752, __pyx_L1_error)
  __pyx_v_size = strftime(__pyx_v_buffer, (sizeof(__pyx_v_buffer)), __pyx_t_1, (&__pyx_v_t));

  /* "cytimes/utils.pxd":753
 *     cdef char buffer[256]
 *     cdef Py_ssize_t size = strftime(buffer, sizeof(buffer), PyUnicode_AsUTF8(fmt), &t)
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         raise OverflowError("strftime format is too long:\n'%s'" % fmt)
 *     return PyUnicode_DecodeUTF8(buffer, size, NULL)
 */
  __pyx_t_2 = (__pyx_v_size == 0);
  if (unlikely(__pyx_t_2)) {

    /* "cytimes/utils.pxd":754
 *     cdef Py_ssize_t size = strftime(buffer, sizeof(buffer), PyUnicode_AsUTF8(fmt), &t)
 *     if size == 0:
 *         raise OverflowError("strftime format is too long:\n'%s'" % fmt)             # <<<<<<<<<<<<<<
 *     return PyUnicode_DecodeUTF8(buffer, size, NULL)
 * 
 */
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_strftime_format_is_too_long_s, __pyx_v_fmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_OverflowError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 754, __pyx_L1_error)

    /* "cytimes/utils.pxd":753
 *     cdef char buffer[256]
 *     cdef Py_ssize_t size = strftime(buffer, sizeof(buffer), PyUnicode_AsUTF8(fmt), &t)
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         raise OverflowError("strftime format is too long:\n'%s'" % fmt)
 *     return PyUnicode_DecodeUTF8(buffer, size, NULL)
 */
  }

  /* "cytimes/utils.pxd":755
 *     if size == 0:
 *         raise OverflowError("strftime format is too long:\n'%s'" % fmt)
 *     return PyUnicode_DecodeUTF8(buffer, size, NULL)             # <<<<<<<<<<<<<<
 * 
 * cdef inline tm tm_fr_us(long long val) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyUnicode_DecodeUTF8(__pyx_v_buffer, __pyx_v_size, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":742
 * 
 * # . conversion
 * cdef inline str tm_strftime(tm t, str fmt):             # <<<<<<<<<<<<<<
 *     """Convert 'struct:tm' to string according to the given format `<'str'>`."""
 *     # Revert fields to 0-based
 */

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

/* "cytimes/utils.pxd":757
 *     return PyUnicode_DecodeUTF8(buffer, size, NULL)
 * 
 * cdef inline tm tm_fr_us(long long val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:tm' from `EPOCH` microseconds (int) `<'struct:tm'>`."""
 *     # Compute ymd & hmsf
 */

static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_tm_fr_us(PY_LONG_LONG __pyx_v_val) {
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  __pyx_t_7cytimes_5utils_hmsf __pyx_v__hmsf;
  int __pyx_v_yy;
  int __pyx_v_mm;
  int __pyx_v_dd;
  struct tm __pyx_r;
  PY_LONG_LONG __pyx_t_1;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_2;
  __pyx_t_7cytimes_5utils_hmsf __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  struct tm __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":760
 *     """Create 'struct:tm' from `EPOCH` microseconds (int) `<'struct:tm'>`."""
 *     # Compute ymd & hmsf
 *     val += EPOCH_MICROSECOND             # <<<<<<<<<<<<<<
 *     _ymd = ymd_fr_ordinal(math_floor_div(val, US_DAY))
 *     _hmsf = hmsf_fr_us(val)
 */
  __pyx_v_val = (__pyx_v_val + __pyx_v_7cytimes_5utils_EPOCH_MICROSECOND);

  /* "cytimes/utils.pxd":761
 *     # Compute ymd & hmsf
 *     val += EPOCH_MICROSECOND
 *     _ymd = ymd_fr_ordinal(math_floor_div(val, US_DAY))             # <<<<<<<<<<<<<<
 *     _hmsf = hmsf_fr_us(val)
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_val, __pyx_v_7cytimes_5utils_US_DAY, NULL); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 761, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 761, __pyx_L1_error)
  __pyx_v__ymd = __pyx_t_2;

  /* "cytimes/utils.pxd":762
 *     val += EPOCH_MICROSECOND
 *     _ymd = ymd_fr_ordinal(math_floor_div(val, US_DAY))
 *     _hmsf = hmsf_fr_us(val)             # <<<<<<<<<<<<<<
 * 
 *     # New 'struct:tm'
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_hmsf_fr_us(__pyx_v_val); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 762, __pyx_L1_error)
  __pyx_v__hmsf = __pyx_t_3;

  /* "cytimes/utils.pxd":766
 *     # New 'struct:tm'
 *     cdef int yy, mm, dd
 *     yy, mm, dd = _ymd.year, _ymd.month, _ymd.day             # <<<<<<<<<<<<<<
 *     return tm(
 *         _hmsf.second, _hmsf.minute, _hmsf.hour,  # sec, min, hour
 */
  __pyx_t_4 = __pyx_v__ymd.year;
  __pyx_t_5 = __pyx_v__ymd.month;
  __pyx_t_6 = __pyx_v__ymd.day;
  __pyx_v_yy = __pyx_t_4;
  __pyx_v_mm = __pyx_t_5;
  __pyx_v_dd = __pyx_t_6;

  /* "cytimes/utils.pxd":768
 *     yy, mm, dd = _ymd.year, _ymd.month, _ymd.day
 *     return tm(
 *         _hmsf.second, _hmsf.minute, _hmsf.hour,  # sec, min, hour             # <<<<<<<<<<<<<<
 *         dd, mm, dd,  # day, mon, year
 *         ymd_weekday(dd, mm, dd),  # wday
 */
  __pyx_t_7.tm_sec = __pyx_v__hmsf.second;
  __pyx_t_7.tm_min = __pyx_v__hmsf.minute;
  __pyx_t_7.tm_hour = __pyx_v__hmsf.hour;

  /* "cytimes/utils.pxd":769
 *     return tm(
 *         _hmsf.second, _hmsf.minute, _hmsf.hour,  # sec, min, hour
 *         dd, mm, dd,  # day, mon, year             # <<<<<<<<<<<<<<
 *         ymd_weekday(dd, mm, dd),  # wday
 *         days_bf_month(yy, mm) + dd,  # yday
 */
  __pyx_t_7.tm_mday = __pyx_v_dd;
  __pyx_t_7.tm_mon = __pyx_v_mm;
  __pyx_t_7.tm_year = __pyx_v_dd;

  /* "cytimes/utils.pxd":770
 *         _hmsf.second, _hmsf.minute, _hmsf.hour,  # sec, min, hour
 *         dd, mm, dd,  # day, mon, year
 *         ymd_weekday(dd, mm, dd),  # wday             # <<<<<<<<<<<<<<
 *         days_bf_month(yy, mm) + dd,  # yday
 *         -1,  # isdst
 */
  __pyx_t_6 = __pyx_f_7cytimes_5utils_ymd_weekday(__pyx_v_dd, __pyx_v_mm, __pyx_v_dd); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 770, __pyx_L1_error)
  __pyx_t_7.tm_wday = __pyx_t_6;

  /* "cytimes/utils.pxd":771
 *         dd, mm, dd,  # day, mon, year
 *         ymd_weekday(dd, mm, dd),  # wday
 *         days_bf_month(yy, mm) + dd,  # yday             # <<<<<<<<<<<<<<
 *         -1,  # isdst
 *     )
 */
  __pyx_t_6 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_yy, __pyx_v_mm); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 771, __pyx_L1_error)
  __pyx_t_7.tm_yday = (__pyx_t_6 + __pyx_v_dd);
  __pyx_t_7.tm_isdst = -1;
  __pyx_r = __pyx_t_7;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":757
 *     return PyUnicode_DecodeUTF8(buffer, size, NULL)
 * 
 * cdef inline tm tm_fr_us(long long val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:tm' from `EPOCH` microseconds (int) `<'struct:tm'>`."""
 *     # Compute ymd & hmsf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.tm_fr_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/utils.pxd":775
 *     )
 * 
 * cdef inline tm tm_fr_seconds(double val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:tm' from `EPOCH` seconds (float) `<'struct:tm'>`."""
 *     return tm_fr_us(<long long> int(val * US_SECOND))
 */

static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_tm_fr_seconds(double __pyx_v_val) {
  struct tm __pyx_r;
  struct tm __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":777
 * cdef inline tm tm_fr_seconds(double val) except *:
 *     """Create 'struct:tm' from `EPOCH` seconds (float) `<'struct:tm'>`."""
 *     return tm_fr_us(<long long> int(val * US_SECOND))             # <<<<<<<<<<<<<<
 * 
 * cdef inline hmsf hmsf_fr_us(long long val) except *:
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_tm_fr_us(((PY_LONG_LONG)((PY_LONG_LONG)(__pyx_v_val * __pyx_v_7cytimes_5utils_US_SECOND)))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 777, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":775
 *     )
 * 
 * cdef inline tm tm_fr_seconds(double val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:tm' from `EPOCH` seconds (float) `<'struct:tm'>`."""
 *     return tm_fr_us(<long long> int(val * US_SECOND))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.tm_fr_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/utils.pxd":779
 *     return tm_fr_us(<long long> int(val * US_SECOND))
 * 
 * cdef inline hmsf hmsf_fr_us(long long val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:hmsf' from microseconds (int) `<'struct:hmsf'>`.
 * 
 */

static CYTHON_INLINE __pyx_t_7cytimes_5utils_hmsf __pyx_f_7cytimes_5utils_hmsf_fr_us(PY_LONG_LONG __pyx_v_val) {
  int __pyx_v_hh;
  int __pyx_v_mi;
  PY_LONG_LONG __pyx_v_ss;
  __pyx_t_7cytimes_5utils_hmsf __pyx_r;
  int __pyx_t_1;
  __pyx_t_7cytimes_5utils_hmsf __pyx_t_2;
  PY_LONG_LONG __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":785
 *     and `NOT` the Unix Epoch (1970-01-01 00:00:00).
 *     """
 *     if val <= 0:             # <<<<<<<<<<<<<<
 *         return hmsf(0, 0, 0, 0)
 * 
 */
  __pyx_t_1 = (__pyx_v_val <= 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":786
 *     """
 *     if val <= 0:
 *         return hmsf(0, 0, 0, 0)             # <<<<<<<<<<<<<<
 * 
 *     val = math_mod(val, US_DAY)
 */
    __pyx_t_2.hour = 0;
    __pyx_t_2.minute = 0;
    __pyx_t_2.second = 0;
    __pyx_t_2.microsecond = 0;
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":785
 *     and `NOT` the Unix Epoch (1970-01-01 00:00:00).
 *     """
 *     if val <= 0:             # <<<<<<<<<<<<<<
 *         return hmsf(0, 0, 0, 0)
 * 
 */
  }

  /* "cytimes/utils.pxd":788
 *         return hmsf(0, 0, 0, 0)
 * 
 *     val = math_mod(val, US_DAY)             # <<<<<<<<<<<<<<
 *     cdef int hh = math_floor_div(val, US_HOUR)
 *     val -= hh * US_HOUR
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_math_mod(__pyx_v_val, __pyx_v_7cytimes_5utils_US_DAY, NULL); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 788, __pyx_L1_error)
  __pyx_v_val = __pyx_t_3;

  /* "cytimes/utils.pxd":789
 * 
 *     val = math_mod(val, US_DAY)
 *     cdef int hh = math_floor_div(val, US_HOUR)             # <<<<<<<<<<<<<<
 *     val -= hh * US_HOUR
 *     cdef int mi = math_floor_div(val, US_MINUTE)
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_val, __pyx_v_7cytimes_5utils_US_HOUR, NULL); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 789, __pyx_L1_error)
  __pyx_v_hh = __pyx_t_3;

  /* "cytimes/utils.pxd":790
 *     val = math_mod(val, US_DAY)
 *     cdef int hh = math_floor_div(val, US_HOUR)
 *     val -= hh * US_HOUR             # <<<<<<<<<<<<<<
 *     cdef int mi = math_floor_div(val, US_MINUTE)
 *     val -= mi * US_MINUTE
 */
  __pyx_v_val = (__pyx_v_val - (__pyx_v_hh * __pyx_v_7cytimes_5utils_US_HOUR));

  /* "cytimes/utils.pxd":791
 *     cdef int hh = math_floor_div(val, US_HOUR)
 *     val -= hh * US_HOUR
 *     cdef int mi = math_floor_div(val, US_MINUTE)             # <<<<<<<<<<<<<<
 *     val -= mi * US_MINUTE
 *     cdef long long ss = math_floor_div(val, US_SECOND)
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_val, __pyx_v_7cytimes_5utils_US_MINUTE, NULL); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 791, __pyx_L1_error)
  __pyx_v_mi = __pyx_t_3;

  /* "cytimes/utils.pxd":792
 *     val -= hh * US_HOUR
 *     cdef int mi = math_floor_div(val, US_MINUTE)
 *     val -= mi * US_MINUTE             # <<<<<<<<<<<<<<
 *     cdef long long ss = math_floor_div(val, US_SECOND)
 *     return hmsf(hh, mi, ss, val - ss * US_SECOND)
 */
  __pyx_v_val = (__pyx_v_val - (__pyx_v_mi * __pyx_v_7cytimes_5utils_US_MINUTE));

  /* "cytimes/utils.pxd":793
 *     cdef int mi = math_floor_div(val, US_MINUTE)
 *     val -= mi * US_MINUTE
 *     cdef long long ss = math_floor_div(val, US_SECOND)             # <<<<<<<<<<<<<<
 *     return hmsf(hh, mi, ss, val - ss * US_SECOND)
 * 
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_val, __pyx_v_7cytimes_5utils_US_SECOND, NULL); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 793, __pyx_L1_error)
  __pyx_v_ss = __pyx_t_3;

  /* "cytimes/utils.pxd":794
 *     val -= mi * US_MINUTE
 *     cdef long long ss = math_floor_div(val, US_SECOND)
 *     return hmsf(hh, mi, ss, val - ss * US_SECOND)             # <<<<<<<<<<<<<<
 * 
 * cdef inline hmsf hmsf_fr_seconds(double val) except *:
 */
  __pyx_t_2.hour = __pyx_v_hh;
  __pyx_t_2.minute = __pyx_v_mi;
  __pyx_t_2.second = __pyx_v_ss;
  __pyx_t_2.microsecond = (__pyx_v_val - (__pyx_v_ss * __pyx_v_7cytimes_5utils_US_SECOND));
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":779
 *     return tm_fr_us(<long long> int(val * US_SECOND))
 * 
 * cdef inline hmsf hmsf_fr_us(long long val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:hmsf' from microseconds (int) `<'struct:hmsf'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.hmsf_fr_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/utils.pxd":796
 *     return hmsf(hh, mi, ss, val - ss * US_SECOND)
 * 
 * cdef inline hmsf hmsf_fr_seconds(double val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:hmsf' from seconds (float) `<'struct:hmsf'>`.
 * 
 */

static CYTHON_INLINE __pyx_t_7cytimes_5utils_hmsf __pyx_f_7cytimes_5utils_hmsf_fr_seconds(double __pyx_v_val) {
  __pyx_t_7cytimes_5utils_hmsf __pyx_r;
  __pyx_t_7cytimes_5utils_hmsf __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":802
 *     and `NOT` the Unix Epoch (1970-01-01 00:00:00).
 *     """
 *     return hmsf_fr_us(<long long> int(val * US_SECOND))             # <<<<<<<<<<<<<<
 * 
 * # Calendar ---------------------------------------------------------------------------------------------
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_hmsf_fr_us(((PY_LONG_LONG)((PY_LONG_LONG)(__pyx_v_val * __pyx_v_7cytimes_5utils_US_SECOND)))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 802, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":796
 *     return hmsf(hh, mi, ss, val - ss * US_SECOND)
 * 
 * cdef inline hmsf hmsf_fr_seconds(double val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:hmsf' from seconds (float) `<'struct:hmsf'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.hmsf_fr_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/utils.pxd":806
 * # Calendar ---------------------------------------------------------------------------------------------
 * # . year
 * cdef inline bint is_leap_year(int year) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'year' is a leap year `<'bool'>`."""
 *     if year < 1:
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_leap_year(int __pyx_v_year) {
  int __pyx_r;
  int __pyx_t_1;

  /* "cytimes/utils.pxd":808
 * cdef inline bint is_leap_year(int year) except -1:
 *     """Check if the passed in 'year' is a leap year `<'bool'>`."""
 *     if year < 1:             # <<<<<<<<<<<<<<
 *         return False
 *     if year % 4 == 0:
 */
  __pyx_t_1 = (__pyx_v_year < 1);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":809
 *     """Check if the passed in 'year' is a leap year `<'bool'>`."""
 *     if year < 1:
 *         return False             # <<<<<<<<<<<<<<
 *     if year % 4 == 0:
 *         if year % 400 == 0:
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":808
 * cdef inline bint is_leap_year(int year) except -1:
 *     """Check if the passed in 'year' is a leap year `<'bool'>`."""
 *     if year < 1:             # <<<<<<<<<<<<<<
 *         return False
 *     if year % 4 == 0:
 */
  }

  /* "cytimes/utils.pxd":810
 *     if year < 1:
 *         return False
 *     if year % 4 == 0:             # <<<<<<<<<<<<<<
 *         if year % 400 == 0:
 *             return True
 */
  __pyx_t_1 = (__Pyx_mod_long(__pyx_v_year, 4) == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":811
 *         return False
 *     if year % 4 == 0:
 *         if year % 400 == 0:             # <<<<<<<<<<<<<<
 *             return True
 *         if year % 100 != 0:
 */
    __pyx_t_1 = (__Pyx_mod_long(__pyx_v_year, 0x190) == 0);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":812
 *     if year % 4 == 0:
 *         if year % 400 == 0:
 *             return True             # <<<<<<<<<<<<<<
 *         if year % 100 != 0:
 *             return True
 */
      __pyx_r = 1;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":811
 *         return False
 *     if year % 4 == 0:
 *         if year % 400 == 0:             # <<<<<<<<<<<<<<
 *             return True
 *         if year % 100 != 0:
 */
    }

    /* "cytimes/utils.pxd":813
 *         if year % 400 == 0:
 *             return True
 *         if year % 100 != 0:             # <<<<<<<<<<<<<<
 *             return True
 *     return False
 */
    __pyx_t_1 = (__Pyx_mod_long(__pyx_v_year, 0x64) != 0);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":814
 *             return True
 *         if year % 100 != 0:
 *             return True             # <<<<<<<<<<<<<<
 *     return False
 * 
 */
      __pyx_r = 1;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":813
 *         if year % 400 == 0:
 *             return True
 *         if year % 100 != 0:             # <<<<<<<<<<<<<<
 *             return True
 *     return False
 */
    }

    /* "cytimes/utils.pxd":810
 *     if year < 1:
 *         return False
 *     if year % 4 == 0:             # <<<<<<<<<<<<<<
 *         if year % 400 == 0:
 *             return True
 */
  }

  /* "cytimes/utils.pxd":815
 *         if year % 100 != 0:
 *             return True
 *     return False             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_long_year(int year) except -1:
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":806
 * # Calendar ---------------------------------------------------------------------------------------------
 * # . year
 * cdef inline bint is_leap_year(int year) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'year' is a leap year `<'bool'>`."""
 *     if year < 1:
 */

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

/* "cytimes/utils.pxd":817
 *     return False
 * 
 * cdef inline bint is_long_year(int year) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'year' is a long year `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_long_year(int __pyx_v_year) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":822
 *     #### Long year: maximum ISO week number equal 53.
 *     """
 *     return ymd_isoweek(year, 12, 28) == 53             # <<<<<<<<<<<<<<
 * 
 * cdef inline int leap_bt_year(int year1, int year2) except -1:
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_ymd_isoweek(__pyx_v_year, 12, 28); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 822, __pyx_L1_error)
  __pyx_r = (__pyx_t_1 == 53);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":817
 *     return False
 * 
 * cdef inline bint is_long_year(int year) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'year' is a long year `<'bool'>`.
 * 
 */

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

/* "cytimes/utils.pxd":824
 *     return ymd_isoweek(year, 12, 28) == 53
 * 
 * cdef inline int leap_bt_year(int year1, int year2) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of leap years between 'year1' & 'year2' `<'int'>`."""
 *     cdef int y1, y2
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_leap_bt_year(int __pyx_v_year1, int __pyx_v_year2) {
  int __pyx_v_y1;
  int __pyx_v_y2;
  int __pyx_r;
  int __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  long __pyx_t_5;

  /* "cytimes/utils.pxd":827
 *     """Compute the number of leap years between 'year1' & 'year2' `<'int'>`."""
 *     cdef int y1, y2
 *     if year1 < year2:             # <<<<<<<<<<<<<<
 *         y1, y2 = max(year1, 1) - 1, max(year2, 1) - 1
 *     else:
 */
  __pyx_t_1 = (__pyx_v_year1 < __pyx_v_year2);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":828
 *     cdef int y1, y2
 *     if year1 < year2:
 *         y1, y2 = max(year1, 1) - 1, max(year2, 1) - 1             # <<<<<<<<<<<<<<
 *     else:
 *         y1, y2 = max(year2, 1) - 1, max(year1, 1) - 1
 */
    __pyx_t_2 = 1;
    __pyx_t_3 = __pyx_v_year1;
    __pyx_t_1 = (__pyx_t_2 > __pyx_t_3);
    if (__pyx_t_1) {
      __pyx_t_4 = __pyx_t_2;
    } else {
      __pyx_t_4 = __pyx_t_3;
    }
    __pyx_t_2 = (__pyx_t_4 - 1);
    __pyx_t_4 = 1;
    __pyx_t_3 = __pyx_v_year2;
    __pyx_t_1 = (__pyx_t_4 > __pyx_t_3);
    if (__pyx_t_1) {
      __pyx_t_5 = __pyx_t_4;
    } else {
      __pyx_t_5 = __pyx_t_3;
    }
    __pyx_t_4 = (__pyx_t_5 - 1);
    __pyx_v_y1 = __pyx_t_2;
    __pyx_v_y2 = __pyx_t_4;

    /* "cytimes/utils.pxd":827
 *     """Compute the number of leap years between 'year1' & 'year2' `<'int'>`."""
 *     cdef int y1, y2
 *     if year1 < year2:             # <<<<<<<<<<<<<<
 *         y1, y2 = max(year1, 1) - 1, max(year2, 1) - 1
 *     else:
 */
    goto __pyx_L3;
  }

  /* "cytimes/utils.pxd":830
 *         y1, y2 = max(year1, 1) - 1, max(year2, 1) - 1
 *     else:
 *         y1, y2 = max(year2, 1) - 1, max(year1, 1) - 1             # <<<<<<<<<<<<<<
 *     return (
 *         (y2 // 4 - y1 // 4)
 */
  /*else*/ {
    __pyx_t_4 = 1;
    __pyx_t_3 = __pyx_v_year2;
    __pyx_t_1 = (__pyx_t_4 > __pyx_t_3);
    if (__pyx_t_1) {
      __pyx_t_2 = __pyx_t_4;
    } else {
      __pyx_t_2 = __pyx_t_3;
    }
    __pyx_t_4 = (__pyx_t_2 - 1);
    __pyx_t_2 = 1;
    __pyx_t_3 = __pyx_v_year1;
    __pyx_t_1 = (__pyx_t_2 > __pyx_t_3);
    if (__pyx_t_1) {
      __pyx_t_5 = __pyx_t_2;
    } else {
      __pyx_t_5 = __pyx_t_3;
    }
    __pyx_t_2 = (__pyx_t_5 - 1);
    __pyx_v_y1 = __pyx_t_4;
    __pyx_v_y2 = __pyx_t_2;
  }
  __pyx_L3:;

  /* "cytimes/utils.pxd":834
 *         (y2 // 4 - y1 // 4)
 *         - (y2 // 100 - y1 // 100)
 *         + (y2 // 400 - y1 // 400)             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_r = (((__Pyx_div_long(__pyx_v_y2, 4) - __Pyx_div_long(__pyx_v_y1, 4)) - (__Pyx_div_long(__pyx_v_y2, 0x64) - __Pyx_div_long(__pyx_v_y1, 0x64))) + (__Pyx_div_long(__pyx_v_y2, 0x190) - __Pyx_div_long(__pyx_v_y1, 0x190)));
  goto __pyx_L0;

  /* "cytimes/utils.pxd":824
 *     return ymd_isoweek(year, 12, 28) == 53
 * 
 * cdef inline int leap_bt_year(int year1, int year2) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of leap years between 'year1' & 'year2' `<'int'>`."""
 *     cdef int y1, y2
 */

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

/* "cytimes/utils.pxd":837
 *     )
 * 
 * cdef inline int days_in_year(int year) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the maximum days (365, 366) in the 'year' `<'int'>`."""
 *     return 366 if is_leap_year(year) else 365
 */

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

  /* "cytimes/utils.pxd":839
 * cdef inline int days_in_year(int year) except -1:
 *     """Compute the maximum days (365, 366) in the 'year' `<'int'>`."""
 *     return 366 if is_leap_year(year) else 365             # <<<<<<<<<<<<<<
 * 
 * cdef inline int days_bf_year(int year) except -1:
 */
  __pyx_t_2 = __pyx_f_7cytimes_5utils_is_leap_year(__pyx_v_year); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 839, __pyx_L1_error)
  if (__pyx_t_2) {
    __pyx_t_1 = 0x16E;
  } else {
    __pyx_t_1 = 0x16D;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":837
 *     )
 * 
 * cdef inline int days_in_year(int year) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the maximum days (365, 366) in the 'year' `<'int'>`."""
 *     return 366 if is_leap_year(year) else 365
 */

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

/* "cytimes/utils.pxd":841
 *     return 366 if is_leap_year(year) else 365
 * 
 * cdef inline int days_bf_year(int year) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day of 1AD and the 'year' `<'int'>`."""
 *     if year <= 1:
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_bf_year(int __pyx_v_year) {
  int __pyx_v_y_1;
  int __pyx_r;
  int __pyx_t_1;

  /* "cytimes/utils.pxd":843
 * cdef inline int days_bf_year(int year) except -1:
 *     """Compute the number of days between the 1st day of 1AD and the 'year' `<'int'>`."""
 *     if year <= 1:             # <<<<<<<<<<<<<<
 *         return 0
 *     cdef int y_1 = year - 1
 */
  __pyx_t_1 = (__pyx_v_year <= 1);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":844
 *     """Compute the number of days between the 1st day of 1AD and the 'year' `<'int'>`."""
 *     if year <= 1:
 *         return 0             # <<<<<<<<<<<<<<
 *     cdef int y_1 = year - 1
 *     return y_1 * 365 + y_1 // 4 - y_1 // 100 + y_1 // 400
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":843
 * cdef inline int days_bf_year(int year) except -1:
 *     """Compute the number of days between the 1st day of 1AD and the 'year' `<'int'>`."""
 *     if year <= 1:             # <<<<<<<<<<<<<<
 *         return 0
 *     cdef int y_1 = year - 1
 */
  }

  /* "cytimes/utils.pxd":845
 *     if year <= 1:
 *         return 0
 *     cdef int y_1 = year - 1             # <<<<<<<<<<<<<<
 *     return y_1 * 365 + y_1 // 4 - y_1 // 100 + y_1 // 400
 * 
 */
  __pyx_v_y_1 = (__pyx_v_year - 1);

  /* "cytimes/utils.pxd":846
 *         return 0
 *     cdef int y_1 = year - 1
 *     return y_1 * 365 + y_1 // 4 - y_1 // 100 + y_1 // 400             # <<<<<<<<<<<<<<
 * 
 * cdef inline int days_of_year(int year, int month, int day) except -1:
 */
  __pyx_r = ((((__pyx_v_y_1 * 0x16D) + __Pyx_div_long(__pyx_v_y_1, 4)) - __Pyx_div_long(__pyx_v_y_1, 0x64)) + __Pyx_div_long(__pyx_v_y_1, 0x190));
  goto __pyx_L0;

  /* "cytimes/utils.pxd":841
 *     return 366 if is_leap_year(year) else 365
 * 
 * cdef inline int days_bf_year(int year) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day of 1AD and the 'year' `<'int'>`."""
 *     if year <= 1:
 */

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

/* "cytimes/utils.pxd":848
 *     return y_1 * 365 + y_1 // 4 - y_1 // 100 + y_1 // 400
 * 
 * cdef inline int days_of_year(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day of
 *     the 'year' and the current Y/M/D `<'int'>`.
 */

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

  /* "cytimes/utils.pxd":852
 *     the 'year' and the current Y/M/D `<'int'>`.
 *     """
 *     if day > 28:             # <<<<<<<<<<<<<<
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 */
  __pyx_t_1 = (__pyx_v_day > 28);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":853
 *     """
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))             # <<<<<<<<<<<<<<
 *     elif day < 1:
 *         day = 1
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_days_in_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 853, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_day;
    __pyx_t_1 = (__pyx_t_2 < __pyx_t_3);
    if (__pyx_t_1) {
      __pyx_t_4 = __pyx_t_2;
    } else {
      __pyx_t_4 = __pyx_t_3;
    }
    __pyx_v_day = __pyx_t_4;

    /* "cytimes/utils.pxd":852
 *     the 'year' and the current Y/M/D `<'int'>`.
 *     """
 *     if day > 28:             # <<<<<<<<<<<<<<
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 */
    goto __pyx_L3;
  }

  /* "cytimes/utils.pxd":854
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:             # <<<<<<<<<<<<<<
 *         day = 1
 *     return days_bf_month(year, month) + day
 */
  __pyx_t_1 = (__pyx_v_day < 1);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":855
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 *         day = 1             # <<<<<<<<<<<<<<
 *     return days_bf_month(year, month) + day
 * 
 */
    __pyx_v_day = 1;

    /* "cytimes/utils.pxd":854
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:             # <<<<<<<<<<<<<<
 *         day = 1
 *     return days_bf_month(year, month) + day
 */
  }
  __pyx_L3:;

  /* "cytimes/utils.pxd":856
 *     elif day < 1:
 *         day = 1
 *     return days_bf_month(year, month) + day             # <<<<<<<<<<<<<<
 * 
 * # . quarter
 */
  __pyx_t_4 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 856, __pyx_L1_error)
  __pyx_r = (__pyx_t_4 + __pyx_v_day);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":848
 *     return y_1 * 365 + y_1 // 4 - y_1 // 100 + y_1 // 400
 * 
 * cdef inline int days_of_year(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day of
 *     the 'year' and the current Y/M/D `<'int'>`.
 */

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

/* "cytimes/utils.pxd":859
 * 
 * # . quarter
 * cdef inline int quarter_of_month(int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the quarter (1-4) of the passed in 'month' `<'int'>`."""
 *     # Jan - Mar
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_quarter_of_month(int __pyx_v_month) {
  int __pyx_r;
  int __pyx_t_1;

  /* "cytimes/utils.pxd":862
 *     """Compute the quarter (1-4) of the passed in 'month' `<'int'>`."""
 *     # Jan - Mar
 *     if month <= 3:             # <<<<<<<<<<<<<<
 *         return 1
 *     # Oct - Dec
 */
  __pyx_t_1 = (__pyx_v_month <= 3);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":863
 *     # Jan - Mar
 *     if month <= 3:
 *         return 1             # <<<<<<<<<<<<<<
 *     # Oct - Dec
 *     if month >= 10:
 */
    __pyx_r = 1;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":862
 *     """Compute the quarter (1-4) of the passed in 'month' `<'int'>`."""
 *     # Jan - Mar
 *     if month <= 3:             # <<<<<<<<<<<<<<
 *         return 1
 *     # Oct - Dec
 */
  }

  /* "cytimes/utils.pxd":865
 *         return 1
 *     # Oct - Dec
 *     if month >= 10:             # <<<<<<<<<<<<<<
 *         return 4
 *     # Rest
 */
  __pyx_t_1 = (__pyx_v_month >= 10);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":866
 *     # Oct - Dec
 *     if month >= 10:
 *         return 4             # <<<<<<<<<<<<<<
 *     # Rest
 *     return (month - 1) // 3 + 1
 */
    __pyx_r = 4;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":865
 *         return 1
 *     # Oct - Dec
 *     if month >= 10:             # <<<<<<<<<<<<<<
 *         return 4
 *     # Rest
 */
  }

  /* "cytimes/utils.pxd":868
 *         return 4
 *     # Rest
 *     return (month - 1) // 3 + 1             # <<<<<<<<<<<<<<
 * 
 * cdef inline int days_in_quarter(int year, int month) except -1:
 */
  __pyx_r = (__Pyx_div_long((__pyx_v_month - 1), 3) + 1);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":859
 * 
 * # . quarter
 * cdef inline int quarter_of_month(int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the quarter (1-4) of the passed in 'month' `<'int'>`."""
 *     # Jan - Mar
 */

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

/* "cytimes/utils.pxd":870
 *     return (month - 1) // 3 + 1
 * 
 * cdef inline int days_in_quarter(int year, int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the maximum days in the quarter `<'int'>`."""
 *     cdef:
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_in_quarter(int __pyx_v_year, int __pyx_v_month) {
  int __pyx_v_quarter;
  int __pyx_v_days;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":873
 *     """Compute the maximum days in the quarter `<'int'>`."""
 *     cdef:
 *         int quarter = quarter_of_month(month)             # <<<<<<<<<<<<<<
 *         int days = DAYS_IN_QUARTER[quarter]
 *     if quarter == 1 and is_leap_year(year):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_quarter_of_month(__pyx_v_month); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 873, __pyx_L1_error)
  __pyx_v_quarter = __pyx_t_1;

  /* "cytimes/utils.pxd":874
 *     cdef:
 *         int quarter = quarter_of_month(month)
 *         int days = DAYS_IN_QUARTER[quarter]             # <<<<<<<<<<<<<<
 *     if quarter == 1 and is_leap_year(year):
 *         days += 1
 */
  __pyx_v_days = (__pyx_v_7cytimes_5utils_DAYS_IN_QUARTER[__pyx_v_quarter]);

  /* "cytimes/utils.pxd":875
 *         int quarter = quarter_of_month(month)
 *         int days = DAYS_IN_QUARTER[quarter]
 *     if quarter == 1 and is_leap_year(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  __pyx_t_3 = (__pyx_v_quarter == 1);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __pyx_f_7cytimes_5utils_is_leap_year(__pyx_v_year); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 875, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":876
 *         int days = DAYS_IN_QUARTER[quarter]
 *     if quarter == 1 and is_leap_year(year):
 *         days += 1             # <<<<<<<<<<<<<<
 *     return days
 * 
 */
    __pyx_v_days = (__pyx_v_days + 1);

    /* "cytimes/utils.pxd":875
 *         int quarter = quarter_of_month(month)
 *         int days = DAYS_IN_QUARTER[quarter]
 *     if quarter == 1 and is_leap_year(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  }

  /* "cytimes/utils.pxd":877
 *     if quarter == 1 and is_leap_year(year):
 *         days += 1
 *     return days             # <<<<<<<<<<<<<<
 * 
 * cdef inline int days_bf_quarter(int year, int month) except -1:
 */
  __pyx_r = __pyx_v_days;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":870
 *     return (month - 1) // 3 + 1
 * 
 * cdef inline int days_in_quarter(int year, int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the maximum days in the quarter `<'int'>`."""
 *     cdef:
 */

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

/* "cytimes/utils.pxd":879
 *     return days
 * 
 * cdef inline int days_bf_quarter(int year, int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day of the
 *     'year' and the 1st day of the quarter `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_bf_quarter(int __pyx_v_year, int __pyx_v_month) {
  int __pyx_v_quarter;
  int __pyx_v_days;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":884
 *     """
 *     cdef:
 *         int quarter = quarter_of_month(month)             # <<<<<<<<<<<<<<
 *         int days = DAYS_BR_QUARTER[quarter - 1]
 *     if quarter > 1 and is_leap_year(year):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_quarter_of_month(__pyx_v_month); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 884, __pyx_L1_error)
  __pyx_v_quarter = __pyx_t_1;

  /* "cytimes/utils.pxd":885
 *     cdef:
 *         int quarter = quarter_of_month(month)
 *         int days = DAYS_BR_QUARTER[quarter - 1]             # <<<<<<<<<<<<<<
 *     if quarter > 1 and is_leap_year(year):
 *         days += 1
 */
  __pyx_v_days = (__pyx_v_7cytimes_5utils_DAYS_BR_QUARTER[(__pyx_v_quarter - 1)]);

  /* "cytimes/utils.pxd":886
 *         int quarter = quarter_of_month(month)
 *         int days = DAYS_BR_QUARTER[quarter - 1]
 *     if quarter > 1 and is_leap_year(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  __pyx_t_3 = (__pyx_v_quarter > 1);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __pyx_f_7cytimes_5utils_is_leap_year(__pyx_v_year); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 886, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":887
 *         int days = DAYS_BR_QUARTER[quarter - 1]
 *     if quarter > 1 and is_leap_year(year):
 *         days += 1             # <<<<<<<<<<<<<<
 *     return days
 * 
 */
    __pyx_v_days = (__pyx_v_days + 1);

    /* "cytimes/utils.pxd":886
 *         int quarter = quarter_of_month(month)
 *         int days = DAYS_BR_QUARTER[quarter - 1]
 *     if quarter > 1 and is_leap_year(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  }

  /* "cytimes/utils.pxd":888
 *     if quarter > 1 and is_leap_year(year):
 *         days += 1
 *     return days             # <<<<<<<<<<<<<<
 * 
 * cdef inline int days_of_quarter(int year, int month, int day) except -1:
 */
  __pyx_r = __pyx_v_days;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":879
 *     return days
 * 
 * cdef inline int days_bf_quarter(int year, int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day of the
 *     'year' and the 1st day of the quarter `<'int'>`.
 */

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

/* "cytimes/utils.pxd":890
 *     return days
 * 
 * cdef inline int days_of_quarter(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day
 *     of the quarter and the current Y/M/D `<'int'>`.
 */

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

  /* "cytimes/utils.pxd":894
 *     of the quarter and the current Y/M/D `<'int'>`.
 *     """
 *     return days_of_year(year, month, day) - days_bf_quarter(year, month)             # <<<<<<<<<<<<<<
 * 
 * # . month
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_days_of_year(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 894, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7cytimes_5utils_days_bf_quarter(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 894, __pyx_L1_error)
  __pyx_r = (__pyx_t_1 - __pyx_t_2);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":890
 *     return days
 * 
 * cdef inline int days_of_quarter(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day
 *     of the quarter and the current Y/M/D `<'int'>`.
 */

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

/* "cytimes/utils.pxd":897
 * 
 * # . month
 * cdef inline int days_in_month(int year, int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the maximum days in the month `<'int'>`."""
 *     # January & December
 */

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

  /* "cytimes/utils.pxd":900
 *     """Compute the maximum days in the month `<'int'>`."""
 *     # January & December
 *     if not 1 < month < 12:             # <<<<<<<<<<<<<<
 *         return 31
 *     # Rest
 */
  __pyx_t_1 = (1 < __pyx_v_month);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_month < 12);
  }
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":901
 *     # January & December
 *     if not 1 < month < 12:
 *         return 31             # <<<<<<<<<<<<<<
 *     # Rest
 *     cdef int days = DAYS_IN_MONTH[month]
 */
    __pyx_r = 31;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":900
 *     """Compute the maximum days in the month `<'int'>`."""
 *     # January & December
 *     if not 1 < month < 12:             # <<<<<<<<<<<<<<
 *         return 31
 *     # Rest
 */
  }

  /* "cytimes/utils.pxd":903
 *         return 31
 *     # Rest
 *     cdef int days = DAYS_IN_MONTH[month]             # <<<<<<<<<<<<<<
 *     if month == 2 and is_leap_year(year):
 *         days += 1
 */
  __pyx_v_days = (__pyx_v_7cytimes_5utils_DAYS_IN_MONTH[__pyx_v_month]);

  /* "cytimes/utils.pxd":904
 *     # Rest
 *     cdef int days = DAYS_IN_MONTH[month]
 *     if month == 2 and is_leap_year(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  __pyx_t_1 = (__pyx_v_month == 2);
  if (__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __pyx_f_7cytimes_5utils_is_leap_year(__pyx_v_year); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 904, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":905
 *     cdef int days = DAYS_IN_MONTH[month]
 *     if month == 2 and is_leap_year(year):
 *         days += 1             # <<<<<<<<<<<<<<
 *     return days
 * 
 */
    __pyx_v_days = (__pyx_v_days + 1);

    /* "cytimes/utils.pxd":904
 *     # Rest
 *     cdef int days = DAYS_IN_MONTH[month]
 *     if month == 2 and is_leap_year(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  }

  /* "cytimes/utils.pxd":906
 *     if month == 2 and is_leap_year(year):
 *         days += 1
 *     return days             # <<<<<<<<<<<<<<
 * 
 * cdef inline int days_bf_month(int year, int month) except -1:
 */
  __pyx_r = __pyx_v_days;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":897
 * 
 * # . month
 * cdef inline int days_in_month(int year, int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the maximum days in the month `<'int'>`."""
 *     # January & December
 */

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

/* "cytimes/utils.pxd":908
 *     return days
 * 
 * cdef inline int days_bf_month(int year, int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day of the
 *     'year' and the 1st day of the 'month' `<'int'>`.
 */

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

  /* "cytimes/utils.pxd":913
 *     """
 *     # January
 *     if month <= 1:             # <<<<<<<<<<<<<<
 *         return 0
 *     # February
 */
  __pyx_t_1 = (__pyx_v_month <= 1);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":914
 *     # January
 *     if month <= 1:
 *         return 0             # <<<<<<<<<<<<<<
 *     # February
 *     if month == 2:
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":913
 *     """
 *     # January
 *     if month <= 1:             # <<<<<<<<<<<<<<
 *         return 0
 *     # February
 */
  }

  /* "cytimes/utils.pxd":916
 *         return 0
 *     # February
 *     if month == 2:             # <<<<<<<<<<<<<<
 *         return 31
 *     # Rest
 */
  __pyx_t_1 = (__pyx_v_month == 2);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":917
 *     # February
 *     if month == 2:
 *         return 31             # <<<<<<<<<<<<<<
 *     # Rest
 *     cdef int days = DAYS_BR_MONTH[month - 1] if month < 12 else 334
 */
    __pyx_r = 31;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":916
 *         return 0
 *     # February
 *     if month == 2:             # <<<<<<<<<<<<<<
 *         return 31
 *     # Rest
 */
  }

  /* "cytimes/utils.pxd":919
 *         return 31
 *     # Rest
 *     cdef int days = DAYS_BR_MONTH[month - 1] if month < 12 else 334             # <<<<<<<<<<<<<<
 *     if is_leap_year(year):
 *         days += 1
 */
  __pyx_t_1 = (__pyx_v_month < 12);
  if (__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_7cytimes_5utils_DAYS_BR_MONTH[(__pyx_v_month - 1)]);
  } else {
    __pyx_t_2 = 0x14E;
  }
  __pyx_v_days = __pyx_t_2;

  /* "cytimes/utils.pxd":920
 *     # Rest
 *     cdef int days = DAYS_BR_MONTH[month - 1] if month < 12 else 334
 *     if is_leap_year(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_is_leap_year(__pyx_v_year); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 920, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":921
 *     cdef int days = DAYS_BR_MONTH[month - 1] if month < 12 else 334
 *     if is_leap_year(year):
 *         days += 1             # <<<<<<<<<<<<<<
 *     return days
 * 
 */
    __pyx_v_days = (__pyx_v_days + 1);

    /* "cytimes/utils.pxd":920
 *     # Rest
 *     cdef int days = DAYS_BR_MONTH[month - 1] if month < 12 else 334
 *     if is_leap_year(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  }

  /* "cytimes/utils.pxd":922
 *     if is_leap_year(year):
 *         days += 1
 *     return days             # <<<<<<<<<<<<<<
 * 
 * # . week
 */
  __pyx_r = __pyx_v_days;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":908
 *     return days
 * 
 * cdef inline int days_bf_month(int year, int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day of the
 *     'year' and the 1st day of the 'month' `<'int'>`.
 */

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

/* "cytimes/utils.pxd":925
 * 
 * # . week
 * cdef inline int ymd_weekday(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the weekday (0=Mon...6=Sun) `<'int'>`."""
 *     return (ymd_to_ordinal(year, month, day) + 6) % 7
 */

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

  /* "cytimes/utils.pxd":927
 * cdef inline int ymd_weekday(int year, int month, int day) except -1:
 *     """Compute the weekday (0=Mon...6=Sun) `<'int'>`."""
 *     return (ymd_to_ordinal(year, month, day) + 6) % 7             # <<<<<<<<<<<<<<
 * 
 * # . iso
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 927, __pyx_L1_error)
  __pyx_r = __Pyx_mod_long((__pyx_t_1 + 6), 7);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":925
 * 
 * # . week
 * cdef inline int ymd_weekday(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the weekday (0=Mon...6=Sun) `<'int'>`."""
 *     return (ymd_to_ordinal(year, month, day) + 6) % 7
 */

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

/* "cytimes/utils.pxd":930
 * 
 * # . iso
 * cdef inline iso ymd_isocalendar(int year, int month, int day) except *:             # <<<<<<<<<<<<<<
 *     """Compute the ISO calendar `<'struct:iso'>`."""
 *     year = min(max(year, 1), 9_999)
 */

static CYTHON_INLINE __pyx_t_7cytimes_5utils_iso __pyx_f_7cytimes_5utils_ymd_isocalendar(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) {
  int __pyx_v_ordinal;
  int __pyx_v_mon_1st;
  int __pyx_v_days;
  int __pyx_v_weeks;
  __pyx_t_7cytimes_5utils_iso __pyx_r;
  long __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_7cytimes_5utils_iso __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":932
 * cdef inline iso ymd_isocalendar(int year, int month, int day) except *:
 *     """Compute the ISO calendar `<'struct:iso'>`."""
 *     year = min(max(year, 1), 9_999)             # <<<<<<<<<<<<<<
 *     cdef:
 *         int ordinal = ymd_to_ordinal(year, month, day)
 */
  __pyx_t_1 = 0x270F;
  __pyx_t_2 = 1;
  __pyx_t_3 = __pyx_v_year;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_year = __pyx_t_4;

  /* "cytimes/utils.pxd":934
 *     year = min(max(year, 1), 9_999)
 *     cdef:
 *         int ordinal = ymd_to_ordinal(year, month, day)             # <<<<<<<<<<<<<<
 *         int mon_1st = _iso_1st_monday(year)
 *         int days = ordinal - mon_1st
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 934, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_3;

  /* "cytimes/utils.pxd":935
 *     cdef:
 *         int ordinal = ymd_to_ordinal(year, month, day)
 *         int mon_1st = _iso_1st_monday(year)             # <<<<<<<<<<<<<<
 *         int days = ordinal - mon_1st
 *         int weeks = days // 7
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils__iso_1st_monday(__pyx_v_year); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 935, __pyx_L1_error)
  __pyx_v_mon_1st = __pyx_t_3;

  /* "cytimes/utils.pxd":936
 *         int ordinal = ymd_to_ordinal(year, month, day)
 *         int mon_1st = _iso_1st_monday(year)
 *         int days = ordinal - mon_1st             # <<<<<<<<<<<<<<
 *         int weeks = days // 7
 * 
 */
  __pyx_v_days = (__pyx_v_ordinal - __pyx_v_mon_1st);

  /* "cytimes/utils.pxd":937
 *         int mon_1st = _iso_1st_monday(year)
 *         int days = ordinal - mon_1st
 *         int weeks = days // 7             # <<<<<<<<<<<<<<
 * 
 *     if weeks < 0:
 */
  __pyx_v_weeks = __Pyx_div_long(__pyx_v_days, 7);

  /* "cytimes/utils.pxd":939
 *         int weeks = days // 7
 * 
 *     if weeks < 0:             # <<<<<<<<<<<<<<
 *         year -= 1
 *         weeks = (ordinal - _iso_1st_monday(year)) // 7 + 1
 */
  __pyx_t_5 = (__pyx_v_weeks < 0);
  if (__pyx_t_5) {

    /* "cytimes/utils.pxd":940
 * 
 *     if weeks < 0:
 *         year -= 1             # <<<<<<<<<<<<<<
 *         weeks = (ordinal - _iso_1st_monday(year)) // 7 + 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 */
    __pyx_v_year = (__pyx_v_year - 1);

    /* "cytimes/utils.pxd":941
 *     if weeks < 0:
 *         year -= 1
 *         weeks = (ordinal - _iso_1st_monday(year)) // 7 + 1             # <<<<<<<<<<<<<<
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 *         year += 1
 */
    __pyx_t_3 = __pyx_f_7cytimes_5utils__iso_1st_monday(__pyx_v_year); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 941, __pyx_L1_error)
    __pyx_v_weeks = (__Pyx_div_long((__pyx_v_ordinal - __pyx_t_3), 7) + 1);

    /* "cytimes/utils.pxd":939
 *         int weeks = days // 7
 * 
 *     if weeks < 0:             # <<<<<<<<<<<<<<
 *         year -= 1
 *         weeks = (ordinal - _iso_1st_monday(year)) // 7 + 1
 */
    goto __pyx_L3;
  }

  /* "cytimes/utils.pxd":942
 *         year -= 1
 *         weeks = (ordinal - _iso_1st_monday(year)) // 7 + 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):             # <<<<<<<<<<<<<<
 *         year += 1
 *         weeks = 1
 */
  __pyx_t_6 = (__pyx_v_weeks >= 52);
  if (__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __pyx_f_7cytimes_5utils__iso_1st_monday((__pyx_v_year + 1)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 942, __pyx_L1_error)
  __pyx_t_6 = (__pyx_v_ordinal >= __pyx_t_3);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_5) {

    /* "cytimes/utils.pxd":943
 *         weeks = (ordinal - _iso_1st_monday(year)) // 7 + 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 *         year += 1             # <<<<<<<<<<<<<<
 *         weeks = 1
 *     else:
 */
    __pyx_v_year = (__pyx_v_year + 1);

    /* "cytimes/utils.pxd":944
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 *         year += 1
 *         weeks = 1             # <<<<<<<<<<<<<<
 *     else:
 *         weeks += 1
 */
    __pyx_v_weeks = 1;

    /* "cytimes/utils.pxd":942
 *         year -= 1
 *         weeks = (ordinal - _iso_1st_monday(year)) // 7 + 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):             # <<<<<<<<<<<<<<
 *         year += 1
 *         weeks = 1
 */
    goto __pyx_L3;
  }

  /* "cytimes/utils.pxd":946
 *         weeks = 1
 *     else:
 *         weeks += 1             # <<<<<<<<<<<<<<
 *     return iso(year, weeks, days % 7 + 1)
 * 
 */
  /*else*/ {
    __pyx_v_weeks = (__pyx_v_weeks + 1);
  }
  __pyx_L3:;

  /* "cytimes/utils.pxd":947
 *     else:
 *         weeks += 1
 *     return iso(year, weeks, days % 7 + 1)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int ymd_isoyear(int year, int month, int day) except -1:
 */
  __pyx_t_7.year = __pyx_v_year;
  __pyx_t_7.week = __pyx_v_weeks;
  __pyx_t_7.weekday = (__Pyx_mod_long(__pyx_v_days, 7) + 1);
  __pyx_r = __pyx_t_7;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":930
 * 
 * # . iso
 * cdef inline iso ymd_isocalendar(int year, int month, int day) except *:             # <<<<<<<<<<<<<<
 *     """Compute the ISO calendar `<'struct:iso'>`."""
 *     year = min(max(year, 1), 9_999)
 */

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

/* "cytimes/utils.pxd":949
 *     return iso(year, weeks, days % 7 + 1)
 * 
 * cdef inline int ymd_isoyear(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the ISO calendar year (0-10000) `<'int'>`."""
 *     year = min(max(year, 1), 9_999)
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_ymd_isoyear(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) {
  int __pyx_v_ordinal;
  int __pyx_v_mon_1st;
  int __pyx_v_days;
  int __pyx_v_weeks;
  int __pyx_r;
  long __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":951
 * cdef inline int ymd_isoyear(int year, int month, int day) except -1:
 *     """Compute the ISO calendar year (0-10000) `<'int'>`."""
 *     year = min(max(year, 1), 9_999)             # <<<<<<<<<<<<<<
 *     cdef:
 *         int ordinal = ymd_to_ordinal(year, month, day)
 */
  __pyx_t_1 = 0x270F;
  __pyx_t_2 = 1;
  __pyx_t_3 = __pyx_v_year;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_year = __pyx_t_4;

  /* "cytimes/utils.pxd":953
 *     year = min(max(year, 1), 9_999)
 *     cdef:
 *         int ordinal = ymd_to_ordinal(year, month, day)             # <<<<<<<<<<<<<<
 *         int mon_1st = _iso_1st_monday(year)
 *         int days = ordinal - mon_1st
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 953, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_3;

  /* "cytimes/utils.pxd":954
 *     cdef:
 *         int ordinal = ymd_to_ordinal(year, month, day)
 *         int mon_1st = _iso_1st_monday(year)             # <<<<<<<<<<<<<<
 *         int days = ordinal - mon_1st
 *         int weeks = days // 7
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils__iso_1st_monday(__pyx_v_year); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 954, __pyx_L1_error)
  __pyx_v_mon_1st = __pyx_t_3;

  /* "cytimes/utils.pxd":955
 *         int ordinal = ymd_to_ordinal(year, month, day)
 *         int mon_1st = _iso_1st_monday(year)
 *         int days = ordinal - mon_1st             # <<<<<<<<<<<<<<
 *         int weeks = days // 7
 * 
 */
  __pyx_v_days = (__pyx_v_ordinal - __pyx_v_mon_1st);

  /* "cytimes/utils.pxd":956
 *         int mon_1st = _iso_1st_monday(year)
 *         int days = ordinal - mon_1st
 *         int weeks = days // 7             # <<<<<<<<<<<<<<
 * 
 *     if weeks < 0:
 */
  __pyx_v_weeks = __Pyx_div_long(__pyx_v_days, 7);

  /* "cytimes/utils.pxd":958
 *         int weeks = days // 7
 * 
 *     if weeks < 0:             # <<<<<<<<<<<<<<
 *         return year - 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 */
  __pyx_t_5 = (__pyx_v_weeks < 0);
  if (__pyx_t_5) {

    /* "cytimes/utils.pxd":959
 * 
 *     if weeks < 0:
 *         return year - 1             # <<<<<<<<<<<<<<
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 *         return year + 1
 */
    __pyx_r = (__pyx_v_year - 1);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":958
 *         int weeks = days // 7
 * 
 *     if weeks < 0:             # <<<<<<<<<<<<<<
 *         return year - 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 */
  }

  /* "cytimes/utils.pxd":960
 *     if weeks < 0:
 *         return year - 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):             # <<<<<<<<<<<<<<
 *         return year + 1
 *     else:
 */
  __pyx_t_6 = (__pyx_v_weeks >= 52);
  if (__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __pyx_f_7cytimes_5utils__iso_1st_monday((__pyx_v_year + 1)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 960, __pyx_L1_error)
  __pyx_t_6 = (__pyx_v_ordinal >= __pyx_t_3);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_5) {

    /* "cytimes/utils.pxd":961
 *         return year - 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 *         return year + 1             # <<<<<<<<<<<<<<
 *     else:
 *         return year
 */
    __pyx_r = (__pyx_v_year + 1);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":960
 *     if weeks < 0:
 *         return year - 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):             # <<<<<<<<<<<<<<
 *         return year + 1
 *     else:
 */
  }

  /* "cytimes/utils.pxd":963
 *         return year + 1
 *     else:
 *         return year             # <<<<<<<<<<<<<<
 * 
 * cdef inline int ymd_isoweek(int year, int month, int day) except -1:
 */
  /*else*/ {
    __pyx_r = __pyx_v_year;
    goto __pyx_L0;
  }

  /* "cytimes/utils.pxd":949
 *     return iso(year, weeks, days % 7 + 1)
 * 
 * cdef inline int ymd_isoyear(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the ISO calendar year (0-10000) `<'int'>`."""
 *     year = min(max(year, 1), 9_999)
 */

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

/* "cytimes/utils.pxd":965
 *         return year
 * 
 * cdef inline int ymd_isoweek(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the ISO calendar week number (1-53) `<'int'>`."""
 *     year = min(max(year, 1), 9_999)
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_ymd_isoweek(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) {
  int __pyx_v_ordinal;
  int __pyx_v_mon_1st;
  int __pyx_v_days;
  int __pyx_v_weeks;
  int __pyx_r;
  long __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":967
 * cdef inline int ymd_isoweek(int year, int month, int day) except -1:
 *     """Compute the ISO calendar week number (1-53) `<'int'>`."""
 *     year = min(max(year, 1), 9_999)             # <<<<<<<<<<<<<<
 *     cdef:
 *         int ordinal = ymd_to_ordinal(year, month, day)
 */
  __pyx_t_1 = 0x270F;
  __pyx_t_2 = 1;
  __pyx_t_3 = __pyx_v_year;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_year = __pyx_t_4;

  /* "cytimes/utils.pxd":969
 *     year = min(max(year, 1), 9_999)
 *     cdef:
 *         int ordinal = ymd_to_ordinal(year, month, day)             # <<<<<<<<<<<<<<
 *         int mon_1st = _iso_1st_monday(year)
 *         int days = ordinal - mon_1st
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 969, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_3;

  /* "cytimes/utils.pxd":970
 *     cdef:
 *         int ordinal = ymd_to_ordinal(year, month, day)
 *         int mon_1st = _iso_1st_monday(year)             # <<<<<<<<<<<<<<
 *         int days = ordinal - mon_1st
 *         int weeks = days // 7
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils__iso_1st_monday(__pyx_v_year); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 970, __pyx_L1_error)
  __pyx_v_mon_1st = __pyx_t_3;

  /* "cytimes/utils.pxd":971
 *         int ordinal = ymd_to_ordinal(year, month, day)
 *         int mon_1st = _iso_1st_monday(year)
 *         int days = ordinal - mon_1st             # <<<<<<<<<<<<<<
 *         int weeks = days // 7
 * 
 */
  __pyx_v_days = (__pyx_v_ordinal - __pyx_v_mon_1st);

  /* "cytimes/utils.pxd":972
 *         int mon_1st = _iso_1st_monday(year)
 *         int days = ordinal - mon_1st
 *         int weeks = days // 7             # <<<<<<<<<<<<<<
 * 
 *     if weeks < 0:
 */
  __pyx_v_weeks = __Pyx_div_long(__pyx_v_days, 7);

  /* "cytimes/utils.pxd":974
 *         int weeks = days // 7
 * 
 *     if weeks < 0:             # <<<<<<<<<<<<<<
 *         return (ordinal - _iso_1st_monday(year - 1)) // 7 + 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 */
  __pyx_t_5 = (__pyx_v_weeks < 0);
  if (__pyx_t_5) {

    /* "cytimes/utils.pxd":975
 * 
 *     if weeks < 0:
 *         return (ordinal - _iso_1st_monday(year - 1)) // 7 + 1             # <<<<<<<<<<<<<<
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 *         return 1
 */
    __pyx_t_3 = __pyx_f_7cytimes_5utils__iso_1st_monday((__pyx_v_year - 1)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 975, __pyx_L1_error)
    __pyx_r = (__Pyx_div_long((__pyx_v_ordinal - __pyx_t_3), 7) + 1);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":974
 *         int weeks = days // 7
 * 
 *     if weeks < 0:             # <<<<<<<<<<<<<<
 *         return (ordinal - _iso_1st_monday(year - 1)) // 7 + 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 */
  }

  /* "cytimes/utils.pxd":976
 *     if weeks < 0:
 *         return (ordinal - _iso_1st_monday(year - 1)) // 7 + 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):             # <<<<<<<<<<<<<<
 *         return 1
 *     else:
 */
  __pyx_t_6 = (__pyx_v_weeks >= 52);
  if (__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __pyx_f_7cytimes_5utils__iso_1st_monday((__pyx_v_year + 1)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 976, __pyx_L1_error)
  __pyx_t_6 = (__pyx_v_ordinal >= __pyx_t_3);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_5) {

    /* "cytimes/utils.pxd":977
 *         return (ordinal - _iso_1st_monday(year - 1)) // 7 + 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 *         return 1             # <<<<<<<<<<<<<<
 *     else:
 *         return weeks + 1
 */
    __pyx_r = 1;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":976
 *     if weeks < 0:
 *         return (ordinal - _iso_1st_monday(year - 1)) // 7 + 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):             # <<<<<<<<<<<<<<
 *         return 1
 *     else:
 */
  }

  /* "cytimes/utils.pxd":979
 *         return 1
 *     else:
 *         return weeks + 1             # <<<<<<<<<<<<<<
 * 
 * cdef inline int ymd_isoweekday(int year, int month, int day) except -1:
 */
  /*else*/ {
    __pyx_r = (__pyx_v_weeks + 1);
    goto __pyx_L0;
  }

  /* "cytimes/utils.pxd":965
 *         return year
 * 
 * cdef inline int ymd_isoweek(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the ISO calendar week number (1-53) `<'int'>`."""
 *     year = min(max(year, 1), 9_999)
 */

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

/* "cytimes/utils.pxd":981
 *         return weeks + 1
 * 
 * cdef inline int ymd_isoweekday(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the ISO weekday (1=Mon...7=Sun) `<'int'>`."""
 *     return ymd_weekday(year, month, day) + 1
 */

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

  /* "cytimes/utils.pxd":983
 * cdef inline int ymd_isoweekday(int year, int month, int day) except -1:
 *     """Compute the ISO weekday (1=Mon...7=Sun) `<'int'>`."""
 *     return ymd_weekday(year, month, day) + 1             # <<<<<<<<<<<<<<
 * 
 * # . Y/M/D
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_ymd_weekday(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 983, __pyx_L1_error)
  __pyx_r = (__pyx_t_1 + 1);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":981
 *         return weeks + 1
 * 
 * cdef inline int ymd_isoweekday(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the ISO weekday (1=Mon...7=Sun) `<'int'>`."""
 *     return ymd_weekday(year, month, day) + 1
 */

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

/* "cytimes/utils.pxd":986
 * 
 * # . Y/M/D
 * cdef inline int ymd_to_ordinal(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Convert 'Y/M/D' to Gregorian ordinal days `<'int'>`."""
 *     if day > 28:
 */

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

  /* "cytimes/utils.pxd":988
 * cdef inline int ymd_to_ordinal(int year, int month, int day) except -1:
 *     """Convert 'Y/M/D' to Gregorian ordinal days `<'int'>`."""
 *     if day > 28:             # <<<<<<<<<<<<<<
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 */
  __pyx_t_1 = (__pyx_v_day > 28);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":989
 *     """Convert 'Y/M/D' to Gregorian ordinal days `<'int'>`."""
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))             # <<<<<<<<<<<<<<
 *     elif day < 1:
 *         day = 1
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_days_in_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 989, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_day;
    __pyx_t_1 = (__pyx_t_2 < __pyx_t_3);
    if (__pyx_t_1) {
      __pyx_t_4 = __pyx_t_2;
    } else {
      __pyx_t_4 = __pyx_t_3;
    }
    __pyx_v_day = __pyx_t_4;

    /* "cytimes/utils.pxd":988
 * cdef inline int ymd_to_ordinal(int year, int month, int day) except -1:
 *     """Convert 'Y/M/D' to Gregorian ordinal days `<'int'>`."""
 *     if day > 28:             # <<<<<<<<<<<<<<
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 */
    goto __pyx_L3;
  }

  /* "cytimes/utils.pxd":990
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:             # <<<<<<<<<<<<<<
 *         day = 1
 *     return days_bf_year(year) + days_bf_month(year, month) + day
 */
  __pyx_t_1 = (__pyx_v_day < 1);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":991
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 *         day = 1             # <<<<<<<<<<<<<<
 *     return days_bf_year(year) + days_bf_month(year, month) + day
 * 
 */
    __pyx_v_day = 1;

    /* "cytimes/utils.pxd":990
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:             # <<<<<<<<<<<<<<
 *         day = 1
 *     return days_bf_year(year) + days_bf_month(year, month) + day
 */
  }
  __pyx_L3:;

  /* "cytimes/utils.pxd":992
 *     elif day < 1:
 *         day = 1
 *     return days_bf_year(year) + days_bf_month(year, month) + day             # <<<<<<<<<<<<<<
 * 
 * cdef inline ymd ymd_fr_ordinal(int val) except *:
 */
  __pyx_t_4 = __pyx_f_7cytimes_5utils_days_bf_year(__pyx_v_year); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 992, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 992, __pyx_L1_error)
  __pyx_r = ((__pyx_t_4 + __pyx_t_2) + __pyx_v_day);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":986
 * 
 * # . Y/M/D
 * cdef inline int ymd_to_ordinal(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Convert 'Y/M/D' to Gregorian ordinal days `<'int'>`."""
 *     if day > 28:
 */

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

/* "cytimes/utils.pxd":994
 *     return days_bf_year(year) + days_bf_month(year, month) + day
 * 
 * cdef inline ymd ymd_fr_ordinal(int val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:ymd' from Gregorian ordinal days `<'struct:ymd'>`."""
 *     # n is a 1-based index, starting at 1-Jan-1.  The pattern of leap years
 */

static CYTHON_INLINE __pyx_t_7cytimes_5utils_ymd __pyx_f_7cytimes_5utils_ymd_fr_ordinal(int __pyx_v_val) {
  int __pyx_v_n;
  int __pyx_v_n400;
  int __pyx_v_n100;
  int __pyx_v_n4;
  int __pyx_v_n1;
  int __pyx_v_yy;
  int __pyx_v_mm;
  int __pyx_v_days_bf;
  __pyx_t_7cytimes_5utils_ymd __pyx_r;
  int __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":1006
 *         int yy, mm, days_bf
 * 
 *     n = min(max(val, 1), ORDINAL_MAX) - 1             # <<<<<<<<<<<<<<
 *     n400 = n // 146_097
 *     n -= n400 * 146_097
 */
  __pyx_t_1 = __pyx_v_7cytimes_5utils_ORDINAL_MAX;
  __pyx_t_2 = 1;
  __pyx_t_3 = __pyx_v_val;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_n = (__pyx_t_4 - 1);

  /* "cytimes/utils.pxd":1007
 * 
 *     n = min(max(val, 1), ORDINAL_MAX) - 1
 *     n400 = n // 146_097             # <<<<<<<<<<<<<<
 *     n -= n400 * 146_097
 * 
 */
  __pyx_v_n400 = __Pyx_div_long(__pyx_v_n, 0x23AB1);

  /* "cytimes/utils.pxd":1008
 *     n = min(max(val, 1), ORDINAL_MAX) - 1
 *     n400 = n // 146_097
 *     n -= n400 * 146_097             # <<<<<<<<<<<<<<
 * 
 *     # Now n is the (non-negative) offset, in days, from January 1 of year, to
 */
  __pyx_v_n = (__pyx_v_n - (__pyx_v_n400 * 0x23AB1));

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

  /* "cytimes/utils.pxd":1016
 *     # day is December 31 at the end of a 400-year cycle.
 *     n100 = n // 36_524
 *     n -= n100 * 36_524             # <<<<<<<<<<<<<<
 * 
 *     # Now compute how many 4-year cycles precede it.
 */
  __pyx_v_n = (__pyx_v_n - (__pyx_v_n100 * 0x8EAC));

  /* "cytimes/utils.pxd":1019
 * 
 *     # Now compute how many 4-year cycles precede it.
 *     n4 = n // 1_461             # <<<<<<<<<<<<<<
 *     n -= n4 * 1_461
 * 
 */
  __pyx_v_n4 = __Pyx_div_long(__pyx_v_n, 0x5B5);

  /* "cytimes/utils.pxd":1020
 *     # Now compute how many 4-year cycles precede it.
 *     n4 = n // 1_461
 *     n -= n4 * 1_461             # <<<<<<<<<<<<<<
 * 
 *     # And now how many single years.  Again n1 can be 4, and again meaning
 */
  __pyx_v_n = (__pyx_v_n - (__pyx_v_n4 * 0x5B5));

  /* "cytimes/utils.pxd":1024
 *     # And now how many single years.  Again n1 can be 4, and again meaning
 *     # that the desired day is December 31 at the end of the 4-year cycle.
 *     n1 = n // 365             # <<<<<<<<<<<<<<
 *     n -= n1 * 365
 * 
 */
  __pyx_v_n1 = __Pyx_div_long(__pyx_v_n, 0x16D);

  /* "cytimes/utils.pxd":1025
 *     # that the desired day is December 31 at the end of the 4-year cycle.
 *     n1 = n // 365
 *     n -= n1 * 365             # <<<<<<<<<<<<<<
 * 
 *     # We now know the year and the offset from January 1st.  Leap years are
 */
  __pyx_v_n = (__pyx_v_n - (__pyx_v_n1 * 0x16D));

  /* "cytimes/utils.pxd":1033
 *     # whether year is divisible by 4.  If not, then we're done -- the answer
 *     # is December 31 at the end of the year.
 *     yy = n400 * 400 + n100 * 100 + n4 * 4 + n1             # <<<<<<<<<<<<<<
 *     if n1 == 4 or n100 == 4:
 *         return ymd(yy, 12, 31)  # exit: Last day of the year
 */
  __pyx_v_yy = ((((__pyx_v_n400 * 0x190) + (__pyx_v_n100 * 0x64)) + (__pyx_v_n4 * 4)) + __pyx_v_n1);

  /* "cytimes/utils.pxd":1034
 *     # is December 31 at the end of the year.
 *     yy = n400 * 400 + n100 * 100 + n4 * 4 + n1
 *     if n1 == 4 or n100 == 4:             # <<<<<<<<<<<<<<
 *         return ymd(yy, 12, 31)  # exit: Last day of the year
 *     yy += 1
 */
  __pyx_t_6 = (__pyx_v_n1 == 4);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = (__pyx_v_n100 == 4);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_5) {

    /* "cytimes/utils.pxd":1035
 *     yy = n400 * 400 + n100 * 100 + n4 * 4 + n1
 *     if n1 == 4 or n100 == 4:
 *         return ymd(yy, 12, 31)  # exit: Last day of the year             # <<<<<<<<<<<<<<
 *     yy += 1
 * 
 */
    __pyx_t_7.year = __pyx_v_yy;
    __pyx_t_7.month = 12;
    __pyx_t_7.day = 31;
    __pyx_r = __pyx_t_7;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":1034
 *     # is December 31 at the end of the year.
 *     yy = n400 * 400 + n100 * 100 + n4 * 4 + n1
 *     if n1 == 4 or n100 == 4:             # <<<<<<<<<<<<<<
 *         return ymd(yy, 12, 31)  # exit: Last day of the year
 *     yy += 1
 */
  }

  /* "cytimes/utils.pxd":1036
 *     if n1 == 4 or n100 == 4:
 *         return ymd(yy, 12, 31)  # exit: Last day of the year
 *     yy += 1             # <<<<<<<<<<<<<<
 * 
 *     # Now the year is correct, and n is the offset from January 1.  We find
 */
  __pyx_v_yy = (__pyx_v_yy + 1);

  /* "cytimes/utils.pxd":1040
 *     # Now the year is correct, and n is the offset from January 1.  We find
 *     # the month via an estimate that's either exact or one too large.
 *     mm = (n + 50) >> 5             # <<<<<<<<<<<<<<
 *     days_bf = days_bf_month(yy, mm)
 *     if days_bf > n:
 */
  __pyx_v_mm = ((__pyx_v_n + 50) >> 5);

  /* "cytimes/utils.pxd":1041
 *     # the month via an estimate that's either exact or one too large.
 *     mm = (n + 50) >> 5
 *     days_bf = days_bf_month(yy, mm)             # <<<<<<<<<<<<<<
 *     if days_bf > n:
 *         mm -= 1
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_yy, __pyx_v_mm); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1041, __pyx_L1_error)
  __pyx_v_days_bf = __pyx_t_1;

  /* "cytimes/utils.pxd":1042
 *     mm = (n + 50) >> 5
 *     days_bf = days_bf_month(yy, mm)
 *     if days_bf > n:             # <<<<<<<<<<<<<<
 *         mm -= 1
 *         days_bf = days_bf_month(yy, mm)
 */
  __pyx_t_5 = (__pyx_v_days_bf > __pyx_v_n);
  if (__pyx_t_5) {

    /* "cytimes/utils.pxd":1043
 *     days_bf = days_bf_month(yy, mm)
 *     if days_bf > n:
 *         mm -= 1             # <<<<<<<<<<<<<<
 *         days_bf = days_bf_month(yy, mm)
 *     return ymd(yy, mm, n - days_bf + 1)
 */
    __pyx_v_mm = (__pyx_v_mm - 1);

    /* "cytimes/utils.pxd":1044
 *     if days_bf > n:
 *         mm -= 1
 *         days_bf = days_bf_month(yy, mm)             # <<<<<<<<<<<<<<
 *     return ymd(yy, mm, n - days_bf + 1)
 * 
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_yy, __pyx_v_mm); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1044, __pyx_L1_error)
    __pyx_v_days_bf = __pyx_t_1;

    /* "cytimes/utils.pxd":1042
 *     mm = (n + 50) >> 5
 *     days_bf = days_bf_month(yy, mm)
 *     if days_bf > n:             # <<<<<<<<<<<<<<
 *         mm -= 1
 *         days_bf = days_bf_month(yy, mm)
 */
  }

  /* "cytimes/utils.pxd":1045
 *         mm -= 1
 *         days_bf = days_bf_month(yy, mm)
 *     return ymd(yy, mm, n - days_bf + 1)             # <<<<<<<<<<<<<<
 * 
 * cdef inline ymd ymd_fr_isocalendar(int year, int week, int weekday) except *:
 */
  __pyx_t_7.year = __pyx_v_yy;
  __pyx_t_7.month = __pyx_v_mm;
  __pyx_t_7.day = ((__pyx_v_n - __pyx_v_days_bf) + 1);
  __pyx_r = __pyx_t_7;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":994
 *     return days_bf_year(year) + days_bf_month(year, month) + day
 * 
 * cdef inline ymd ymd_fr_ordinal(int val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:ymd' from Gregorian ordinal days `<'struct:ymd'>`."""
 *     # n is a 1-based index, starting at 1-Jan-1.  The pattern of leap years
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.ymd_fr_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/utils.pxd":1047
 *     return ymd(yy, mm, n - days_bf + 1)
 * 
 * cdef inline ymd ymd_fr_isocalendar(int year, int week, int weekday) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:ymd' from ISO calendar values `<'struct:ymd'>`."""
 *     # Clip year
 */

static CYTHON_INLINE __pyx_t_7cytimes_5utils_ymd __pyx_f_7cytimes_5utils_ymd_fr_isocalendar(int __pyx_v_year, int __pyx_v_week, int __pyx_v_weekday) {
  int __pyx_v_wkd_1st;
  int __pyx_v_mon_1st;
  int __pyx_v_offset;
  __pyx_t_7cytimes_5utils_ymd __pyx_r;
  long __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":1050
 *     """Create 'struct:ymd' from ISO calendar values `<'struct:ymd'>`."""
 *     # Clip year
 *     year = min(max(year, 1), 9_999)             # <<<<<<<<<<<<<<
 * 
 *     # 53th week adjustment
 */
  __pyx_t_1 = 0x270F;
  __pyx_t_2 = 1;
  __pyx_t_3 = __pyx_v_year;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_year = __pyx_t_4;

  /* "cytimes/utils.pxd":1054
 *     # 53th week adjustment
 *     cdef int wkd_1st
 *     if week == 53:             # <<<<<<<<<<<<<<
 *         # ISO years have 53 weeks in them on years starting with a
 *         # Thursday or leap years starting on a Wednesday. So for
 */
  __pyx_t_5 = (__pyx_v_week == 53);
  if (__pyx_t_5) {

    /* "cytimes/utils.pxd":1058
 *         # Thursday or leap years starting on a Wednesday. So for
 *         # invalid weeks, we shift to the 1st week of the next year.
 *         wkd_1st = ymd_to_ordinal(year, 1, 1) % 7             # <<<<<<<<<<<<<<
 *         if wkd_1st != 4 and not (wkd_1st == 3 and is_leap_year(year)):
 *             week = 1
 */
    __pyx_t_3 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_v_year, 1, 1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1058, __pyx_L1_error)
    __pyx_v_wkd_1st = __Pyx_mod_long(__pyx_t_3, 7);

    /* "cytimes/utils.pxd":1059
 *         # invalid weeks, we shift to the 1st week of the next year.
 *         wkd_1st = ymd_to_ordinal(year, 1, 1) % 7
 *         if wkd_1st != 4 and not (wkd_1st == 3 and is_leap_year(year)):             # <<<<<<<<<<<<<<
 *             week = 1
 *             year += 1
 */
    __pyx_t_6 = (__pyx_v_wkd_1st != 4);
    if (__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_wkd_1st == 3);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_7 = __pyx_f_7cytimes_5utils_is_leap_year(__pyx_v_year); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1059, __pyx_L1_error)
    __pyx_t_6 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;
    __pyx_t_7 = (!__pyx_t_6);
    __pyx_t_5 = __pyx_t_7;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_5) {

      /* "cytimes/utils.pxd":1060
 *         wkd_1st = ymd_to_ordinal(year, 1, 1) % 7
 *         if wkd_1st != 4 and not (wkd_1st == 3 and is_leap_year(year)):
 *             week = 1             # <<<<<<<<<<<<<<
 *             year += 1
 *     # Clip week
 */
      __pyx_v_week = 1;

      /* "cytimes/utils.pxd":1061
 *         if wkd_1st != 4 and not (wkd_1st == 3 and is_leap_year(year)):
 *             week = 1
 *             year += 1             # <<<<<<<<<<<<<<
 *     # Clip week
 *     else:
 */
      __pyx_v_year = (__pyx_v_year + 1);

      /* "cytimes/utils.pxd":1059
 *         # invalid weeks, we shift to the 1st week of the next year.
 *         wkd_1st = ymd_to_ordinal(year, 1, 1) % 7
 *         if wkd_1st != 4 and not (wkd_1st == 3 and is_leap_year(year)):             # <<<<<<<<<<<<<<
 *             week = 1
 *             year += 1
 */
    }

    /* "cytimes/utils.pxd":1054
 *     # 53th week adjustment
 *     cdef int wkd_1st
 *     if week == 53:             # <<<<<<<<<<<<<<
 *         # ISO years have 53 weeks in them on years starting with a
 *         # Thursday or leap years starting on a Wednesday. So for
 */
    goto __pyx_L3;
  }

  /* "cytimes/utils.pxd":1064
 *     # Clip week
 *     else:
 *         week = min(max(week, 1), 52)             # <<<<<<<<<<<<<<
 * 
 *     # Clip weekday
 */
  /*else*/ {
    __pyx_t_4 = 52;
    __pyx_t_1 = 1;
    __pyx_t_3 = __pyx_v_week;
    __pyx_t_5 = (__pyx_t_1 > __pyx_t_3);
    if (__pyx_t_5) {
      __pyx_t_2 = __pyx_t_1;
    } else {
      __pyx_t_2 = __pyx_t_3;
    }
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_5 = (__pyx_t_4 < __pyx_t_1);
    if (__pyx_t_5) {
      __pyx_t_2 = __pyx_t_4;
    } else {
      __pyx_t_2 = __pyx_t_1;
    }
    __pyx_v_week = __pyx_t_2;
  }
  __pyx_L3:;

  /* "cytimes/utils.pxd":1067
 * 
 *     # Clip weekday
 *     weekday = min(max(weekday, 1), 7)             # <<<<<<<<<<<<<<
 * 
 *     # Compute ordinal
 */
  __pyx_t_2 = 7;
  __pyx_t_4 = 1;
  __pyx_t_3 = __pyx_v_weekday;
  __pyx_t_5 = (__pyx_t_4 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_1 = __pyx_t_4;
  } else {
    __pyx_t_1 = __pyx_t_3;
  }
  __pyx_t_4 = __pyx_t_1;
  __pyx_t_5 = (__pyx_t_2 < __pyx_t_4);
  if (__pyx_t_5) {
    __pyx_t_1 = __pyx_t_2;
  } else {
    __pyx_t_1 = __pyx_t_4;
  }
  __pyx_v_weekday = __pyx_t_1;

  /* "cytimes/utils.pxd":1070
 * 
 *     # Compute ordinal
 *     cdef int mon_1st = _iso_1st_monday(year)             # <<<<<<<<<<<<<<
 *     cdef int offset = (week - 1) * 7 + weekday - 1
 *     return ymd_fr_ordinal(mon_1st + offset)
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils__iso_1st_monday(__pyx_v_year); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1070, __pyx_L1_error)
  __pyx_v_mon_1st = __pyx_t_3;

  /* "cytimes/utils.pxd":1071
 *     # Compute ordinal
 *     cdef int mon_1st = _iso_1st_monday(year)
 *     cdef int offset = (week - 1) * 7 + weekday - 1             # <<<<<<<<<<<<<<
 *     return ymd_fr_ordinal(mon_1st + offset)
 * 
 */
  __pyx_v_offset = ((((__pyx_v_week - 1) * 7) + __pyx_v_weekday) - 1);

  /* "cytimes/utils.pxd":1072
 *     cdef int mon_1st = _iso_1st_monday(year)
 *     cdef int offset = (week - 1) * 7 + weekday - 1
 *     return ymd_fr_ordinal(mon_1st + offset)             # <<<<<<<<<<<<<<
 * 
 * cdef inline ymd ymd_fr_days_of_year(int year, int days) except *:
 */
  __pyx_t_8 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal((__pyx_v_mon_1st + __pyx_v_offset)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1072, __pyx_L1_error)
  __pyx_r = __pyx_t_8;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1047
 *     return ymd(yy, mm, n - days_bf + 1)
 * 
 * cdef inline ymd ymd_fr_isocalendar(int year, int week, int weekday) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:ymd' from ISO calendar values `<'struct:ymd'>`."""
 *     # Clip year
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.ymd_fr_isocalendar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/utils.pxd":1074
 *     return ymd_fr_ordinal(mon_1st + offset)
 * 
 * cdef inline ymd ymd_fr_days_of_year(int year, int days) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:ymd' from the year and days of the year `<'struct:ymd'>`."""
 *     # Clip year
 */

static CYTHON_INLINE __pyx_t_7cytimes_5utils_ymd __pyx_f_7cytimes_5utils_ymd_fr_days_of_year(int __pyx_v_year, int __pyx_v_days) {
  int __pyx_v_leap;
  int __pyx_v_mm;
  int __pyx_v_dd;
  int __pyx_v_days_bf;
  __pyx_t_7cytimes_5utils_ymd __pyx_r;
  long __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":1077
 *     """Create 'struct:ymd' from the year and days of the year `<'struct:ymd'>`."""
 *     # Clip year
 *     year = min(max(year, 1), 9_999)             # <<<<<<<<<<<<<<
 * 
 *     # January
 */
  __pyx_t_1 = 0x270F;
  __pyx_t_2 = 1;
  __pyx_t_3 = __pyx_v_year;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_year = __pyx_t_4;

  /* "cytimes/utils.pxd":1080
 * 
 *     # January
 *     if days <= 31:             # <<<<<<<<<<<<<<
 *         return ymd(year, 1, max(days, 1))
 * 
 */
  __pyx_t_5 = (__pyx_v_days <= 31);
  if (__pyx_t_5) {

    /* "cytimes/utils.pxd":1081
 *     # January
 *     if days <= 31:
 *         return ymd(year, 1, max(days, 1))             # <<<<<<<<<<<<<<
 * 
 *     # February
 */
    __pyx_t_6.year = __pyx_v_year;
    __pyx_t_6.month = 1;
    __pyx_t_4 = 1;
    __pyx_t_3 = __pyx_v_days;
    __pyx_t_5 = (__pyx_t_4 > __pyx_t_3);
    if (__pyx_t_5) {
      __pyx_t_1 = __pyx_t_4;
    } else {
      __pyx_t_1 = __pyx_t_3;
    }
    __pyx_t_6.day = __pyx_t_1;
    __pyx_r = __pyx_t_6;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":1080
 * 
 *     # January
 *     if days <= 31:             # <<<<<<<<<<<<<<
 *         return ymd(year, 1, max(days, 1))
 * 
 */
  }

  /* "cytimes/utils.pxd":1084
 * 
 *     # February
 *     cdef int leap = is_leap_year(year)             # <<<<<<<<<<<<<<
 *     if days <= 59 + leap:
 *         return ymd(year, 2, days - 31)
 */
  __pyx_t_5 = __pyx_f_7cytimes_5utils_is_leap_year(__pyx_v_year); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 1084, __pyx_L1_error)
  __pyx_v_leap = __pyx_t_5;

  /* "cytimes/utils.pxd":1085
 *     # February
 *     cdef int leap = is_leap_year(year)
 *     if days <= 59 + leap:             # <<<<<<<<<<<<<<
 *         return ymd(year, 2, days - 31)
 * 
 */
  __pyx_t_5 = (__pyx_v_days <= (59 + __pyx_v_leap));
  if (__pyx_t_5) {

    /* "cytimes/utils.pxd":1086
 *     cdef int leap = is_leap_year(year)
 *     if days <= 59 + leap:
 *         return ymd(year, 2, days - 31)             # <<<<<<<<<<<<<<
 * 
 *     # Find month & day
 */
    __pyx_t_6.year = __pyx_v_year;
    __pyx_t_6.month = 2;
    __pyx_t_6.day = (__pyx_v_days - 31);
    __pyx_r = __pyx_t_6;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":1085
 *     # February
 *     cdef int leap = is_leap_year(year)
 *     if days <= 59 + leap:             # <<<<<<<<<<<<<<
 *         return ymd(year, 2, days - 31)
 * 
 */
  }

  /* "cytimes/utils.pxd":1090
 *     # Find month & day
 *     cdef int mm, dd, days_bf
 *     days -= leap             # <<<<<<<<<<<<<<
 *     for mm in range(3, 13):
 *         days_bf = DAYS_BR_MONTH[mm]
 */
  __pyx_v_days = (__pyx_v_days - __pyx_v_leap);

  /* "cytimes/utils.pxd":1091
 *     cdef int mm, dd, days_bf
 *     days -= leap
 *     for mm in range(3, 13):             # <<<<<<<<<<<<<<
 *         days_bf = DAYS_BR_MONTH[mm]
 *         if days <= days_bf:
 */
  for (__pyx_t_3 = 3; __pyx_t_3 < 13; __pyx_t_3+=1) {
    __pyx_v_mm = __pyx_t_3;

    /* "cytimes/utils.pxd":1092
 *     days -= leap
 *     for mm in range(3, 13):
 *         days_bf = DAYS_BR_MONTH[mm]             # <<<<<<<<<<<<<<
 *         if days <= days_bf:
 *             dd = days - DAYS_BR_MONTH[mm - 1]
 */
    __pyx_v_days_bf = (__pyx_v_7cytimes_5utils_DAYS_BR_MONTH[__pyx_v_mm]);

    /* "cytimes/utils.pxd":1093
 *     for mm in range(3, 13):
 *         days_bf = DAYS_BR_MONTH[mm]
 *         if days <= days_bf:             # <<<<<<<<<<<<<<
 *             dd = days - DAYS_BR_MONTH[mm - 1]
 *             return ymd(year, mm, dd)
 */
    __pyx_t_5 = (__pyx_v_days <= __pyx_v_days_bf);
    if (__pyx_t_5) {

      /* "cytimes/utils.pxd":1094
 *         days_bf = DAYS_BR_MONTH[mm]
 *         if days <= days_bf:
 *             dd = days - DAYS_BR_MONTH[mm - 1]             # <<<<<<<<<<<<<<
 *             return ymd(year, mm, dd)
 *     return ymd(year, 12, 31)  # last day of the year
 */
      __pyx_v_dd = (__pyx_v_days - (__pyx_v_7cytimes_5utils_DAYS_BR_MONTH[(__pyx_v_mm - 1)]));

      /* "cytimes/utils.pxd":1095
 *         if days <= days_bf:
 *             dd = days - DAYS_BR_MONTH[mm - 1]
 *             return ymd(year, mm, dd)             # <<<<<<<<<<<<<<
 *     return ymd(year, 12, 31)  # last day of the year
 * 
 */
      __pyx_t_6.year = __pyx_v_year;
      __pyx_t_6.month = __pyx_v_mm;
      __pyx_t_6.day = __pyx_v_dd;
      __pyx_r = __pyx_t_6;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":1093
 *     for mm in range(3, 13):
 *         days_bf = DAYS_BR_MONTH[mm]
 *         if days <= days_bf:             # <<<<<<<<<<<<<<
 *             dd = days - DAYS_BR_MONTH[mm - 1]
 *             return ymd(year, mm, dd)
 */
    }
  }

  /* "cytimes/utils.pxd":1096
 *             dd = days - DAYS_BR_MONTH[mm - 1]
 *             return ymd(year, mm, dd)
 *     return ymd(year, 12, 31)  # last day of the year             # <<<<<<<<<<<<<<
 * 
 * cdef inline int _iso_1st_monday(int year) except -1:
 */
  __pyx_t_6.year = __pyx_v_year;
  __pyx_t_6.month = 12;
  __pyx_t_6.day = 31;
  __pyx_r = __pyx_t_6;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1074
 *     return ymd_fr_ordinal(mon_1st + offset)
 * 
 * cdef inline ymd ymd_fr_days_of_year(int year, int days) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:ymd' from the year and days of the year `<'struct:ymd'>`."""
 *     # Clip year
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.ymd_fr_days_of_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/utils.pxd":1098
 *     return ymd(year, 12, 31)  # last day of the year
 * 
 * cdef inline int _iso_1st_monday(int year) except -1:             # <<<<<<<<<<<<<<
 *     """(internla) Compute the Gregorian ordinal days for the
 *     1st Monday of the passed in ISO 'year' `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils__iso_1st_monday(int __pyx_v_year) {
  int __pyx_v_day_1st;
  int __pyx_v_wkd_1st;
  int __pyx_v_mon_1st;
  int __pyx_r;
  int __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":1103
 *     """
 *     cdef:
 *         int day_1st = ymd_to_ordinal(year, 1, 1)  # 1st day of the year             # <<<<<<<<<<<<<<
 *         int wkd_1st = (day_1st + 6) % 7  # 1st weekday of the year
 *         int mon_1st = day_1st - wkd_1st  # 1st Monday of the year
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_v_year, 1, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1103, __pyx_L1_error)
  __pyx_v_day_1st = __pyx_t_1;

  /* "cytimes/utils.pxd":1104
 *     cdef:
 *         int day_1st = ymd_to_ordinal(year, 1, 1)  # 1st day of the year
 *         int wkd_1st = (day_1st + 6) % 7  # 1st weekday of the year             # <<<<<<<<<<<<<<
 *         int mon_1st = day_1st - wkd_1st  # 1st Monday of the year
 *     return mon_1st + 7 if wkd_1st > 3 else mon_1st
 */
  __pyx_v_wkd_1st = __Pyx_mod_long((__pyx_v_day_1st + 6), 7);

  /* "cytimes/utils.pxd":1105
 *         int day_1st = ymd_to_ordinal(year, 1, 1)  # 1st day of the year
 *         int wkd_1st = (day_1st + 6) % 7  # 1st weekday of the year
 *         int mon_1st = day_1st - wkd_1st  # 1st Monday of the year             # <<<<<<<<<<<<<<
 *     return mon_1st + 7 if wkd_1st > 3 else mon_1st
 * 
 */
  __pyx_v_mon_1st = (__pyx_v_day_1st - __pyx_v_wkd_1st);

  /* "cytimes/utils.pxd":1106
 *         int wkd_1st = (day_1st + 6) % 7  # 1st weekday of the year
 *         int mon_1st = day_1st - wkd_1st  # 1st Monday of the year
 *     return mon_1st + 7 if wkd_1st > 3 else mon_1st             # <<<<<<<<<<<<<<
 * 
 * # datetime.date ----------------------------------------------------------------------------------------
 */
  __pyx_t_3 = (__pyx_v_wkd_1st > 3);
  if (__pyx_t_3) {
    __pyx_t_2 = (__pyx_v_mon_1st + 7);
  } else {
    __pyx_t_2 = __pyx_v_mon_1st;
  }
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1098
 *     return ymd(year, 12, 31)  # last day of the year
 * 
 * cdef inline int _iso_1st_monday(int year) except -1:             # <<<<<<<<<<<<<<
 *     """(internla) Compute the Gregorian ordinal days for the
 *     1st Monday of the passed in ISO 'year' `<'int'>`.
 */

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

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

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_new(struct __pyx_opt_args_7cytimes_5utils_date_new *__pyx_optional_args) {
  int __pyx_v_year = ((int)1);
  int __pyx_v_month = ((int)1);
  int __pyx_v_day = ((int)1);
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_new", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_year = __pyx_optional_args->year;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_month = __pyx_optional_args->month;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_day = __pyx_optional_args->day;
        }
      }
    }
  }

  /* "cytimes/utils.pxd":1116
 *     >>> datetime.date(year, month, day)
 *     """
 *     year = min(max(year, 1), 9_999)             # <<<<<<<<<<<<<<
 *     month = min(max(month, 1), 12)
 *     if day > 28:
 */
  __pyx_t_1 = 0x270F;
  __pyx_t_2 = 1;
  __pyx_t_3 = __pyx_v_year;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_year = __pyx_t_4;

  /* "cytimes/utils.pxd":1117
 *     """
 *     year = min(max(year, 1), 9_999)
 *     month = min(max(month, 1), 12)             # <<<<<<<<<<<<<<
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 */
  __pyx_t_4 = 12;
  __pyx_t_1 = 1;
  __pyx_t_3 = __pyx_v_month;
  __pyx_t_5 = (__pyx_t_1 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  __pyx_t_1 = __pyx_t_2;
  __pyx_t_5 = (__pyx_t_4 < __pyx_t_1);
  if (__pyx_t_5) {
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_1;
  }
  __pyx_v_month = __pyx_t_2;

  /* "cytimes/utils.pxd":1118
 *     year = min(max(year, 1), 9_999)
 *     month = min(max(month, 1), 12)
 *     if day > 28:             # <<<<<<<<<<<<<<
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 */
  __pyx_t_5 = (__pyx_v_day > 28);
  if (__pyx_t_5) {

    /* "cytimes/utils.pxd":1119
 *     month = min(max(month, 1), 12)
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))             # <<<<<<<<<<<<<<
 *     elif day < 1:
 *         day = 1
 */
    __pyx_t_3 = __pyx_f_7cytimes_5utils_days_in_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1119, __pyx_L1_error)
    __pyx_t_6 = __pyx_v_day;
    __pyx_t_5 = (__pyx_t_3 < __pyx_t_6);
    if (__pyx_t_5) {
      __pyx_t_7 = __pyx_t_3;
    } else {
      __pyx_t_7 = __pyx_t_6;
    }
    __pyx_v_day = __pyx_t_7;

    /* "cytimes/utils.pxd":1118
 *     year = min(max(year, 1), 9_999)
 *     month = min(max(month, 1), 12)
 *     if day > 28:             # <<<<<<<<<<<<<<
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 */
    goto __pyx_L3;
  }

  /* "cytimes/utils.pxd":1120
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:             # <<<<<<<<<<<<<<
 *         day = 1
 *     return datetime.date_new(year, month, day)
 */
  __pyx_t_5 = (__pyx_v_day < 1);
  if (__pyx_t_5) {

    /* "cytimes/utils.pxd":1121
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 *         day = 1             # <<<<<<<<<<<<<<
 *     return datetime.date_new(year, month, day)
 * 
 */
    __pyx_v_day = 1;

    /* "cytimes/utils.pxd":1120
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:             # <<<<<<<<<<<<<<
 *         day = 1
 *     return datetime.date_new(year, month, day)
 */
  }
  __pyx_L3:;

  /* "cytimes/utils.pxd":1122
 *     elif day < 1:
 *         day = 1
 *     return datetime.date_new(year, month, day)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.date date_now(object tz=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_8 = ((PyObject *)__pyx_f_7cpython_8datetime_date_new(__pyx_v_year, __pyx_v_month, __pyx_v_day)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_8);
  __pyx_t_8 = 0;
  goto __pyx_L0;

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

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

/* "cytimes/utils.pxd":1124
 *     return datetime.date_new(year, month, day)
 * 
 * cdef inline datetime.date date_now(object tz=None):             # <<<<<<<<<<<<<<
 *     """Get the current date `<'datetime.date'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_now(struct __pyx_opt_args_7cytimes_5utils_date_now *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  struct tm __pyx_v__tm;
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp __pyx_t_4;
  struct tm __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_now", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "cytimes/utils.pxd":1131
 *     """
 *     # With timezone
 *     if tz is not None:             # <<<<<<<<<<<<<<
 *         return date_fr_dt(datetime.datetime_from_timestamp(unix_time(), tz))
 * 
 */
  __pyx_t_1 = (__pyx_v_tz != Py_None);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":1132
 *     # With timezone
 *     if tz is not None:
 *         return date_fr_dt(datetime.datetime_from_timestamp(unix_time(), tz))             # <<<<<<<<<<<<<<
 * 
 *     # With timezone
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_f_7cpython_4time_time()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.tz = __pyx_v_tz;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_from_timestamp(__pyx_t_2, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_date_fr_dt(((PyDateTime_DateTime *)__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":1131
 *     """
 *     # With timezone
 *     if tz is not None:             # <<<<<<<<<<<<<<
 *         return date_fr_dt(datetime.datetime_from_timestamp(unix_time(), tz))
 * 
 */
  }

  /* "cytimes/utils.pxd":1135
 * 
 *     # With timezone
 *     _tm = tm_localtime(unix_time())             # <<<<<<<<<<<<<<
 *     return datetime.date_new(_tm.tm_year, _tm.tm_mon, _tm.tm_mday)
 * 
 */
  __pyx_t_5 = __pyx_f_7cytimes_5utils_tm_localtime(__pyx_f_7cpython_4time_time()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1135, __pyx_L1_error)
  __pyx_v__tm = __pyx_t_5;

  /* "cytimes/utils.pxd":1136
 *     # With timezone
 *     _tm = tm_localtime(unix_time())
 *     return datetime.date_new(_tm.tm_year, _tm.tm_mon, _tm.tm_mday)             # <<<<<<<<<<<<<<
 * 
 * # . type check
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_date_new(__pyx_v__tm.tm_year, __pyx_v__tm.tm_mon, __pyx_v__tm.tm_mday)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1124
 *     return datetime.date_new(year, month, day)
 * 
 * cdef inline datetime.date date_now(object tz=None):             # <<<<<<<<<<<<<<
 *     """Get the current date `<'datetime.date'>`.
 * 
 */

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

/* "cytimes/utils.pxd":1139
 * 
 * # . type check
 * cdef inline bint is_date(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.date `<'bool'>`.
 * 
 */

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

  /* "cytimes/utils.pxd":1145
 *     >>> isinstance(obj, datetime.date)
 *     """
 *     return datetime.PyDate_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_date_exact(object obj) except -1:
 */
  __pyx_r = PyDate_Check(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1139
 * 
 * # . type check
 * cdef inline bint is_date(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.date `<'bool'>`.
 * 
 */

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

/* "cytimes/utils.pxd":1147
 *     return datetime.PyDate_Check(obj)
 * 
 * cdef inline bint is_date_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.date type `<'bool'>`.
 * 
 */

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

  /* "cytimes/utils.pxd":1153
 *     >>> type(obj) is datetime.date
 *     """
 *     return datetime.PyDate_CheckExact(obj)             # <<<<<<<<<<<<<<
 * 
 * # . conversion: to
 */
  __pyx_r = PyDate_CheckExact(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1147
 *     return datetime.PyDate_Check(obj)
 * 
 * cdef inline bint is_date_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.date type `<'bool'>`.
 * 
 */

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

/* "cytimes/utils.pxd":1156
 * 
 * # . conversion: to
 * cdef inline tm date_to_tm(datetime.date date) except *:             # <<<<<<<<<<<<<<
 *     """Convert date to `<'struct:tm'>`.
 * 
 */

static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_date_to_tm(PyDateTime_Date *__pyx_v_date) {
  int __pyx_v_yy;
  int __pyx_v_mm;
  int __pyx_v_dd;
  struct tm __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  struct tm __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":1162
 *     """
 *     cdef int yy, mm, dd
 *     yy, mm, dd = date.year, date.month, date.day             # <<<<<<<<<<<<<<
 *     return tm(
 *         0, 0, 0, # sec, min, hour
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date);
  __pyx_t_2 = __pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date);
  __pyx_t_3 = __pyx_f_7cpython_8datetime_4date_3day_day(__pyx_v_date);
  __pyx_v_yy = __pyx_t_1;
  __pyx_v_mm = __pyx_t_2;
  __pyx_v_dd = __pyx_t_3;

  /* "cytimes/utils.pxd":1163
 *     cdef int yy, mm, dd
 *     yy, mm, dd = date.year, date.month, date.day
 *     return tm(             # <<<<<<<<<<<<<<
 *         0, 0, 0, # sec, min, hour
 *         dd, mm, yy,  # day, mon, year
 */
  __pyx_t_4.tm_sec = 0;
  __pyx_t_4.tm_min = 0;
  __pyx_t_4.tm_hour = 0;

  /* "cytimes/utils.pxd":1165
 *     return tm(
 *         0, 0, 0, # sec, min, hour
 *         dd, mm, yy,  # day, mon, year             # <<<<<<<<<<<<<<
 *         ymd_weekday(yy, mm, dd),  # wday
 *         days_bf_month(yy, mm) + dd,  # yday
 */
  __pyx_t_4.tm_mday = __pyx_v_dd;
  __pyx_t_4.tm_mon = __pyx_v_mm;
  __pyx_t_4.tm_year = __pyx_v_yy;

  /* "cytimes/utils.pxd":1166
 *         0, 0, 0, # sec, min, hour
 *         dd, mm, yy,  # day, mon, year
 *         ymd_weekday(yy, mm, dd),  # wday             # <<<<<<<<<<<<<<
 *         days_bf_month(yy, mm) + dd,  # yday
 *         -1  # isdst
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_ymd_weekday(__pyx_v_yy, __pyx_v_mm, __pyx_v_dd); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1166, __pyx_L1_error)
  __pyx_t_4.tm_wday = __pyx_t_3;

  /* "cytimes/utils.pxd":1167
 *         dd, mm, yy,  # day, mon, year
 *         ymd_weekday(yy, mm, dd),  # wday
 *         days_bf_month(yy, mm) + dd,  # yday             # <<<<<<<<<<<<<<
 *         -1  # isdst
 *     )
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_yy, __pyx_v_mm); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1167, __pyx_L1_error)
  __pyx_t_4.tm_yday = (__pyx_t_3 + __pyx_v_dd);
  __pyx_t_4.tm_isdst = -1;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1156
 * 
 * # . conversion: to
 * cdef inline tm date_to_tm(datetime.date date) except *:             # <<<<<<<<<<<<<<
 *     """Convert date to `<'struct:tm'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.date_to_tm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/utils.pxd":1171
 *     )
 * 
 * cdef inline str date_to_strformat(datetime.date date, str fmt):             # <<<<<<<<<<<<<<
 *     """Convert date to string according to the given format `<'str'>`.
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_date_to_strformat(PyDateTime_Date *__pyx_v_date, PyObject *__pyx_v_fmt) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct tm __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_to_strformat", 1);

  /* "cytimes/utils.pxd":1177
 *     >>> date.strftime(fmt)
 *     """
 *     return tm_strftime(date_to_tm(date), fmt)             # <<<<<<<<<<<<<<
 * 
 * cdef inline str date_to_isoformat(datetime.date date):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytimes_5utils_date_to_tm(__pyx_v_date); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7cytimes_5utils_tm_strftime(__pyx_t_1, __pyx_v_fmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1171
 *     )
 * 
 * cdef inline str date_to_strformat(datetime.date date, str fmt):             # <<<<<<<<<<<<<<
 *     """Convert date to string according to the given format `<'str'>`.
 * 
 */

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

/* "cytimes/utils.pxd":1179
 *     return tm_strftime(date_to_tm(date), fmt)
 * 
 * cdef inline str date_to_isoformat(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Convert date to string in ISO format ('%Y-%m-%d') `<'str'>`."""
 *     return "%04d-%02d-%02d" % (date.year, date.month, date.day)
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_date_to_isoformat(PyDateTime_Date *__pyx_v_date) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_to_isoformat", 1);

  /* "cytimes/utils.pxd":1181
 * cdef inline str date_to_isoformat(datetime.date date):
 *     """Convert date to string in ISO format ('%Y-%m-%d') `<'str'>`."""
 *     return "%04d-%02d-%02d" % (date.year, date.month, date.day)             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long date_to_us(datetime.date date):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date), 4, '0', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__9);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__9);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__9);
  __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date), 2, '0', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__9);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__9);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__9);
  __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4date_3day_day(__pyx_v_date), 2, '0', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1179
 *     return tm_strftime(date_to_tm(date), fmt)
 * 
 * cdef inline str date_to_isoformat(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Convert date to string in ISO format ('%Y-%m-%d') `<'str'>`."""
 *     return "%04d-%02d-%02d" % (date.year, date.month, date.day)
 */

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

/* "cytimes/utils.pxd":1183
 *     return "%04d-%02d-%02d" % (date.year, date.month, date.day)
 * 
 * cdef inline long long date_to_us(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Convert date to `EPOCH` microseconds `<'int'>`."""
 *     cdef long long ordinal = date_to_ordinal(date)
 */

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

  /* "cytimes/utils.pxd":1185
 * cdef inline long long date_to_us(datetime.date date):
 *     """Convert date to `EPOCH` microseconds `<'int'>`."""
 *     cdef long long ordinal = date_to_ordinal(date)             # <<<<<<<<<<<<<<
 *     return (ordinal - EPOCH_DAY) * US_DAY
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_date_to_ordinal(__pyx_v_date); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1185, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "cytimes/utils.pxd":1186
 *     """Convert date to `EPOCH` microseconds `<'int'>`."""
 *     cdef long long ordinal = date_to_ordinal(date)
 *     return (ordinal - EPOCH_DAY) * US_DAY             # <<<<<<<<<<<<<<
 * 
 * cdef inline double date_to_seconds(datetime.date date):
 */
  __pyx_r = ((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_US_DAY);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1183
 *     return "%04d-%02d-%02d" % (date.year, date.month, date.day)
 * 
 * cdef inline long long date_to_us(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Convert date to `EPOCH` microseconds `<'int'>`."""
 *     cdef long long ordinal = date_to_ordinal(date)
 */

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

/* "cytimes/utils.pxd":1188
 *     return (ordinal - EPOCH_DAY) * US_DAY
 * 
 * cdef inline double date_to_seconds(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Convert date to `EPOCH` seconds `<'float'>`."""
 *     cdef long long ordinal = date_to_ordinal(date)
 */

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

  /* "cytimes/utils.pxd":1190
 * cdef inline double date_to_seconds(datetime.date date):
 *     """Convert date to `EPOCH` seconds `<'float'>`."""
 *     cdef long long ordinal = date_to_ordinal(date)             # <<<<<<<<<<<<<<
 *     return (ordinal - EPOCH_DAY) * SS_DAY
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_date_to_ordinal(__pyx_v_date); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1190, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "cytimes/utils.pxd":1191
 *     """Convert date to `EPOCH` seconds `<'float'>`."""
 *     cdef long long ordinal = date_to_ordinal(date)
 *     return (ordinal - EPOCH_DAY) * SS_DAY             # <<<<<<<<<<<<<<
 * 
 * cdef inline int date_to_ordinal(datetime.date date) except -1:
 */
  __pyx_r = ((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_SS_DAY);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1188
 *     return (ordinal - EPOCH_DAY) * US_DAY
 * 
 * cdef inline double date_to_seconds(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Convert date to `EPOCH` seconds `<'float'>`."""
 *     cdef long long ordinal = date_to_ordinal(date)
 */

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

/* "cytimes/utils.pxd":1193
 *     return (ordinal - EPOCH_DAY) * SS_DAY
 * 
 * cdef inline int date_to_ordinal(datetime.date date) except -1:             # <<<<<<<<<<<<<<
 *     """Convert date to Gregorian ordinal days `<'int'>`."""
 *     return ymd_to_ordinal(date.year, date.month, date.day)
 */

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

  /* "cytimes/utils.pxd":1195
 * cdef inline int date_to_ordinal(datetime.date date) except -1:
 *     """Convert date to Gregorian ordinal days `<'int'>`."""
 *     return ymd_to_ordinal(date.year, date.month, date.day)             # <<<<<<<<<<<<<<
 * 
 * cdef inline double date_to_ts(datetime.date date):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date), __pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date), __pyx_f_7cpython_8datetime_4date_3day_day(__pyx_v_date)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1195, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1193
 *     return (ordinal - EPOCH_DAY) * SS_DAY
 * 
 * cdef inline int date_to_ordinal(datetime.date date) except -1:             # <<<<<<<<<<<<<<
 *     """Convert date to Gregorian ordinal days `<'int'>`."""
 *     return ymd_to_ordinal(date.year, date.month, date.day)
 */

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

/* "cytimes/utils.pxd":1197
 *     return ymd_to_ordinal(date.year, date.month, date.day)
 * 
 * cdef inline double date_to_ts(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Convert date to `EPOCH` timestamp `<'float'>`."""
 *     cdef:
 */

static CYTHON_INLINE double __pyx_f_7cytimes_5utils_date_to_ts(PyDateTime_Date *__pyx_v_date) {
  PY_LONG_LONG __pyx_v_ordinal;
  PY_LONG_LONG __pyx_v_ss;
  double __pyx_r;
  int __pyx_t_1;
  PY_LONG_LONG __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":1200
 *     """Convert date to `EPOCH` timestamp `<'float'>`."""
 *     cdef:
 *         long long ordinal = date_to_ordinal(date)             # <<<<<<<<<<<<<<
 *         long long ss = (ordinal - EPOCH_DAY) * SS_DAY
 *     return ss * 2 - ts_localtime(ss)
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_date_to_ordinal(__pyx_v_date); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1200, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "cytimes/utils.pxd":1201
 *     cdef:
 *         long long ordinal = date_to_ordinal(date)
 *         long long ss = (ordinal - EPOCH_DAY) * SS_DAY             # <<<<<<<<<<<<<<
 *     return ss * 2 - ts_localtime(ss)
 * 
 */
  __pyx_v_ss = ((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_SS_DAY);

  /* "cytimes/utils.pxd":1202
 *         long long ordinal = date_to_ordinal(date)
 *         long long ss = (ordinal - EPOCH_DAY) * SS_DAY
 *     return ss * 2 - ts_localtime(ss)             # <<<<<<<<<<<<<<
 * 
 * # . conversion: from
 */
  __pyx_t_2 = __pyx_f_7cytimes_5utils_ts_localtime(__pyx_v_ss); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 1202, __pyx_L1_error)
  __pyx_r = ((__pyx_v_ss * 2) - __pyx_t_2);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1197
 *     return ymd_to_ordinal(date.year, date.month, date.day)
 * 
 * cdef inline double date_to_ts(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Convert date to `EPOCH` timestamp `<'float'>`."""
 *     cdef:
 */

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

/* "cytimes/utils.pxd":1205
 * 
 * # . conversion: from
 * cdef inline datetime.date date_fr_us(long long val):             # <<<<<<<<<<<<<<
 *     """Create date from `EPOCH` microseconds (int) `<'datetime.date'>`."""
 *     return date_fr_ordinal(math_floor_div(val + EPOCH_MICROSECOND, US_DAY))
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_us(PY_LONG_LONG __pyx_v_val) {
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PY_LONG_LONG __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_fr_us", 1);

  /* "cytimes/utils.pxd":1207
 * cdef inline datetime.date date_fr_us(long long val):
 *     """Create date from `EPOCH` microseconds (int) `<'datetime.date'>`."""
 *     return date_fr_ordinal(math_floor_div(val + EPOCH_MICROSECOND, US_DAY))             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.date date_fr_seconds(double val):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __pyx_f_7cytimes_5utils_math_floor_div((__pyx_v_val + __pyx_v_7cytimes_5utils_EPOCH_MICROSECOND), __pyx_v_7cytimes_5utils_US_DAY, NULL); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 1207, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_date_fr_ordinal(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1205
 * 
 * # . conversion: from
 * cdef inline datetime.date date_fr_us(long long val):             # <<<<<<<<<<<<<<
 *     """Create date from `EPOCH` microseconds (int) `<'datetime.date'>`."""
 *     return date_fr_ordinal(math_floor_div(val + EPOCH_MICROSECOND, US_DAY))
 */

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

/* "cytimes/utils.pxd":1209
 *     return date_fr_ordinal(math_floor_div(val + EPOCH_MICROSECOND, US_DAY))
 * 
 * cdef inline datetime.date date_fr_seconds(double val):             # <<<<<<<<<<<<<<
 *     """Create date from `EPOCH` seconds (float) `<'datetime.date'>`."""
 *     cdef long long sec = int(val)
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_seconds(double __pyx_v_val) {
  PY_LONG_LONG __pyx_v_sec;
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_fr_seconds", 1);

  /* "cytimes/utils.pxd":1211
 * cdef inline datetime.date date_fr_seconds(double val):
 *     """Create date from `EPOCH` seconds (float) `<'datetime.date'>`."""
 *     cdef long long sec = int(val)             # <<<<<<<<<<<<<<
 *     return date_fr_ordinal(sec // 86_400 + EPOCH_DAY)
 * 
 */
  __pyx_v_sec = ((PY_LONG_LONG)__pyx_v_val);

  /* "cytimes/utils.pxd":1212
 *     """Create date from `EPOCH` seconds (float) `<'datetime.date'>`."""
 *     cdef long long sec = int(val)
 *     return date_fr_ordinal(sec // 86_400 + EPOCH_DAY)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.date date_fr_ordinal(int val):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_date_fr_ordinal((__Pyx_div_PY_LONG_LONG(__pyx_v_sec, 0x15180) + __pyx_v_7cytimes_5utils_EPOCH_DAY))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1209
 *     return date_fr_ordinal(math_floor_div(val + EPOCH_MICROSECOND, US_DAY))
 * 
 * cdef inline datetime.date date_fr_seconds(double val):             # <<<<<<<<<<<<<<
 *     """Create date from `EPOCH` seconds (float) `<'datetime.date'>`."""
 *     cdef long long sec = int(val)
 */

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

/* "cytimes/utils.pxd":1214
 *     return date_fr_ordinal(sec // 86_400 + EPOCH_DAY)
 * 
 * cdef inline datetime.date date_fr_ordinal(int val):             # <<<<<<<<<<<<<<
 *     """Create date from Gregorian ordinal days `<'datetime.date'>`."""
 *     _ymd = ymd_fr_ordinal(val)
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_ordinal(int __pyx_v_val) {
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_7cytimes_5utils_ymd __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_fr_ordinal", 1);

  /* "cytimes/utils.pxd":1216
 * cdef inline datetime.date date_fr_ordinal(int val):
 *     """Create date from Gregorian ordinal days `<'datetime.date'>`."""
 *     _ymd = ymd_fr_ordinal(val)             # <<<<<<<<<<<<<<
 *     return datetime.date_new(_ymd.year, _ymd.month, _ymd.day)
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(__pyx_v_val); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1216, __pyx_L1_error)
  __pyx_v__ymd = __pyx_t_1;

  /* "cytimes/utils.pxd":1217
 *     """Create date from Gregorian ordinal days `<'datetime.date'>`."""
 *     _ymd = ymd_fr_ordinal(val)
 *     return datetime.date_new(_ymd.year, _ymd.month, _ymd.day)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.date date_fr_ts(double val):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_date_new(__pyx_v__ymd.year, __pyx_v__ymd.month, __pyx_v__ymd.day)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1214
 *     return date_fr_ordinal(sec // 86_400 + EPOCH_DAY)
 * 
 * cdef inline datetime.date date_fr_ordinal(int val):             # <<<<<<<<<<<<<<
 *     """Create date from Gregorian ordinal days `<'datetime.date'>`."""
 *     _ymd = ymd_fr_ordinal(val)
 */

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

/* "cytimes/utils.pxd":1219
 *     return datetime.date_new(_ymd.year, _ymd.month, _ymd.day)
 * 
 * cdef inline datetime.date date_fr_ts(double val):             # <<<<<<<<<<<<<<
 *     """Create date from `EPOCH` timestamp (float) `<'datetime.date'>`."""
 *     return datetime.date_from_timestamp(val)
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_ts(double __pyx_v_val) {
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_fr_ts", 1);

  /* "cytimes/utils.pxd":1221
 * cdef inline datetime.date date_fr_ts(double val):
 *     """Create date from `EPOCH` timestamp (float) `<'datetime.date'>`."""
 *     return datetime.date_from_timestamp(val)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.date date_fr_date(datetime.date date):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_date_from_timestamp(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1219
 *     return datetime.date_new(_ymd.year, _ymd.month, _ymd.day)
 * 
 * cdef inline datetime.date date_fr_ts(double val):             # <<<<<<<<<<<<<<
 *     """Create date from `EPOCH` timestamp (float) `<'datetime.date'>`."""
 *     return datetime.date_from_timestamp(val)
 */

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

/* "cytimes/utils.pxd":1223
 *     return datetime.date_from_timestamp(val)
 * 
 * cdef inline datetime.date date_fr_date(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Create date from another date (include subclass) `<'datetime.date'>`."""
 *     return datetime.date_new(date.year, date.month, date.day)
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_date(PyDateTime_Date *__pyx_v_date) {
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_fr_date", 1);

  /* "cytimes/utils.pxd":1225
 * cdef inline datetime.date date_fr_date(datetime.date date):
 *     """Create date from another date (include subclass) `<'datetime.date'>`."""
 *     return datetime.date_new(date.year, date.month, date.day)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.date date_fr_dt(datetime.datetime dt):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cpython_8datetime_date_new(__pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date), __pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date), __pyx_f_7cpython_8datetime_4date_3day_day(__pyx_v_date))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1223
 *     return datetime.date_from_timestamp(val)
 * 
 * cdef inline datetime.date date_fr_date(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Create date from another date (include subclass) `<'datetime.date'>`."""
 *     return datetime.date_new(date.year, date.month, date.day)
 */

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

/* "cytimes/utils.pxd":1227
 *     return datetime.date_new(date.year, date.month, date.day)
 * 
 * cdef inline datetime.date date_fr_dt(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Create date from datetime (include subclass) `<'datetime.date'>`."""
 *     return datetime.date_new(dt.year, dt.month, dt.day)
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_dt(PyDateTime_DateTime *__pyx_v_dt) {
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_fr_dt", 1);

  /* "cytimes/utils.pxd":1229
 * cdef inline datetime.date date_fr_dt(datetime.datetime dt):
 *     """Create date from datetime (include subclass) `<'datetime.date'>`."""
 *     return datetime.date_new(dt.year, dt.month, dt.day)             # <<<<<<<<<<<<<<
 * 
 * # datetime.datetime ------------------------------------------------------------------------------------
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cpython_8datetime_date_new(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1227
 *     return datetime.date_new(date.year, date.month, date.day)
 * 
 * cdef inline datetime.date date_fr_dt(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Create date from datetime (include subclass) `<'datetime.date'>`."""
 *     return datetime.date_new(dt.year, dt.month, dt.day)
 */

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

/* "cytimes/utils.pxd":1233
 * # datetime.datetime ------------------------------------------------------------------------------------
 * # . generate
 * cdef inline datetime.datetime dt_new(             # <<<<<<<<<<<<<<
 *     int year=1, int month=1, int day=1,
 *     int hour=0, int minute=0, int second=0,
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_new(struct __pyx_opt_args_7cytimes_5utils_dt_new *__pyx_optional_args) {
  int __pyx_v_year = ((int)1);
  int __pyx_v_month = ((int)1);
  int __pyx_v_day = ((int)1);
  int __pyx_v_hour = ((int)0);
  int __pyx_v_minute = ((int)0);
  int __pyx_v_second = ((int)0);
  int __pyx_v_microsecond = ((int)0);

  /* "cytimes/utils.pxd":1236
 *     int year=1, int month=1, int day=1,
 *     int hour=0, int minute=0, int second=0,
 *     int microsecond=0, object tz=None, int fold=0,             # <<<<<<<<<<<<<<
 * ):
 *     """Create a new datetime `<'datetime.datetime'>`.
 */
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  int __pyx_v_fold = ((int)0);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_new", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_year = __pyx_optional_args->year;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_month = __pyx_optional_args->month;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_day = __pyx_optional_args->day;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_hour = __pyx_optional_args->hour;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_minute = __pyx_optional_args->minute;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_second = __pyx_optional_args->second;
                if (__pyx_optional_args->__pyx_n > 6) {
                  __pyx_v_microsecond = __pyx_optional_args->microsecond;
                  if (__pyx_optional_args->__pyx_n > 7) {
                    __pyx_v_tz = __pyx_optional_args->tz;
                    if (__pyx_optional_args->__pyx_n > 8) {
                      __pyx_v_fold = __pyx_optional_args->fold;
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }

  /* "cytimes/utils.pxd":1243
 *     >>> datetime.datetime(year, month, day, hour, minute, second, microsecond, tz, fold)
 *     """
 *     year = min(max(year, 1), 9_999)             # <<<<<<<<<<<<<<
 *     month = min(max(month, 1), 12)
 *     if day > 28:
 */
  __pyx_t_1 = 0x270F;
  __pyx_t_2 = 1;
  __pyx_t_3 = __pyx_v_year;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_year = __pyx_t_4;

  /* "cytimes/utils.pxd":1244
 *     """
 *     year = min(max(year, 1), 9_999)
 *     month = min(max(month, 1), 12)             # <<<<<<<<<<<<<<
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 */
  __pyx_t_4 = 12;
  __pyx_t_1 = 1;
  __pyx_t_3 = __pyx_v_month;
  __pyx_t_5 = (__pyx_t_1 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  __pyx_t_1 = __pyx_t_2;
  __pyx_t_5 = (__pyx_t_4 < __pyx_t_1);
  if (__pyx_t_5) {
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_1;
  }
  __pyx_v_month = __pyx_t_2;

  /* "cytimes/utils.pxd":1245
 *     year = min(max(year, 1), 9_999)
 *     month = min(max(month, 1), 12)
 *     if day > 28:             # <<<<<<<<<<<<<<
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 */
  __pyx_t_5 = (__pyx_v_day > 28);
  if (__pyx_t_5) {

    /* "cytimes/utils.pxd":1246
 *     month = min(max(month, 1), 12)
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))             # <<<<<<<<<<<<<<
 *     elif day < 1:
 *         day = 1
 */
    __pyx_t_3 = __pyx_f_7cytimes_5utils_days_in_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1246, __pyx_L1_error)
    __pyx_t_6 = __pyx_v_day;
    __pyx_t_5 = (__pyx_t_3 < __pyx_t_6);
    if (__pyx_t_5) {
      __pyx_t_7 = __pyx_t_3;
    } else {
      __pyx_t_7 = __pyx_t_6;
    }
    __pyx_v_day = __pyx_t_7;

    /* "cytimes/utils.pxd":1245
 *     year = min(max(year, 1), 9_999)
 *     month = min(max(month, 1), 12)
 *     if day > 28:             # <<<<<<<<<<<<<<
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 */
    goto __pyx_L3;
  }

  /* "cytimes/utils.pxd":1247
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:             # <<<<<<<<<<<<<<
 *         day = 1
 *     hour = min(max(hour, 0), 23)
 */
  __pyx_t_5 = (__pyx_v_day < 1);
  if (__pyx_t_5) {

    /* "cytimes/utils.pxd":1248
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 *         day = 1             # <<<<<<<<<<<<<<
 *     hour = min(max(hour, 0), 23)
 *     minute = min(max(minute, 0), 59)
 */
    __pyx_v_day = 1;

    /* "cytimes/utils.pxd":1247
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:             # <<<<<<<<<<<<<<
 *         day = 1
 *     hour = min(max(hour, 0), 23)
 */
  }
  __pyx_L3:;

  /* "cytimes/utils.pxd":1249
 *     elif day < 1:
 *         day = 1
 *     hour = min(max(hour, 0), 23)             # <<<<<<<<<<<<<<
 *     minute = min(max(minute, 0), 59)
 *     second = min(max(second, 0), 59)
 */
  __pyx_t_2 = 23;
  __pyx_t_4 = 0;
  __pyx_t_7 = __pyx_v_hour;
  __pyx_t_5 = (__pyx_t_4 > __pyx_t_7);
  if (__pyx_t_5) {
    __pyx_t_1 = __pyx_t_4;
  } else {
    __pyx_t_1 = __pyx_t_7;
  }
  __pyx_t_4 = __pyx_t_1;
  __pyx_t_5 = (__pyx_t_2 < __pyx_t_4);
  if (__pyx_t_5) {
    __pyx_t_1 = __pyx_t_2;
  } else {
    __pyx_t_1 = __pyx_t_4;
  }
  __pyx_v_hour = __pyx_t_1;

  /* "cytimes/utils.pxd":1250
 *         day = 1
 *     hour = min(max(hour, 0), 23)
 *     minute = min(max(minute, 0), 59)             # <<<<<<<<<<<<<<
 *     second = min(max(second, 0), 59)
 *     microsecond = min(max(microsecond, 0), 999_999)
 */
  __pyx_t_1 = 59;
  __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_v_minute;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_7);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_7;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_minute = __pyx_t_4;

  /* "cytimes/utils.pxd":1251
 *     hour = min(max(hour, 0), 23)
 *     minute = min(max(minute, 0), 59)
 *     second = min(max(second, 0), 59)             # <<<<<<<<<<<<<<
 *     microsecond = min(max(microsecond, 0), 999_999)
 *     return datetime.datetime_new(
 */
  __pyx_t_4 = 59;
  __pyx_t_1 = 0;
  __pyx_t_7 = __pyx_v_second;
  __pyx_t_5 = (__pyx_t_1 > __pyx_t_7);
  if (__pyx_t_5) {
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_7;
  }
  __pyx_t_1 = __pyx_t_2;
  __pyx_t_5 = (__pyx_t_4 < __pyx_t_1);
  if (__pyx_t_5) {
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_1;
  }
  __pyx_v_second = __pyx_t_2;

  /* "cytimes/utils.pxd":1252
 *     minute = min(max(minute, 0), 59)
 *     second = min(max(second, 0), 59)
 *     microsecond = min(max(microsecond, 0), 999_999)             # <<<<<<<<<<<<<<
 *     return datetime.datetime_new(
 *         year, month, day,
 */
  __pyx_t_2 = 0xF423F;
  __pyx_t_4 = 0;
  __pyx_t_7 = __pyx_v_microsecond;
  __pyx_t_5 = (__pyx_t_4 > __pyx_t_7);
  if (__pyx_t_5) {
    __pyx_t_1 = __pyx_t_4;
  } else {
    __pyx_t_1 = __pyx_t_7;
  }
  __pyx_t_4 = __pyx_t_1;
  __pyx_t_5 = (__pyx_t_2 < __pyx_t_4);
  if (__pyx_t_5) {
    __pyx_t_1 = __pyx_t_2;
  } else {
    __pyx_t_1 = __pyx_t_4;
  }
  __pyx_v_microsecond = __pyx_t_1;

  /* "cytimes/utils.pxd":1253
 *     second = min(max(second, 0), 59)
 *     microsecond = min(max(microsecond, 0), 999_999)
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         year, month, day,
 *         hour, minute, second, microsecond,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/utils.pxd":1256
 *         year, month, day,
 *         hour, minute, second, microsecond,
 *         tz, 1 if fold == 1 else 0,             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_5 = (__pyx_v_fold == 1);
  if (__pyx_t_5) {
    __pyx_t_7 = 1;
  } else {
    __pyx_t_7 = 0;
  }

  /* "cytimes/utils.pxd":1253
 *     second = min(max(second, 0), 59)
 *     microsecond = min(max(microsecond, 0), 999_999)
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         year, month, day,
 *         hour, minute, second, microsecond,
 */
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.fold = __pyx_t_7;
  __pyx_t_8 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v_year, __pyx_v_month, __pyx_v_day, __pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, &__pyx_t_9)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_8);
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1233
 * # datetime.datetime ------------------------------------------------------------------------------------
 * # . generate
 * cdef inline datetime.datetime dt_new(             # <<<<<<<<<<<<<<
 *     int year=1, int month=1, int day=1,
 *     int hour=0, int minute=0, int second=0,
 */

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

/* "cytimes/utils.pxd":1259
 *     )
 * 
 * cdef inline datetime.datetime dt_now(object tz=None):             # <<<<<<<<<<<<<<
 *     """Get the current datetime `<'datetime.datetime'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_now(struct __pyx_opt_args_7cytimes_5utils_dt_now *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  double __pyx_v_ts;
  PY_LONG_LONG __pyx_v_us;
  struct tm __pyx_v__tm;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp __pyx_t_4;
  struct tm __pyx_t_5;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_now", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "cytimes/utils.pxd":1266
 *     """
 *     # With timezone
 *     if tz is not None:             # <<<<<<<<<<<<<<
 *         return datetime.datetime_from_timestamp(unix_time(), tz)
 * 
 */
  __pyx_t_1 = (__pyx_v_tz != Py_None);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":1267
 *     # With timezone
 *     if tz is not None:
 *         return datetime.datetime_from_timestamp(unix_time(), tz)             # <<<<<<<<<<<<<<
 * 
 *     # Without timezone
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_f_7cpython_4time_time()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.tz = __pyx_v_tz;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_from_timestamp(__pyx_t_2, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((PyDateTime_DateTime *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":1266
 *     """
 *     # With timezone
 *     if tz is not None:             # <<<<<<<<<<<<<<
 *         return datetime.datetime_from_timestamp(unix_time(), tz)
 * 
 */
  }

  /* "cytimes/utils.pxd":1270
 * 
 *     # Without timezone
 *     cdef double ts = unix_time()             # <<<<<<<<<<<<<<
 *     cdef long long us = int(ts * 1_000_000)
 *     _tm = tm_localtime(ts)
 */
  __pyx_v_ts = __pyx_f_7cpython_4time_time();

  /* "cytimes/utils.pxd":1271
 *     # Without timezone
 *     cdef double ts = unix_time()
 *     cdef long long us = int(ts * 1_000_000)             # <<<<<<<<<<<<<<
 *     _tm = tm_localtime(ts)
 *     return datetime.datetime_new(
 */
  __pyx_v_us = ((PY_LONG_LONG)(__pyx_v_ts * 1000000.0));

  /* "cytimes/utils.pxd":1272
 *     cdef double ts = unix_time()
 *     cdef long long us = int(ts * 1_000_000)
 *     _tm = tm_localtime(ts)             # <<<<<<<<<<<<<<
 *     return datetime.datetime_new(
 *         _tm.tm_year, _tm.tm_mon, _tm.tm_mday,
 */
  __pyx_t_5 = __pyx_f_7cytimes_5utils_tm_localtime(__pyx_v_ts); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1272, __pyx_L1_error)
  __pyx_v__tm = __pyx_t_5;

  /* "cytimes/utils.pxd":1273
 *     cdef long long us = int(ts * 1_000_000)
 *     _tm = tm_localtime(ts)
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         _tm.tm_year, _tm.tm_mon, _tm.tm_mday,
 *         _tm.tm_hour, _tm.tm_min, _tm.tm_sec,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/utils.pxd":1276
 *         _tm.tm_year, _tm.tm_mon, _tm.tm_mday,
 *         _tm.tm_hour, _tm.tm_min, _tm.tm_sec,
 *         us % 1_000_000, None, 0,             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.fold = 0;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v__tm.tm_year, __pyx_v__tm.tm_mon, __pyx_v__tm.tm_mday, __pyx_v__tm.tm_hour, __pyx_v__tm.tm_min, __pyx_v__tm.tm_sec, __Pyx_mod_PY_LONG_LONG(__pyx_v_us, 0xF4240), Py_None, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1259
 *     )
 * 
 * cdef inline datetime.datetime dt_now(object tz=None):             # <<<<<<<<<<<<<<
 *     """Get the current datetime `<'datetime.datetime'>`.
 * 
 */

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

/* "cytimes/utils.pxd":1280
 * 
 * # . type check
 * cdef inline bint is_dt(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.datetime `<'bool'>`.
 * 
 */

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

  /* "cytimes/utils.pxd":1286
 *     >>> isinstance(obj, datetime.datetime)
 *     """
 *     return datetime.PyDateTime_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_dt_exact(object obj) except -1:
 */
  __pyx_r = PyDateTime_Check(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1280
 * 
 * # . type check
 * cdef inline bint is_dt(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.datetime `<'bool'>`.
 * 
 */

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

/* "cytimes/utils.pxd":1288
 *     return datetime.PyDateTime_Check(obj)
 * 
 * cdef inline bint is_dt_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.datetime type `<'bool'>`.
 * 
 */

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

  /* "cytimes/utils.pxd":1294
 *     >>> type(obj) is datetime.datetime
 *     """
 *     return datetime.PyDateTime_CheckExact(obj)             # <<<<<<<<<<<<<<
 * 
 * # . tzinfo
 */
  __pyx_r = PyDateTime_CheckExact(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1288
 *     return datetime.PyDateTime_Check(obj)
 * 
 * cdef inline bint is_dt_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.datetime type `<'bool'>`.
 * 
 */

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

/* "cytimes/utils.pxd":1297
 * 
 * # . tzinfo
 * cdef inline str dt_tzname(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'tzname' of the datetime `<'str/None'>`.
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_dt_tzname(PyDateTime_DateTime *__pyx_v_dt) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_name __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_tzname", 1);

  /* "cytimes/utils.pxd":1303
 *     >>> dt.tzname()
 *     """
 *     return tz_name(dt.tzinfo, dt)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta dt_dst(datetime.datetime dt):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.dt = __pyx_v_dt;
  __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_name(__pyx_t_1, &__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1297
 * 
 * # . tzinfo
 * cdef inline str dt_tzname(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'tzname' of the datetime `<'str/None'>`.
 * 
 */

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

/* "cytimes/utils.pxd":1305
 *     return tz_name(dt.tzinfo, dt)
 * 
 * cdef inline datetime.timedelta dt_dst(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'dst' of the datetime `<'datetime.timedelta/None'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_dt_dst(PyDateTime_DateTime *__pyx_v_dt) {
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_dst __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_dst", 1);

  /* "cytimes/utils.pxd":1311
 *     >>> dt.dst()
 *     """
 *     return tz_dst(dt.tzinfo, dt)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta dt_utcoffset(datetime.datetime dt):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.dt = __pyx_v_dt;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_dst(__pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1305
 *     return tz_name(dt.tzinfo, dt)
 * 
 * cdef inline datetime.timedelta dt_dst(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'dst' of the datetime `<'datetime.timedelta/None'>`.
 * 
 */

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

/* "cytimes/utils.pxd":1313
 *     return tz_dst(dt.tzinfo, dt)
 * 
 * cdef inline datetime.timedelta dt_utcoffset(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'utcoffset' of the datetime `<'datetime.timedelta/None'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_dt_utcoffset(PyDateTime_DateTime *__pyx_v_dt) {
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_utcoffset", 1);

  /* "cytimes/utils.pxd":1319
 *     >>> dt.utcoffset()
 *     """
 *     return tz_utcoffset(dt.tzinfo, dt)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.datetime dt_normalize_tz(datetime.datetime dt):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.dt = __pyx_v_dt;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1313
 *     return tz_dst(dt.tzinfo, dt)
 * 
 * cdef inline datetime.timedelta dt_utcoffset(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'utcoffset' of the datetime `<'datetime.timedelta/None'>`.
 * 
 */

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

/* "cytimes/utils.pxd":1321
 *     return tz_utcoffset(dt.tzinfo, dt)
 * 
 * cdef inline datetime.datetime dt_normalize_tz(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Normalize the datetime to its tzinfo `<'datetime.datetime'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_normalize_tz(PyDateTime_DateTime *__pyx_v_dt) {
  PyObject *__pyx_v_tz = NULL;
  int __pyx_v_off0;
  int __pyx_v_off1;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset_seconds __pyx_t_4;
  struct __pyx_opt_args_7cytimes_5utils_dt_add __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_normalize_tz", 1);

  /* "cytimes/utils.pxd":1327
 *     datetime by normalizing it to its timezone.
 *     """
 *     tz = dt.tzinfo             # <<<<<<<<<<<<<<
 *     if tz is None:
 *         return dt
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":1328
 *     """
 *     tz = dt.tzinfo
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return dt
 * 
 */
  __pyx_t_2 = (__pyx_v_tz == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":1329
 *     tz = dt.tzinfo
 *     if tz is None:
 *         return dt             # <<<<<<<<<<<<<<
 * 
 *     cdef int off0, off1
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_dt);
    __pyx_r = __pyx_v_dt;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":1328
 *     """
 *     tz = dt.tzinfo
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return dt
 * 
 */
  }

  /* "cytimes/utils.pxd":1332
 * 
 *     cdef int off0, off1
 *     if dt.fold == 1:             # <<<<<<<<<<<<<<
 *         off0 = tz_utcoffset_seconds(tz, dt_replace_fold(dt, 0))
 *         off1 = tz_utcoffset_seconds(tz, dt)
 */
  __pyx_t_2 = (__pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt) == 1);
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":1333
 *     cdef int off0, off1
 *     if dt.fold == 1:
 *         off0 = tz_utcoffset_seconds(tz, dt_replace_fold(dt, 0))             # <<<<<<<<<<<<<<
 *         off1 = tz_utcoffset_seconds(tz, dt)
 *     else:
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_replace_fold(__pyx_v_dt, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.dt = ((PyDateTime_DateTime *)__pyx_t_1);
    __pyx_t_3 = __pyx_f_7cytimes_5utils_tz_utcoffset_seconds(__pyx_v_tz, &__pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-200000))) __PYX_ERR(0, 1333, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_off0 = __pyx_t_3;

    /* "cytimes/utils.pxd":1334
 *     if dt.fold == 1:
 *         off0 = tz_utcoffset_seconds(tz, dt_replace_fold(dt, 0))
 *         off1 = tz_utcoffset_seconds(tz, dt)             # <<<<<<<<<<<<<<
 *     else:
 *         off0 = tz_utcoffset_seconds(tz, dt)
 */
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.dt = __pyx_v_dt;
    __pyx_t_3 = __pyx_f_7cytimes_5utils_tz_utcoffset_seconds(__pyx_v_tz, &__pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-200000))) __PYX_ERR(0, 1334, __pyx_L1_error)
    __pyx_v_off1 = __pyx_t_3;

    /* "cytimes/utils.pxd":1332
 * 
 *     cdef int off0, off1
 *     if dt.fold == 1:             # <<<<<<<<<<<<<<
 *         off0 = tz_utcoffset_seconds(tz, dt_replace_fold(dt, 0))
 *         off1 = tz_utcoffset_seconds(tz, dt)
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":1336
 *         off1 = tz_utcoffset_seconds(tz, dt)
 *     else:
 *         off0 = tz_utcoffset_seconds(tz, dt)             # <<<<<<<<<<<<<<
 *         off1 = tz_utcoffset_seconds(tz, dt_replace_fold(dt, 1))
 * 
 */
  /*else*/ {
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.dt = __pyx_v_dt;
    __pyx_t_3 = __pyx_f_7cytimes_5utils_tz_utcoffset_seconds(__pyx_v_tz, &__pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-200000))) __PYX_ERR(0, 1336, __pyx_L1_error)
    __pyx_v_off0 = __pyx_t_3;

    /* "cytimes/utils.pxd":1337
 *     else:
 *         off0 = tz_utcoffset_seconds(tz, dt)
 *         off1 = tz_utcoffset_seconds(tz, dt_replace_fold(dt, 1))             # <<<<<<<<<<<<<<
 * 
 *     if off0 == off1:
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_replace_fold(__pyx_v_dt, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.dt = ((PyDateTime_DateTime *)__pyx_t_1);
    __pyx_t_3 = __pyx_f_7cytimes_5utils_tz_utcoffset_seconds(__pyx_v_tz, &__pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-200000))) __PYX_ERR(0, 1337, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_off1 = __pyx_t_3;
  }
  __pyx_L4:;

  /* "cytimes/utils.pxd":1339
 *         off1 = tz_utcoffset_seconds(tz, dt_replace_fold(dt, 1))
 * 
 *     if off0 == off1:             # <<<<<<<<<<<<<<
 *         return dt
 * 
 */
  __pyx_t_2 = (__pyx_v_off0 == __pyx_v_off1);
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":1340
 * 
 *     if off0 == off1:
 *         return dt             # <<<<<<<<<<<<<<
 * 
 *     if off1 > off0:
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_dt);
    __pyx_r = __pyx_v_dt;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":1339
 *         off1 = tz_utcoffset_seconds(tz, dt_replace_fold(dt, 1))
 * 
 *     if off0 == off1:             # <<<<<<<<<<<<<<
 *         return dt
 * 
 */
  }

  /* "cytimes/utils.pxd":1342
 *         return dt
 * 
 *     if off1 > off0:             # <<<<<<<<<<<<<<
 *         return dt_add(dt, 0, off1 - off0, 0)
 * 
 */
  __pyx_t_2 = (__pyx_v_off1 > __pyx_v_off0);
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":1343
 * 
 *     if off1 > off0:
 *         return dt_add(dt, 0, off1 - off0, 0)             # <<<<<<<<<<<<<<
 * 
 *     raise ValueError("datetime '%s' is ambiguous." % dt)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5.__pyx_n = 3;
    __pyx_t_5.days = 0;
    __pyx_t_5.seconds = (__pyx_v_off1 - __pyx_v_off0);
    __pyx_t_5.microseconds = 0;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_add(__pyx_v_dt, &__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":1342
 *         return dt
 * 
 *     if off1 > off0:             # <<<<<<<<<<<<<<
 *         return dt_add(dt, 0, off1 - off0, 0)
 * 
 */
  }

  /* "cytimes/utils.pxd":1345
 *         return dt_add(dt, 0, off1 - off0, 0)
 * 
 *     raise ValueError("datetime '%s' is ambiguous." % dt)             # <<<<<<<<<<<<<<
 * 
 * # . conversion: to
 */
  __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_datetime_s_is_ambiguous, ((PyObject *)__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __PYX_ERR(0, 1345, __pyx_L1_error)

  /* "cytimes/utils.pxd":1321
 *     return tz_utcoffset(dt.tzinfo, dt)
 * 
 * cdef inline datetime.datetime dt_normalize_tz(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Normalize the datetime to its tzinfo `<'datetime.datetime'>`.
 * 
 */

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

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

static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_dt_to_tm(PyDateTime_DateTime *__pyx_v_dt, struct __pyx_opt_args_7cytimes_5utils_dt_to_tm *__pyx_optional_args) {
  int __pyx_v_utc = ((int)0);
  PyObject *__pyx_v_tz = 0;
  int __pyx_v_yy;
  int __pyx_v_mm;
  int __pyx_v_dd;
  int __pyx_v_isdst;
  PyDateTime_Delta *__pyx_v_utc_off = NULL;
  PyDateTime_Delta *__pyx_v_dst_off = NULL;
  struct tm __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils_dt_add __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_tz_dst __pyx_t_8;
  struct tm __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_tm", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_utc = __pyx_optional_args->utc;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_dt);

  /* "cytimes/utils.pxd":1355
 *     """
 *     cdef:
 *         object tz = dt.tzinfo             # <<<<<<<<<<<<<<
 *         int yy, mm, dd, isdst
 * 
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":1359
 * 
 *     # No timezone
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         isdst = 0 if utc else -1
 *         yy, mm, dd = dt.year, dt.month, dt.day
 */
  __pyx_t_2 = (__pyx_v_tz == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":1360
 *     # No timezone
 *     if tz is None:
 *         isdst = 0 if utc else -1             # <<<<<<<<<<<<<<
 *         yy, mm, dd = dt.year, dt.month, dt.day
 * 
 */
    if (__pyx_v_utc) {
      __pyx_t_3 = 0;
    } else {
      __pyx_t_3 = -1;
    }
    __pyx_v_isdst = __pyx_t_3;

    /* "cytimes/utils.pxd":1361
 *     if tz is None:
 *         isdst = 0 if utc else -1
 *         yy, mm, dd = dt.year, dt.month, dt.day             # <<<<<<<<<<<<<<
 * 
 *     # Has timezone
 */
    __pyx_t_3 = __pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt);
    __pyx_t_4 = __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt);
    __pyx_t_5 = __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt);
    __pyx_v_yy = __pyx_t_3;
    __pyx_v_mm = __pyx_t_4;
    __pyx_v_dd = __pyx_t_5;

    /* "cytimes/utils.pxd":1359
 * 
 *     # No timezone
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         isdst = 0 if utc else -1
 *         yy, mm, dd = dt.year, dt.month, dt.day
 */
    goto __pyx_L3;
  }

  /* "cytimes/utils.pxd":1365
 *     # Has timezone
 *     else:
 *         if utc:             # <<<<<<<<<<<<<<
 *             utc_off = tz_utcoffset(tz, dt)
 *             if utc_off is not None:
 */
  /*else*/ {
    if (__pyx_v_utc) {

      /* "cytimes/utils.pxd":1366
 *     else:
 *         if utc:
 *             utc_off = tz_utcoffset(tz, dt)             # <<<<<<<<<<<<<<
 *             if utc_off is not None:
 *                 dt = dt_add(
 */
      __pyx_t_6.__pyx_n = 1;
      __pyx_t_6.dt = __pyx_v_dt;
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_v_tz, &__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_utc_off = ((PyDateTime_Delta *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "cytimes/utils.pxd":1367
 *         if utc:
 *             utc_off = tz_utcoffset(tz, dt)
 *             if utc_off is not None:             # <<<<<<<<<<<<<<
 *                 dt = dt_add(
 *                     dt,
 */
      __pyx_t_2 = (((PyObject *)__pyx_v_utc_off) != Py_None);
      if (__pyx_t_2) {

        /* "cytimes/utils.pxd":1368
 *             utc_off = tz_utcoffset(tz, dt)
 *             if utc_off is not None:
 *                 dt = dt_add(             # <<<<<<<<<<<<<<
 *                     dt,
 *                     -datetime.timedelta_days(utc_off),
 */
        __pyx_t_7.__pyx_n = 3;
        __pyx_t_7.days = (-__pyx_f_7cpython_8datetime_timedelta_days(((PyObject *)__pyx_v_utc_off)));
        __pyx_t_7.seconds = (-__pyx_f_7cpython_8datetime_timedelta_seconds(((PyObject *)__pyx_v_utc_off)));
        __pyx_t_7.microseconds = (-__pyx_f_7cpython_8datetime_timedelta_microseconds(((PyObject *)__pyx_v_utc_off)));
        __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_add(__pyx_v_dt, &__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_1));
        __pyx_t_1 = 0;

        /* "cytimes/utils.pxd":1367
 *         if utc:
 *             utc_off = tz_utcoffset(tz, dt)
 *             if utc_off is not None:             # <<<<<<<<<<<<<<
 *                 dt = dt_add(
 *                     dt,
 */
      }

      /* "cytimes/utils.pxd":1374
 *                     -datetime.timedelta_microseconds(utc_off),
 *                 )
 *             isdst = 0             # <<<<<<<<<<<<<<
 *         else:
 *             dst_off = tz_dst(tz, dt)
 */
      __pyx_v_isdst = 0;

      /* "cytimes/utils.pxd":1365
 *     # Has timezone
 *     else:
 *         if utc:             # <<<<<<<<<<<<<<
 *             utc_off = tz_utcoffset(tz, dt)
 *             if utc_off is not None:
 */
      goto __pyx_L4;
    }

    /* "cytimes/utils.pxd":1376
 *             isdst = 0
 *         else:
 *             dst_off = tz_dst(tz, dt)             # <<<<<<<<<<<<<<
 *             if dst_off is not None:
 *                 isdst = 1 if dst_off else 0
 */
    /*else*/ {
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.dt = __pyx_v_dt;
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_dst(__pyx_v_tz, &__pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_dst_off = ((PyDateTime_Delta *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "cytimes/utils.pxd":1377
 *         else:
 *             dst_off = tz_dst(tz, dt)
 *             if dst_off is not None:             # <<<<<<<<<<<<<<
 *                 isdst = 1 if dst_off else 0
 *             else:
 */
      __pyx_t_2 = (((PyObject *)__pyx_v_dst_off) != Py_None);
      if (__pyx_t_2) {

        /* "cytimes/utils.pxd":1378
 *             dst_off = tz_dst(tz, dt)
 *             if dst_off is not None:
 *                 isdst = 1 if dst_off else 0             # <<<<<<<<<<<<<<
 *             else:
 *                 isdst = -1
 */
        __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_dst_off)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1378, __pyx_L1_error)
        if (__pyx_t_2) {
          __pyx_t_5 = 1;
        } else {
          __pyx_t_5 = 0;
        }
        __pyx_v_isdst = __pyx_t_5;

        /* "cytimes/utils.pxd":1377
 *         else:
 *             dst_off = tz_dst(tz, dt)
 *             if dst_off is not None:             # <<<<<<<<<<<<<<
 *                 isdst = 1 if dst_off else 0
 *             else:
 */
        goto __pyx_L6;
      }

      /* "cytimes/utils.pxd":1380
 *                 isdst = 1 if dst_off else 0
 *             else:
 *                 isdst = -1             # <<<<<<<<<<<<<<
 *         yy, mm, dd = dt.year, dt.month, dt.day
 * 
 */
      /*else*/ {
        __pyx_v_isdst = -1;
      }
      __pyx_L6:;
    }
    __pyx_L4:;

    /* "cytimes/utils.pxd":1381
 *             else:
 *                 isdst = -1
 *         yy, mm, dd = dt.year, dt.month, dt.day             # <<<<<<<<<<<<<<
 * 
 *     # New 'struct:tm'
 */
    __pyx_t_5 = __pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt);
    __pyx_t_4 = __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt);
    __pyx_t_3 = __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt);
    __pyx_v_yy = __pyx_t_5;
    __pyx_v_mm = __pyx_t_4;
    __pyx_v_dd = __pyx_t_3;
  }
  __pyx_L3:;

  /* "cytimes/utils.pxd":1385
 *     # New 'struct:tm'
 *     return tm(
 *         dt.second, dt.minute, dt.hour,  # sec, min, hour             # <<<<<<<<<<<<<<
 *         dd, mm, yy,  # day, mon, year
 *         ymd_weekday(yy, mm, dd),  # wday
 */
  __pyx_t_9.tm_sec = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);
  __pyx_t_9.tm_min = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
  __pyx_t_9.tm_hour = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);

  /* "cytimes/utils.pxd":1386
 *     return tm(
 *         dt.second, dt.minute, dt.hour,  # sec, min, hour
 *         dd, mm, yy,  # day, mon, year             # <<<<<<<<<<<<<<
 *         ymd_weekday(yy, mm, dd),  # wday
 *         days_bf_month(yy, mm) + dd,  # yday
 */
  __pyx_t_9.tm_mday = __pyx_v_dd;
  __pyx_t_9.tm_mon = __pyx_v_mm;
  __pyx_t_9.tm_year = __pyx_v_yy;

  /* "cytimes/utils.pxd":1387
 *         dt.second, dt.minute, dt.hour,  # sec, min, hour
 *         dd, mm, yy,  # day, mon, year
 *         ymd_weekday(yy, mm, dd),  # wday             # <<<<<<<<<<<<<<
 *         days_bf_month(yy, mm) + dd,  # yday
 *         isdst,  # isdst
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_ymd_weekday(__pyx_v_yy, __pyx_v_mm, __pyx_v_dd); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1387, __pyx_L1_error)
  __pyx_t_9.tm_wday = __pyx_t_3;

  /* "cytimes/utils.pxd":1388
 *         dd, mm, yy,  # day, mon, year
 *         ymd_weekday(yy, mm, dd),  # wday
 *         days_bf_month(yy, mm) + dd,  # yday             # <<<<<<<<<<<<<<
 *         isdst,  # isdst
 *     )
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_yy, __pyx_v_mm); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1388, __pyx_L1_error)
  __pyx_t_9.tm_yday = (__pyx_t_3 + __pyx_v_dd);

  /* "cytimes/utils.pxd":1389
 *         ymd_weekday(yy, mm, dd),  # wday
 *         days_bf_month(yy, mm) + dd,  # yday
 *         isdst,  # isdst             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_9.tm_isdst = __pyx_v_isdst;
  __pyx_r = __pyx_t_9;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt_to_tm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XDECREF((PyObject *)__pyx_v_utc_off);
  __Pyx_XDECREF((PyObject *)__pyx_v_dst_off);
  __Pyx_XDECREF((PyObject *)__pyx_v_dt);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":1392
 *     )
 * 
 * cdef inline str dt_to_ctime(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Convert datetime to string in C time format `<'str'>`.
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_dt_to_ctime(PyDateTime_DateTime *__pyx_v_dt) {
  int __pyx_v_yy;
  int __pyx_v_mm;
  int __pyx_v_dd;
  int __pyx_v_wkd;
  PyObject *__pyx_v_weekday = 0;
  PyObject *__pyx_v_month = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_ctime", 1);

  /* "cytimes/utils.pxd":1401
 * 
 *     # Weekday
 *     yy, mm, dd = dt.year, dt.month, dt.day             # <<<<<<<<<<<<<<
 *     wkd = ymd_weekday(yy, mm, dd)
 *     if wkd == 0:
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt);
  __pyx_t_2 = __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt);
  __pyx_t_3 = __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt);
  __pyx_v_yy = __pyx_t_1;
  __pyx_v_mm = __pyx_t_2;
  __pyx_v_dd = __pyx_t_3;

  /* "cytimes/utils.pxd":1402
 *     # Weekday
 *     yy, mm, dd = dt.year, dt.month, dt.day
 *     wkd = ymd_weekday(yy, mm, dd)             # <<<<<<<<<<<<<<
 *     if wkd == 0:
 *         weekday = "Mon"
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_ymd_weekday(__pyx_v_yy, __pyx_v_mm, __pyx_v_dd); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1402, __pyx_L1_error)
  __pyx_v_wkd = __pyx_t_3;

  /* "cytimes/utils.pxd":1403
 *     yy, mm, dd = dt.year, dt.month, dt.day
 *     wkd = ymd_weekday(yy, mm, dd)
 *     if wkd == 0:             # <<<<<<<<<<<<<<
 *         weekday = "Mon"
 *     elif wkd == 1:
 */
  switch (__pyx_v_wkd) {
    case 0:

    /* "cytimes/utils.pxd":1404
 *     wkd = ymd_weekday(yy, mm, dd)
 *     if wkd == 0:
 *         weekday = "Mon"             # <<<<<<<<<<<<<<
 *     elif wkd == 1:
 *         weekday = "Tue"
 */
    __Pyx_INCREF(__pyx_n_u_Mon);
    __pyx_v_weekday = __pyx_n_u_Mon;

    /* "cytimes/utils.pxd":1403
 *     yy, mm, dd = dt.year, dt.month, dt.day
 *     wkd = ymd_weekday(yy, mm, dd)
 *     if wkd == 0:             # <<<<<<<<<<<<<<
 *         weekday = "Mon"
 *     elif wkd == 1:
 */
    break;
    case 1:

    /* "cytimes/utils.pxd":1406
 *         weekday = "Mon"
 *     elif wkd == 1:
 *         weekday = "Tue"             # <<<<<<<<<<<<<<
 *     elif wkd == 2:
 *         weekday = "Wed"
 */
    __Pyx_INCREF(__pyx_n_u_Tue);
    __pyx_v_weekday = __pyx_n_u_Tue;

    /* "cytimes/utils.pxd":1405
 *     if wkd == 0:
 *         weekday = "Mon"
 *     elif wkd == 1:             # <<<<<<<<<<<<<<
 *         weekday = "Tue"
 *     elif wkd == 2:
 */
    break;
    case 2:

    /* "cytimes/utils.pxd":1408
 *         weekday = "Tue"
 *     elif wkd == 2:
 *         weekday = "Wed"             # <<<<<<<<<<<<<<
 *     elif wkd == 3:
 *         weekday = "Thu"
 */
    __Pyx_INCREF(__pyx_n_u_Wed);
    __pyx_v_weekday = __pyx_n_u_Wed;

    /* "cytimes/utils.pxd":1407
 *     elif wkd == 1:
 *         weekday = "Tue"
 *     elif wkd == 2:             # <<<<<<<<<<<<<<
 *         weekday = "Wed"
 *     elif wkd == 3:
 */
    break;
    case 3:

    /* "cytimes/utils.pxd":1410
 *         weekday = "Wed"
 *     elif wkd == 3:
 *         weekday = "Thu"             # <<<<<<<<<<<<<<
 *     elif wkd == 4:
 *         weekday = "Fri"
 */
    __Pyx_INCREF(__pyx_n_u_Thu);
    __pyx_v_weekday = __pyx_n_u_Thu;

    /* "cytimes/utils.pxd":1409
 *     elif wkd == 2:
 *         weekday = "Wed"
 *     elif wkd == 3:             # <<<<<<<<<<<<<<
 *         weekday = "Thu"
 *     elif wkd == 4:
 */
    break;
    case 4:

    /* "cytimes/utils.pxd":1412
 *         weekday = "Thu"
 *     elif wkd == 4:
 *         weekday = "Fri"             # <<<<<<<<<<<<<<
 *     elif wkd == 5:
 *         weekday = "Sat"
 */
    __Pyx_INCREF(__pyx_n_u_Fri);
    __pyx_v_weekday = __pyx_n_u_Fri;

    /* "cytimes/utils.pxd":1411
 *     elif wkd == 3:
 *         weekday = "Thu"
 *     elif wkd == 4:             # <<<<<<<<<<<<<<
 *         weekday = "Fri"
 *     elif wkd == 5:
 */
    break;
    case 5:

    /* "cytimes/utils.pxd":1414
 *         weekday = "Fri"
 *     elif wkd == 5:
 *         weekday = "Sat"             # <<<<<<<<<<<<<<
 *     else:
 *         weekday = "Sun"
 */
    __Pyx_INCREF(__pyx_n_u_Sat);
    __pyx_v_weekday = __pyx_n_u_Sat;

    /* "cytimes/utils.pxd":1413
 *     elif wkd == 4:
 *         weekday = "Fri"
 *     elif wkd == 5:             # <<<<<<<<<<<<<<
 *         weekday = "Sat"
 *     else:
 */
    break;
    default:

    /* "cytimes/utils.pxd":1416
 *         weekday = "Sat"
 *     else:
 *         weekday = "Sun"             # <<<<<<<<<<<<<<
 * 
 *     # Month
 */
    __Pyx_INCREF(__pyx_n_u_Sun);
    __pyx_v_weekday = __pyx_n_u_Sun;
    break;
  }

  /* "cytimes/utils.pxd":1419
 * 
 *     # Month
 *     if mm == 1:             # <<<<<<<<<<<<<<
 *         month = "Jan"
 *     elif mm == 2:
 */
  switch (__pyx_v_mm) {
    case 1:

    /* "cytimes/utils.pxd":1420
 *     # Month
 *     if mm == 1:
 *         month = "Jan"             # <<<<<<<<<<<<<<
 *     elif mm == 2:
 *         month = "Feb"
 */
    __Pyx_INCREF(__pyx_n_u_Jan);
    __pyx_v_month = __pyx_n_u_Jan;

    /* "cytimes/utils.pxd":1419
 * 
 *     # Month
 *     if mm == 1:             # <<<<<<<<<<<<<<
 *         month = "Jan"
 *     elif mm == 2:
 */
    break;
    case 2:

    /* "cytimes/utils.pxd":1422
 *         month = "Jan"
 *     elif mm == 2:
 *         month = "Feb"             # <<<<<<<<<<<<<<
 *     elif mm == 3:
 *         month = "Mar"
 */
    __Pyx_INCREF(__pyx_n_u_Feb);
    __pyx_v_month = __pyx_n_u_Feb;

    /* "cytimes/utils.pxd":1421
 *     if mm == 1:
 *         month = "Jan"
 *     elif mm == 2:             # <<<<<<<<<<<<<<
 *         month = "Feb"
 *     elif mm == 3:
 */
    break;
    case 3:

    /* "cytimes/utils.pxd":1424
 *         month = "Feb"
 *     elif mm == 3:
 *         month = "Mar"             # <<<<<<<<<<<<<<
 *     elif mm == 4:
 *         month = "Apr"
 */
    __Pyx_INCREF(__pyx_n_u_Mar);
    __pyx_v_month = __pyx_n_u_Mar;

    /* "cytimes/utils.pxd":1423
 *     elif mm == 2:
 *         month = "Feb"
 *     elif mm == 3:             # <<<<<<<<<<<<<<
 *         month = "Mar"
 *     elif mm == 4:
 */
    break;
    case 4:

    /* "cytimes/utils.pxd":1426
 *         month = "Mar"
 *     elif mm == 4:
 *         month = "Apr"             # <<<<<<<<<<<<<<
 *     elif mm == 5:
 *         month = "May"
 */
    __Pyx_INCREF(__pyx_n_u_Apr);
    __pyx_v_month = __pyx_n_u_Apr;

    /* "cytimes/utils.pxd":1425
 *     elif mm == 3:
 *         month = "Mar"
 *     elif mm == 4:             # <<<<<<<<<<<<<<
 *         month = "Apr"
 *     elif mm == 5:
 */
    break;
    case 5:

    /* "cytimes/utils.pxd":1428
 *         month = "Apr"
 *     elif mm == 5:
 *         month = "May"             # <<<<<<<<<<<<<<
 *     elif mm == 6:
 *         month = "Jun"
 */
    __Pyx_INCREF(__pyx_n_u_May);
    __pyx_v_month = __pyx_n_u_May;

    /* "cytimes/utils.pxd":1427
 *     elif mm == 4:
 *         month = "Apr"
 *     elif mm == 5:             # <<<<<<<<<<<<<<
 *         month = "May"
 *     elif mm == 6:
 */
    break;
    case 6:

    /* "cytimes/utils.pxd":1430
 *         month = "May"
 *     elif mm == 6:
 *         month = "Jun"             # <<<<<<<<<<<<<<
 *     elif mm == 7:
 *         month = "Jul"
 */
    __Pyx_INCREF(__pyx_n_u_Jun);
    __pyx_v_month = __pyx_n_u_Jun;

    /* "cytimes/utils.pxd":1429
 *     elif mm == 5:
 *         month = "May"
 *     elif mm == 6:             # <<<<<<<<<<<<<<
 *         month = "Jun"
 *     elif mm == 7:
 */
    break;
    case 7:

    /* "cytimes/utils.pxd":1432
 *         month = "Jun"
 *     elif mm == 7:
 *         month = "Jul"             # <<<<<<<<<<<<<<
 *     elif mm == 8:
 *         month = "Aug"
 */
    __Pyx_INCREF(__pyx_n_u_Jul);
    __pyx_v_month = __pyx_n_u_Jul;

    /* "cytimes/utils.pxd":1431
 *     elif mm == 6:
 *         month = "Jun"
 *     elif mm == 7:             # <<<<<<<<<<<<<<
 *         month = "Jul"
 *     elif mm == 8:
 */
    break;
    case 8:

    /* "cytimes/utils.pxd":1434
 *         month = "Jul"
 *     elif mm == 8:
 *         month = "Aug"             # <<<<<<<<<<<<<<
 *     elif mm == 9:
 *         month = "Sep"
 */
    __Pyx_INCREF(__pyx_n_u_Aug);
    __pyx_v_month = __pyx_n_u_Aug;

    /* "cytimes/utils.pxd":1433
 *     elif mm == 7:
 *         month = "Jul"
 *     elif mm == 8:             # <<<<<<<<<<<<<<
 *         month = "Aug"
 *     elif mm == 9:
 */
    break;
    case 9:

    /* "cytimes/utils.pxd":1436
 *         month = "Aug"
 *     elif mm == 9:
 *         month = "Sep"             # <<<<<<<<<<<<<<
 *     elif mm == 10:
 *         month = "Oct"
 */
    __Pyx_INCREF(__pyx_n_u_Sep);
    __pyx_v_month = __pyx_n_u_Sep;

    /* "cytimes/utils.pxd":1435
 *     elif mm == 8:
 *         month = "Aug"
 *     elif mm == 9:             # <<<<<<<<<<<<<<
 *         month = "Sep"
 *     elif mm == 10:
 */
    break;
    case 10:

    /* "cytimes/utils.pxd":1438
 *         month = "Sep"
 *     elif mm == 10:
 *         month = "Oct"             # <<<<<<<<<<<<<<
 *     elif mm == 11:
 *         month = "Nov"
 */
    __Pyx_INCREF(__pyx_n_u_Oct);
    __pyx_v_month = __pyx_n_u_Oct;

    /* "cytimes/utils.pxd":1437
 *     elif mm == 9:
 *         month = "Sep"
 *     elif mm == 10:             # <<<<<<<<<<<<<<
 *         month = "Oct"
 *     elif mm == 11:
 */
    break;
    case 11:

    /* "cytimes/utils.pxd":1440
 *         month = "Oct"
 *     elif mm == 11:
 *         month = "Nov"             # <<<<<<<<<<<<<<
 *     else:
 *         month = "Dec"
 */
    __Pyx_INCREF(__pyx_n_u_Nov);
    __pyx_v_month = __pyx_n_u_Nov;

    /* "cytimes/utils.pxd":1439
 *     elif mm == 10:
 *         month = "Oct"
 *     elif mm == 11:             # <<<<<<<<<<<<<<
 *         month = "Nov"
 *     else:
 */
    break;
    default:

    /* "cytimes/utils.pxd":1442
 *         month = "Nov"
 *     else:
 *         month = "Dec"             # <<<<<<<<<<<<<<
 * 
 *     # Fromat
 */
    __Pyx_INCREF(__pyx_n_u_Dec);
    __pyx_v_month = __pyx_n_u_Dec;
    break;
  }

  /* "cytimes/utils.pxd":1445
 * 
 *     # Fromat
 *     return "%s %s %2d %02d:%02d:%02d %04d" % (             # <<<<<<<<<<<<<<
 *         weekday, month, dd, dt.hour, dt.minute, dt.second, yy
 *     )
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 0;
  __pyx_t_6 = 127;

  /* "cytimes/utils.pxd":1446
 *     # Fromat
 *     return "%s %s %2d %02d:%02d:%02d %04d" % (
 *         weekday, month, dd, dt.hour, dt.minute, dt.second, yy             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __Pyx_INCREF(__pyx_v_weekday);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_weekday) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_weekday) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_weekday);
  __Pyx_GIVEREF(__pyx_v_weekday);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_weekday);
  __Pyx_INCREF(__pyx_kp_u__10);
  __pyx_t_5 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__10);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_u__10);
  __Pyx_INCREF(__pyx_v_month);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_month) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_month) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_month);
  __Pyx_GIVEREF(__pyx_v_month);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_month);
  __Pyx_INCREF(__pyx_kp_u__10);
  __pyx_t_5 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__10);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_kp_u__10);
  __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_v_dd, 2, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u__10);
  __pyx_t_5 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__10);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_kp_u__10);
  __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u__11);
  __pyx_t_5 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__11);
  PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_kp_u__11);
  __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u__11);
  __pyx_t_5 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__11);
  PyTuple_SET_ITEM(__pyx_t_4, 9, __pyx_kp_u__11);
  __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 10, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u__10);
  __pyx_t_5 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__10);
  PyTuple_SET_ITEM(__pyx_t_4, 11, __pyx_kp_u__10);
  __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_v_yy, 4, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 12, __pyx_t_7);
  __pyx_t_7 = 0;

  /* "cytimes/utils.pxd":1445
 * 
 *     # Fromat
 *     return "%s %s %2d %02d:%02d:%02d %04d" % (             # <<<<<<<<<<<<<<
 *         weekday, month, dd, dt.hour, dt.minute, dt.second, yy
 *     )
 */
  __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 13, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1392
 *     )
 * 
 * cdef inline str dt_to_ctime(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Convert datetime to string in C time format `<'str'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.utils.dt_to_ctime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_weekday);
  __Pyx_XDECREF(__pyx_v_month);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":1449
 *     )
 * 
 * cdef inline str dt_to_strformat(datetime.datetime dt, str fmt):             # <<<<<<<<<<<<<<
 *     """Convert datetime to string according to the given format `<'str'>`.
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_dt_to_strformat(PyDateTime_DateTime *__pyx_v_dt, PyObject *__pyx_v_fmt) {
  PyObject *__pyx_v_fmt_l = 0;
  Py_ssize_t __pyx_v_size;
  Py_ssize_t __pyx_v_idx;
  PyObject *__pyx_v_frepl = 0;
  PyObject *__pyx_v_zrepl = 0;
  PyObject *__pyx_v_Zrepl = 0;
  Py_UCS4 __pyx_v_ch;
  PyObject *__pyx_v_utcfmt = NULL;
  PyObject *__pyx_v_tzname = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  int __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcformat __pyx_t_9;
  struct tm __pyx_t_10;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_tm __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_strformat", 1);

  /* "cytimes/utils.pxd":1456
 *     """
 *     cdef:
 *         list fmt_l = []             # <<<<<<<<<<<<<<
 *         Py_ssize_t size, idx
 *         str frepl, zrepl, Zrepl
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_fmt_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":1462
 * 
 *     # Escape format
 *     size, idx = str_len(fmt), 0             # <<<<<<<<<<<<<<
 *     frepl, zrepl, Zrepl = None, None, None
 *     while idx < size:
 */
  __pyx_t_2 = PyUnicode_GET_LENGTH(__pyx_v_fmt);
  __pyx_t_3 = 0;
  __pyx_v_size = __pyx_t_2;
  __pyx_v_idx = __pyx_t_3;

  /* "cytimes/utils.pxd":1463
 *     # Escape format
 *     size, idx = str_len(fmt), 0
 *     frepl, zrepl, Zrepl = None, None, None             # <<<<<<<<<<<<<<
 *     while idx < size:
 *         ch = str_read(fmt, idx)
 */
  __pyx_t_1 = Py_None;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_4 = Py_None;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = Py_None;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_v_frepl = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_zrepl = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_v_Zrepl = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "cytimes/utils.pxd":1464
 *     size, idx = str_len(fmt), 0
 *     frepl, zrepl, Zrepl = None, None, None
 *     while idx < size:             # <<<<<<<<<<<<<<
 *         ch = str_read(fmt, idx)
 *         idx += 1
 */
  while (1) {
    __pyx_t_6 = (__pyx_v_idx < __pyx_v_size);
    if (!__pyx_t_6) break;

    /* "cytimes/utils.pxd":1465
 *     frepl, zrepl, Zrepl = None, None, None
 *     while idx < size:
 *         ch = str_read(fmt, idx)             # <<<<<<<<<<<<<<
 *         idx += 1
 *         # Format identifier: '%'
 */
    __pyx_t_7 = PyUnicode_ReadChar(__pyx_v_fmt, __pyx_v_idx); if (unlikely(__pyx_t_7 == ((Py_UCS4)-1))) __PYX_ERR(0, 1465, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_7;

    /* "cytimes/utils.pxd":1466
 *     while idx < size:
 *         ch = str_read(fmt, idx)
 *         idx += 1             # <<<<<<<<<<<<<<
 *         # Format identifier: '%'
 *         if ch == "%":
 */
    __pyx_v_idx = (__pyx_v_idx + 1);

    /* "cytimes/utils.pxd":1468
 *         idx += 1
 *         # Format identifier: '%'
 *         if ch == "%":             # <<<<<<<<<<<<<<
 *             if idx < size:
 *                 ch = str_read(fmt, idx)
 */
    __pyx_t_6 = (__pyx_v_ch == 37);
    if (__pyx_t_6) {

      /* "cytimes/utils.pxd":1469
 *         # Format identifier: '%'
 *         if ch == "%":
 *             if idx < size:             # <<<<<<<<<<<<<<
 *                 ch = str_read(fmt, idx)
 *                 idx += 1
 */
      __pyx_t_6 = (__pyx_v_idx < __pyx_v_size);
      if (__pyx_t_6) {

        /* "cytimes/utils.pxd":1470
 *         if ch == "%":
 *             if idx < size:
 *                 ch = str_read(fmt, idx)             # <<<<<<<<<<<<<<
 *                 idx += 1
 *                 # . fraction replacement
 */
        __pyx_t_7 = PyUnicode_ReadChar(__pyx_v_fmt, __pyx_v_idx); if (unlikely(__pyx_t_7 == ((Py_UCS4)-1))) __PYX_ERR(0, 1470, __pyx_L1_error)
        __pyx_v_ch = __pyx_t_7;

        /* "cytimes/utils.pxd":1471
 *             if idx < size:
 *                 ch = str_read(fmt, idx)
 *                 idx += 1             # <<<<<<<<<<<<<<
 *                 # . fraction replacement
 *                 if ch == "f":
 */
        __pyx_v_idx = (__pyx_v_idx + 1);

        /* "cytimes/utils.pxd":1473
 *                 idx += 1
 *                 # . fraction replacement
 *                 if ch == "f":             # <<<<<<<<<<<<<<
 *                     if frepl is None:
 *                         frepl = "%06d" % dt.microsecond
 */
        switch (__pyx_v_ch) {
          case 0x66:

          /* "cytimes/utils.pxd":1474
 *                 # . fraction replacement
 *                 if ch == "f":
 *                     if frepl is None:             # <<<<<<<<<<<<<<
 *                         frepl = "%06d" % dt.microsecond
 *                     fmt_l.append(frepl)
 */
          __pyx_t_6 = (__pyx_v_frepl == ((PyObject*)Py_None));
          if (__pyx_t_6) {

            /* "cytimes/utils.pxd":1475
 *                 if ch == "f":
 *                     if frepl is None:
 *                         frepl = "%06d" % dt.microsecond             # <<<<<<<<<<<<<<
 *                     fmt_l.append(frepl)
 *                 # . utc offset replacement
 */
            __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1475, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_06d, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1475, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF_SET(__pyx_v_frepl, ((PyObject*)__pyx_t_4));
            __pyx_t_4 = 0;

            /* "cytimes/utils.pxd":1474
 *                 # . fraction replacement
 *                 if ch == "f":
 *                     if frepl is None:             # <<<<<<<<<<<<<<
 *                         frepl = "%06d" % dt.microsecond
 *                     fmt_l.append(frepl)
 */
          }

          /* "cytimes/utils.pxd":1476
 *                     if frepl is None:
 *                         frepl = "%06d" % dt.microsecond
 *                     fmt_l.append(frepl)             # <<<<<<<<<<<<<<
 *                 # . utc offset replacement
 *                 elif ch == "z":
 */
          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_fmt_l, __pyx_v_frepl); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1476, __pyx_L1_error)

          /* "cytimes/utils.pxd":1473
 *                 idx += 1
 *                 # . fraction replacement
 *                 if ch == "f":             # <<<<<<<<<<<<<<
 *                     if frepl is None:
 *                         frepl = "%06d" % dt.microsecond
 */
          break;
          case 0x7A:

          /* "cytimes/utils.pxd":1479
 *                 # . utc offset replacement
 *                 elif ch == "z":
 *                     if zrepl is None:             # <<<<<<<<<<<<<<
 *                         utcfmt = tz_utcformat(dt.tzinfo, dt)
 *                         zrepl = "" if utcfmt is None else utcfmt
 */
          __pyx_t_6 = (__pyx_v_zrepl == ((PyObject*)Py_None));
          if (__pyx_t_6) {

            /* "cytimes/utils.pxd":1480
 *                 elif ch == "z":
 *                     if zrepl is None:
 *                         utcfmt = tz_utcformat(dt.tzinfo, dt)             # <<<<<<<<<<<<<<
 *                         zrepl = "" if utcfmt is None else utcfmt
 *                     fmt_l.append(zrepl)
 */
            __pyx_t_4 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1480, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_9.__pyx_n = 1;
            __pyx_t_9.dt = __pyx_v_dt;
            __pyx_t_5 = __pyx_f_7cytimes_5utils_tz_utcformat(__pyx_t_4, &__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1480, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF_SET(__pyx_v_utcfmt, ((PyObject*)__pyx_t_5));
            __pyx_t_5 = 0;

            /* "cytimes/utils.pxd":1481
 *                     if zrepl is None:
 *                         utcfmt = tz_utcformat(dt.tzinfo, dt)
 *                         zrepl = "" if utcfmt is None else utcfmt             # <<<<<<<<<<<<<<
 *                     fmt_l.append(zrepl)
 *                 # . timezone name replacement
 */
            __pyx_t_6 = (__pyx_v_utcfmt == ((PyObject*)Py_None));
            if (__pyx_t_6) {
              __Pyx_INCREF(__pyx_kp_u__12);
              __pyx_t_5 = __pyx_kp_u__12;
            } else {
              __Pyx_INCREF(__pyx_v_utcfmt);
              __pyx_t_5 = __pyx_v_utcfmt;
            }
            __Pyx_DECREF_SET(__pyx_v_zrepl, ((PyObject*)__pyx_t_5));
            __pyx_t_5 = 0;

            /* "cytimes/utils.pxd":1479
 *                 # . utc offset replacement
 *                 elif ch == "z":
 *                     if zrepl is None:             # <<<<<<<<<<<<<<
 *                         utcfmt = tz_utcformat(dt.tzinfo, dt)
 *                         zrepl = "" if utcfmt is None else utcfmt
 */
          }

          /* "cytimes/utils.pxd":1482
 *                         utcfmt = tz_utcformat(dt.tzinfo, dt)
 *                         zrepl = "" if utcfmt is None else utcfmt
 *                     fmt_l.append(zrepl)             # <<<<<<<<<<<<<<
 *                 # . timezone name replacement
 *                 elif ch == "Z":
 */
          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_fmt_l, __pyx_v_zrepl); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1482, __pyx_L1_error)

          /* "cytimes/utils.pxd":1478
 *                     fmt_l.append(frepl)
 *                 # . utc offset replacement
 *                 elif ch == "z":             # <<<<<<<<<<<<<<
 *                     if zrepl is None:
 *                         utcfmt = tz_utcformat(dt.tzinfo, dt)
 */
          break;
          case 90:

          /* "cytimes/utils.pxd":1485
 *                 # . timezone name replacement
 *                 elif ch == "Z":
 *                     if Zrepl is None:             # <<<<<<<<<<<<<<
 *                         tzname = dt_tzname(dt)
 *                         Zrepl = "" if tzname is None else tzname
 */
          __pyx_t_6 = (__pyx_v_Zrepl == ((PyObject*)Py_None));
          if (__pyx_t_6) {

            /* "cytimes/utils.pxd":1486
 *                 elif ch == "Z":
 *                     if Zrepl is None:
 *                         tzname = dt_tzname(dt)             # <<<<<<<<<<<<<<
 *                         Zrepl = "" if tzname is None else tzname
 *                     fmt_l.append(Zrepl)
 */
            __pyx_t_5 = __pyx_f_7cytimes_5utils_dt_tzname(__pyx_v_dt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1486, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_XDECREF_SET(__pyx_v_tzname, ((PyObject*)__pyx_t_5));
            __pyx_t_5 = 0;

            /* "cytimes/utils.pxd":1487
 *                     if Zrepl is None:
 *                         tzname = dt_tzname(dt)
 *                         Zrepl = "" if tzname is None else tzname             # <<<<<<<<<<<<<<
 *                     fmt_l.append(Zrepl)
 *                 # . not applicable
 */
            __pyx_t_6 = (__pyx_v_tzname == ((PyObject*)Py_None));
            if (__pyx_t_6) {
              __Pyx_INCREF(__pyx_kp_u__12);
              __pyx_t_5 = __pyx_kp_u__12;
            } else {
              __Pyx_INCREF(__pyx_v_tzname);
              __pyx_t_5 = __pyx_v_tzname;
            }
            __Pyx_DECREF_SET(__pyx_v_Zrepl, ((PyObject*)__pyx_t_5));
            __pyx_t_5 = 0;

            /* "cytimes/utils.pxd":1485
 *                 # . timezone name replacement
 *                 elif ch == "Z":
 *                     if Zrepl is None:             # <<<<<<<<<<<<<<
 *                         tzname = dt_tzname(dt)
 *                         Zrepl = "" if tzname is None else tzname
 */
          }

          /* "cytimes/utils.pxd":1488
 *                         tzname = dt_tzname(dt)
 *                         Zrepl = "" if tzname is None else tzname
 *                     fmt_l.append(Zrepl)             # <<<<<<<<<<<<<<
 *                 # . not applicable
 *                 else:
 */
          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_fmt_l, __pyx_v_Zrepl); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1488, __pyx_L1_error)

          /* "cytimes/utils.pxd":1484
 *                     fmt_l.append(zrepl)
 *                 # . timezone name replacement
 *                 elif ch == "Z":             # <<<<<<<<<<<<<<
 *                     if Zrepl is None:
 *                         tzname = dt_tzname(dt)
 */
          break;
          default:

          /* "cytimes/utils.pxd":1491
 *                 # . not applicable
 *                 else:
 *                     fmt_l.append("%")             # <<<<<<<<<<<<<<
 *                     fmt_l.append(str_chr(ch))
 *             # eof
 */
          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_fmt_l, __pyx_kp_u__13); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1491, __pyx_L1_error)

          /* "cytimes/utils.pxd":1492
 *                 else:
 *                     fmt_l.append("%")
 *                     fmt_l.append(str_chr(ch))             # <<<<<<<<<<<<<<
 *             # eof
 *             else:
 */
          __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_ch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1492, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_fmt_l, __pyx_t_5); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1492, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          break;
        }

        /* "cytimes/utils.pxd":1469
 *         # Format identifier: '%'
 *         if ch == "%":
 *             if idx < size:             # <<<<<<<<<<<<<<
 *                 ch = str_read(fmt, idx)
 *                 idx += 1
 */
        goto __pyx_L6;
      }

      /* "cytimes/utils.pxd":1495
 *             # eof
 *             else:
 *                 fmt_l.append("%")             # <<<<<<<<<<<<<<
 *         # Normal character
 *         else:
 */
      /*else*/ {
        __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_fmt_l, __pyx_kp_u__13); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1495, __pyx_L1_error)
      }
      __pyx_L6:;

      /* "cytimes/utils.pxd":1468
 *         idx += 1
 *         # Format identifier: '%'
 *         if ch == "%":             # <<<<<<<<<<<<<<
 *             if idx < size:
 *                 ch = str_read(fmt, idx)
 */
      goto __pyx_L5;
    }

    /* "cytimes/utils.pxd":1498
 *         # Normal character
 *         else:
 *             fmt_l.append(str_chr(ch))             # <<<<<<<<<<<<<<
 * 
 *     # Format to string
 */
    /*else*/ {
      __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_ch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1498, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_fmt_l, __pyx_t_5); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1498, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_L5:;
  }

  /* "cytimes/utils.pxd":1501
 * 
 *     # Format to string
 *     return tm_strftime(dt_to_tm(dt, False), "".join(fmt_l))             # <<<<<<<<<<<<<<
 * 
 * cdef inline str dt_to_isoformat(datetime.datetime dt, str sep="T", bint utc=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.utc = 0;
  __pyx_t_10 = __pyx_f_7cytimes_5utils_dt_to_tm(__pyx_v_dt, &__pyx_t_11); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1501, __pyx_L1_error)
  __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__12, __pyx_v_fmt_l); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __pyx_f_7cytimes_5utils_tm_strftime(__pyx_t_10, ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1449
 *     )
 * 
 * cdef inline str dt_to_strformat(datetime.datetime dt, str fmt):             # <<<<<<<<<<<<<<
 *     """Convert datetime to string according to the given format `<'str'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.dt_to_strformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fmt_l);
  __Pyx_XDECREF(__pyx_v_frepl);
  __Pyx_XDECREF(__pyx_v_zrepl);
  __Pyx_XDECREF(__pyx_v_Zrepl);
  __Pyx_XDECREF(__pyx_v_utcfmt);
  __Pyx_XDECREF(__pyx_v_tzname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_dt_to_isoformat(PyDateTime_DateTime *__pyx_v_dt, struct __pyx_opt_args_7cytimes_5utils_dt_to_isoformat *__pyx_optional_args) {
  PyObject *__pyx_v_sep = ((PyObject*)__pyx_n_u_T);
  int __pyx_v_utc = ((int)0);
  int __pyx_v_us;
  PyObject *__pyx_v_utc_fmt = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcformat __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_isoformat", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_sep = __pyx_optional_args->sep;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_utc = __pyx_optional_args->utc;
      }
    }
  }

  /* "cytimes/utils.pxd":1510
 *     """
 *     cdef:
 *         int us = dt.microsecond             # <<<<<<<<<<<<<<
 *         str utc_fmt = tz_utcformat(dt.tzinfo, dt) if utc else None
 * 
 */
  __pyx_v_us = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);

  /* "cytimes/utils.pxd":1511
 *     cdef:
 *         int us = dt.microsecond
 *         str utc_fmt = tz_utcformat(dt.tzinfo, dt) if utc else None             # <<<<<<<<<<<<<<
 * 
 *     if us == 0:
 */
  if (__pyx_v_utc) {
    __pyx_t_2 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.dt = __pyx_v_dt;
    __pyx_t_3 = __pyx_f_7cytimes_5utils_tz_utcformat(__pyx_t_2, &__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 1511, __pyx_L1_error)
  __pyx_v_utc_fmt = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":1513
 *         str utc_fmt = tz_utcformat(dt.tzinfo, dt) if utc else None
 * 
 *     if us == 0:             # <<<<<<<<<<<<<<
 *         if utc_fmt is None:
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d" % (
 */
  __pyx_t_5 = (__pyx_v_us == 0);
  if (__pyx_t_5) {

    /* "cytimes/utils.pxd":1514
 * 
 *     if us == 0:
 *         if utc_fmt is None:             # <<<<<<<<<<<<<<
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d" % (
 *                 dt.year, dt.month, dt.day, sep,
 */
    __pyx_t_5 = (__pyx_v_utc_fmt == ((PyObject*)Py_None));
    if (__pyx_t_5) {

      /* "cytimes/utils.pxd":1515
 *     if us == 0:
 *         if utc_fmt is None:
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d" % (             # <<<<<<<<<<<<<<
 *                 dt.year, dt.month, dt.day, sep,
 *                 dt.hour, dt.minute, dt.second,
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyTuple_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = 0;
      __pyx_t_7 = 127;

      /* "cytimes/utils.pxd":1516
 *         if utc_fmt is None:
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d" % (
 *                 dt.year, dt.month, dt.day, sep,             # <<<<<<<<<<<<<<
 *                 dt.hour, dt.minute, dt.second,
 *             )
 */
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), 4, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__9);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__9);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__9);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__9);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__9);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__9);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_v_sep); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_7;
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cytimes/utils.pxd":1517
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d" % (
 *                 dt.year, dt.month, dt.day, sep,
 *                 dt.hour, dt.minute, dt.second,             # <<<<<<<<<<<<<<
 *             )
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d%s" % (
 */
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_kp_u__11);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_kp_u__11);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cytimes/utils.pxd":1515
 *     if us == 0:
 *         if utc_fmt is None:
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d" % (             # <<<<<<<<<<<<<<
 *                 dt.year, dt.month, dt.day, sep,
 *                 dt.hour, dt.minute, dt.second,
 */
      __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 11, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":1514
 * 
 *     if us == 0:
 *         if utc_fmt is None:             # <<<<<<<<<<<<<<
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d" % (
 *                 dt.year, dt.month, dt.day, sep,
 */
    }

    /* "cytimes/utils.pxd":1519
 *                 dt.hour, dt.minute, dt.second,
 *             )
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d%s" % (             # <<<<<<<<<<<<<<
 *             dt.year, dt.month, dt.day, sep,
 *             dt.hour, dt.minute, dt.second, utc_fmt,
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;

    /* "cytimes/utils.pxd":1520
 *             )
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d%s" % (
 *             dt.year, dt.month, dt.day, sep,             # <<<<<<<<<<<<<<
 *             dt.hour, dt.minute, dt.second, utc_fmt,
 *         )
 */
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), 4, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__9);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__9);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__9);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__9);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__9);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_kp_u__9);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_sep); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/utils.pxd":1521
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d%s" % (
 *             dt.year, dt.month, dt.day, sep,
 *             dt.hour, dt.minute, dt.second, utc_fmt,             # <<<<<<<<<<<<<<
 *         )
 *     else:
 */
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_kp_u__11);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 8, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_3, 9, __pyx_kp_u__11);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 10, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_utc_fmt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 11, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/utils.pxd":1519
 *                 dt.hour, dt.minute, dt.second,
 *             )
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d%s" % (             # <<<<<<<<<<<<<<
 *             dt.year, dt.month, dt.day, sep,
 *             dt.hour, dt.minute, dt.second, utc_fmt,
 */
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 12, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":1513
 *         str utc_fmt = tz_utcformat(dt.tzinfo, dt) if utc else None
 * 
 *     if us == 0:             # <<<<<<<<<<<<<<
 *         if utc_fmt is None:
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d" % (
 */
  }

  /* "cytimes/utils.pxd":1524
 *         )
 *     else:
 *         if utc_fmt is None:             # <<<<<<<<<<<<<<
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d" % (
 *                 dt.year, dt.month, dt.day, sep,
 */
  /*else*/ {
    __pyx_t_5 = (__pyx_v_utc_fmt == ((PyObject*)Py_None));
    if (__pyx_t_5) {

      /* "cytimes/utils.pxd":1525
 *     else:
 *         if utc_fmt is None:
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d" % (             # <<<<<<<<<<<<<<
 *                 dt.year, dt.month, dt.day, sep,
 *                 dt.hour, dt.minute, dt.second, us,
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyTuple_New(13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = 0;
      __pyx_t_7 = 127;

      /* "cytimes/utils.pxd":1526
 *         if utc_fmt is None:
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d" % (
 *                 dt.year, dt.month, dt.day, sep,             # <<<<<<<<<<<<<<
 *                 dt.hour, dt.minute, dt.second, us,
 *             )
 */
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), 4, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__9);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__9);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__9);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__9);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__9);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__9);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_v_sep); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_7;
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cytimes/utils.pxd":1527
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d" % (
 *                 dt.year, dt.month, dt.day, sep,
 *                 dt.hour, dt.minute, dt.second, us,             # <<<<<<<<<<<<<<
 *             )
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d%s" % (
 */
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1527, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_kp_u__11);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1527, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_kp_u__11);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1527, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__14);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__14);
      PyTuple_SET_ITEM(__pyx_t_1, 11, __pyx_kp_u__14);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_us, 6, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1527, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 12, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cytimes/utils.pxd":1525
 *     else:
 *         if utc_fmt is None:
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d" % (             # <<<<<<<<<<<<<<
 *                 dt.year, dt.month, dt.day, sep,
 *                 dt.hour, dt.minute, dt.second, us,
 */
      __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 13, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":1524
 *         )
 *     else:
 *         if utc_fmt is None:             # <<<<<<<<<<<<<<
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d" % (
 *                 dt.year, dt.month, dt.day, sep,
 */
    }

    /* "cytimes/utils.pxd":1529
 *                 dt.hour, dt.minute, dt.second, us,
 *             )
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d%s" % (             # <<<<<<<<<<<<<<
 *             dt.year, dt.month, dt.day, sep,
 *             dt.hour, dt.minute, dt.second, us, utc_fmt,
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;

    /* "cytimes/utils.pxd":1530
 *             )
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d%s" % (
 *             dt.year, dt.month, dt.day, sep,             # <<<<<<<<<<<<<<
 *             dt.hour, dt.minute, dt.second, us, utc_fmt,
 *         )
 */
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), 4, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__9);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__9);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__9);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__9);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__9);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_kp_u__9);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_sep); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/utils.pxd":1531
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d%s" % (
 *             dt.year, dt.month, dt.day, sep,
 *             dt.hour, dt.minute, dt.second, us, utc_fmt,             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_kp_u__11);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 8, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_3, 9, __pyx_kp_u__11);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 10, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__14);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__14);
    PyTuple_SET_ITEM(__pyx_t_3, 11, __pyx_kp_u__14);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_us, 6, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 12, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_utc_fmt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 13, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/utils.pxd":1529
 *                 dt.hour, dt.minute, dt.second, us,
 *             )
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d%s" % (             # <<<<<<<<<<<<<<
 *             dt.year, dt.month, dt.day, sep,
 *             dt.hour, dt.minute, dt.second, us, utc_fmt,
 */
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 14, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

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

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

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

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_dt_to_us(PyDateTime_DateTime *__pyx_v_dt, struct __pyx_opt_args_7cytimes_5utils_dt_to_us *__pyx_optional_args) {
  int __pyx_v_utc = ((int)0);
  PY_LONG_LONG __pyx_v_ordinal;
  PY_LONG_LONG __pyx_v_hh;
  PY_LONG_LONG __pyx_v_mi;
  PY_LONG_LONG __pyx_v_ss;
  PY_LONG_LONG __pyx_v_us;
  PyDateTime_Delta *__pyx_v_utc_off = NULL;
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PY_LONG_LONG __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_us", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_utc = __pyx_optional_args->utc;
    }
  }

  /* "cytimes/utils.pxd":1541
 *     """
 *     cdef:
 *         long long ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *         long long hh = dt.hour
 *         long long mi = dt.minute
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.utc = 0;
  __pyx_t_1 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1541, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "cytimes/utils.pxd":1542
 *     cdef:
 *         long long ordinal = dt_to_ordinal(dt, False)
 *         long long hh = dt.hour             # <<<<<<<<<<<<<<
 *         long long mi = dt.minute
 *         long long ss = dt.second
 */
  __pyx_v_hh = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);

  /* "cytimes/utils.pxd":1543
 *         long long ordinal = dt_to_ordinal(dt, False)
 *         long long hh = dt.hour
 *         long long mi = dt.minute             # <<<<<<<<<<<<<<
 *         long long ss = dt.second
 *         long long us = dt.microsecond
 */
  __pyx_v_mi = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);

  /* "cytimes/utils.pxd":1544
 *         long long hh = dt.hour
 *         long long mi = dt.minute
 *         long long ss = dt.second             # <<<<<<<<<<<<<<
 *         long long us = dt.microsecond
 * 
 */
  __pyx_v_ss = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);

  /* "cytimes/utils.pxd":1545
 *         long long mi = dt.minute
 *         long long ss = dt.second
 *         long long us = dt.microsecond             # <<<<<<<<<<<<<<
 * 
 *     us += (
 */
  __pyx_v_us = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);

  /* "cytimes/utils.pxd":1547
 *         long long us = dt.microsecond
 * 
 *     us += (             # <<<<<<<<<<<<<<
 *         (ordinal - EPOCH_DAY) * US_DAY
 *         + hh * US_HOUR
 */
  __pyx_v_us = (__pyx_v_us + (((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_US_DAY) + (__pyx_v_hh * __pyx_v_7cytimes_5utils_US_HOUR)) + (__pyx_v_mi * __pyx_v_7cytimes_5utils_US_MINUTE)) + (__pyx_v_ss * __pyx_v_7cytimes_5utils_US_SECOND)));

  /* "cytimes/utils.pxd":1553
 *         + ss * US_SECOND
 *     )
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:
 */
  if (__pyx_v_utc) {

    /* "cytimes/utils.pxd":1554
 *     )
 *     if utc:
 *         utc_off = dt_utcoffset(dt)             # <<<<<<<<<<<<<<
 *         if utc_off is not None:
 *             us -= td_to_us(utc_off)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_utcoffset(__pyx_v_dt)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_utc_off = ((PyDateTime_Delta *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/utils.pxd":1555
 *     if utc:
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             us -= td_to_us(utc_off)
 *     return us
 */
    __pyx_t_4 = (((PyObject *)__pyx_v_utc_off) != Py_None);
    if (__pyx_t_4) {

      /* "cytimes/utils.pxd":1556
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:
 *             us -= td_to_us(utc_off)             # <<<<<<<<<<<<<<
 *     return us
 * 
 */
      __pyx_t_5 = __pyx_f_7cytimes_5utils_td_to_us(__pyx_v_utc_off); if (unlikely(__pyx_t_5 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 1556, __pyx_L1_error)
      __pyx_v_us = (__pyx_v_us - __pyx_t_5);

      /* "cytimes/utils.pxd":1555
 *     if utc:
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             us -= td_to_us(utc_off)
 *     return us
 */
    }

    /* "cytimes/utils.pxd":1553
 *         + ss * US_SECOND
 *     )
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:
 */
  }

  /* "cytimes/utils.pxd":1557
 *         if utc_off is not None:
 *             us -= td_to_us(utc_off)
 *     return us             # <<<<<<<<<<<<<<
 * 
 * cdef inline double dt_to_seconds(datetime.datetime dt, bint utc=False):
 */
  __pyx_r = __pyx_v_us;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.dt_to_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_utc_off);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static CYTHON_INLINE double __pyx_f_7cytimes_5utils_dt_to_seconds(PyDateTime_DateTime *__pyx_v_dt, struct __pyx_opt_args_7cytimes_5utils_dt_to_seconds *__pyx_optional_args) {
  int __pyx_v_utc = ((int)0);
  double __pyx_v_ordinal;
  double __pyx_v_hh;
  double __pyx_v_mi;
  double __pyx_v_ss;
  double __pyx_v_us;
  PyDateTime_Delta *__pyx_v_utc_off = NULL;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  double __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_seconds", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_utc = __pyx_optional_args->utc;
    }
  }

  /* "cytimes/utils.pxd":1566
 *     """
 *     cdef:
 *         double ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *         double hh = dt.hour
 *         double mi = dt.minute
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.utc = 0;
  __pyx_t_1 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1566, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "cytimes/utils.pxd":1567
 *     cdef:
 *         double ordinal = dt_to_ordinal(dt, False)
 *         double hh = dt.hour             # <<<<<<<<<<<<<<
 *         double mi = dt.minute
 *         double ss = dt.second
 */
  __pyx_v_hh = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);

  /* "cytimes/utils.pxd":1568
 *         double ordinal = dt_to_ordinal(dt, False)
 *         double hh = dt.hour
 *         double mi = dt.minute             # <<<<<<<<<<<<<<
 *         double ss = dt.second
 *         double us = dt.microsecond
 */
  __pyx_v_mi = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);

  /* "cytimes/utils.pxd":1569
 *         double hh = dt.hour
 *         double mi = dt.minute
 *         double ss = dt.second             # <<<<<<<<<<<<<<
 *         double us = dt.microsecond
 * 
 */
  __pyx_v_ss = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);

  /* "cytimes/utils.pxd":1570
 *         double mi = dt.minute
 *         double ss = dt.second
 *         double us = dt.microsecond             # <<<<<<<<<<<<<<
 * 
 *     ss += (
 */
  __pyx_v_us = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);

  /* "cytimes/utils.pxd":1572
 *         double us = dt.microsecond
 * 
 *     ss += (             # <<<<<<<<<<<<<<
 *         (ordinal - EPOCH_DAY) * SS_DAY
 *         + hh * SS_HOUR
 */
  __pyx_v_ss = (__pyx_v_ss + (((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_SS_DAY) + (__pyx_v_hh * __pyx_v_7cytimes_5utils_SS_HOUR)) + (__pyx_v_mi * __pyx_v_7cytimes_5utils_SS_MINUTE)) + (__pyx_v_us / 1000000.0)));

  /* "cytimes/utils.pxd":1578
 *         + us / 1_000_000
 *     )
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:
 */
  if (__pyx_v_utc) {

    /* "cytimes/utils.pxd":1579
 *     )
 *     if utc:
 *         utc_off = dt_utcoffset(dt)             # <<<<<<<<<<<<<<
 *         if utc_off is not None:
 *             ss -= td_to_seconds(utc_off)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_utcoffset(__pyx_v_dt)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_utc_off = ((PyDateTime_Delta *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/utils.pxd":1580
 *     if utc:
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             ss -= td_to_seconds(utc_off)
 *     return ss
 */
    __pyx_t_4 = (((PyObject *)__pyx_v_utc_off) != Py_None);
    if (__pyx_t_4) {

      /* "cytimes/utils.pxd":1581
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:
 *             ss -= td_to_seconds(utc_off)             # <<<<<<<<<<<<<<
 *     return ss
 * 
 */
      __pyx_t_5 = __pyx_f_7cytimes_5utils_td_to_seconds(__pyx_v_utc_off); if (unlikely(__pyx_t_5 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1581, __pyx_L1_error)
      __pyx_v_ss = (__pyx_v_ss - __pyx_t_5);

      /* "cytimes/utils.pxd":1580
 *     if utc:
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             ss -= td_to_seconds(utc_off)
 *     return ss
 */
    }

    /* "cytimes/utils.pxd":1578
 *         + us / 1_000_000
 *     )
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:
 */
  }

  /* "cytimes/utils.pxd":1582
 *         if utc_off is not None:
 *             ss -= td_to_seconds(utc_off)
 *     return ss             # <<<<<<<<<<<<<<
 * 
 * cdef inline int dt_to_ordinal(datetime.datetime dt, bint utc=False) except -1:
 */
  __pyx_r = __pyx_v_ss;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.dt_to_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_utc_off);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_dt_to_ordinal(PyDateTime_DateTime *__pyx_v_dt, struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal *__pyx_optional_args) {
  int __pyx_v_utc = ((int)0);
  int __pyx_v_ordinal;
  int __pyx_v_seconds;
  PyDateTime_Delta *__pyx_v_utc_off = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_ordinal", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_utc = __pyx_optional_args->utc;
    }
  }

  /* "cytimes/utils.pxd":1591
 *     """
 *     cdef int ordinal, seconds
 *     ordinal = ymd_to_ordinal(dt.year, dt.month, dt.day)             # <<<<<<<<<<<<<<
 * 
 *     if utc:
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1591, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "cytimes/utils.pxd":1593
 *     ordinal = ymd_to_ordinal(dt.year, dt.month, dt.day)
 * 
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:
 */
  if (__pyx_v_utc) {

    /* "cytimes/utils.pxd":1594
 * 
 *     if utc:
 *         utc_off = dt_utcoffset(dt)             # <<<<<<<<<<<<<<
 *         if utc_off is not None:
 *             seconds = dt.hour * SS_HOUR + dt.minute * SS_MINUTE + dt.second
 */
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_utcoffset(__pyx_v_dt)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_utc_off = ((PyDateTime_Delta *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/utils.pxd":1595
 *     if utc:
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             seconds = dt.hour * SS_HOUR + dt.minute * SS_MINUTE + dt.second
 *             seconds -= (
 */
    __pyx_t_3 = (((PyObject *)__pyx_v_utc_off) != Py_None);
    if (__pyx_t_3) {

      /* "cytimes/utils.pxd":1596
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:
 *             seconds = dt.hour * SS_HOUR + dt.minute * SS_MINUTE + dt.second             # <<<<<<<<<<<<<<
 *             seconds -= (
 *                 datetime.timedelta_days(utc_off) * SS_DAY
 */
      __pyx_v_seconds = (((__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt) * __pyx_v_7cytimes_5utils_SS_HOUR) + (__pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt) * __pyx_v_7cytimes_5utils_SS_MINUTE)) + __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt));

      /* "cytimes/utils.pxd":1597
 *         if utc_off is not None:
 *             seconds = dt.hour * SS_HOUR + dt.minute * SS_MINUTE + dt.second
 *             seconds -= (             # <<<<<<<<<<<<<<
 *                 datetime.timedelta_days(utc_off) * SS_DAY
 *                 + datetime.timedelta_seconds(utc_off)
 */
      __pyx_v_seconds = (__pyx_v_seconds - ((__pyx_f_7cpython_8datetime_timedelta_days(((PyObject *)__pyx_v_utc_off)) * __pyx_v_7cytimes_5utils_SS_DAY) + __pyx_f_7cpython_8datetime_timedelta_seconds(((PyObject *)__pyx_v_utc_off))));

      /* "cytimes/utils.pxd":1602
 *             )
 *             # UTC offset move 1 day backward
 *             if seconds < 0:             # <<<<<<<<<<<<<<
 *                 ordinal -= 1
 *             # UTC offset move 1 day forward
 */
      __pyx_t_3 = (__pyx_v_seconds < 0);
      if (__pyx_t_3) {

        /* "cytimes/utils.pxd":1603
 *             # UTC offset move 1 day backward
 *             if seconds < 0:
 *                 ordinal -= 1             # <<<<<<<<<<<<<<
 *             # UTC offset move 1 day forward
 *             elif seconds >= SS_DAY:
 */
        __pyx_v_ordinal = (__pyx_v_ordinal - 1);

        /* "cytimes/utils.pxd":1602
 *             )
 *             # UTC offset move 1 day backward
 *             if seconds < 0:             # <<<<<<<<<<<<<<
 *                 ordinal -= 1
 *             # UTC offset move 1 day forward
 */
        goto __pyx_L5;
      }

      /* "cytimes/utils.pxd":1605
 *                 ordinal -= 1
 *             # UTC offset move 1 day forward
 *             elif seconds >= SS_DAY:             # <<<<<<<<<<<<<<
 *                 ordinal += 1
 *     return ordinal
 */
      __pyx_t_3 = (__pyx_v_seconds >= __pyx_v_7cytimes_5utils_SS_DAY);
      if (__pyx_t_3) {

        /* "cytimes/utils.pxd":1606
 *             # UTC offset move 1 day forward
 *             elif seconds >= SS_DAY:
 *                 ordinal += 1             # <<<<<<<<<<<<<<
 *     return ordinal
 * 
 */
        __pyx_v_ordinal = (__pyx_v_ordinal + 1);

        /* "cytimes/utils.pxd":1605
 *                 ordinal -= 1
 *             # UTC offset move 1 day forward
 *             elif seconds >= SS_DAY:             # <<<<<<<<<<<<<<
 *                 ordinal += 1
 *     return ordinal
 */
      }
      __pyx_L5:;

      /* "cytimes/utils.pxd":1595
 *     if utc:
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             seconds = dt.hour * SS_HOUR + dt.minute * SS_MINUTE + dt.second
 *             seconds -= (
 */
    }

    /* "cytimes/utils.pxd":1593
 *     ordinal = ymd_to_ordinal(dt.year, dt.month, dt.day)
 * 
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:
 */
  }

  /* "cytimes/utils.pxd":1607
 *             elif seconds >= SS_DAY:
 *                 ordinal += 1
 *     return ordinal             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long dt_to_posix(datetime.datetime dt):
 */
  __pyx_r = __pyx_v_ordinal;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.dt_to_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_utc_off);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":1609
 *     return ordinal
 * 
 * cdef inline long long dt_to_posix(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Convert datetime to POSIX Time (seconds) `<'int'>`."""
 *     # Compute 'EPOCH' seconds
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_dt_to_posix(PyDateTime_DateTime *__pyx_v_dt) {
  PY_LONG_LONG __pyx_v_ordinal;
  PY_LONG_LONG __pyx_v_hh;
  PY_LONG_LONG __pyx_v_mi;
  PY_LONG_LONG __pyx_v_ss;
  PY_LONG_LONG __pyx_v_t;
  PY_LONG_LONG __pyx_v_adj1;
  PY_LONG_LONG __pyx_v_adj2;
  PY_LONG_LONG __pyx_v_u1;
  PY_LONG_LONG __pyx_v_u2;
  PY_LONG_LONG __pyx_v_t1;
  PY_LONG_LONG __pyx_v_t2;
  PY_LONG_LONG __pyx_r;
  int __pyx_t_1;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PY_LONG_LONG __pyx_t_5;
  int __pyx_t_6;
  PY_LONG_LONG __pyx_t_7;
  PY_LONG_LONG __pyx_t_8;
  PY_LONG_LONG __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/utils.pxd":1613
 *     # Compute 'EPOCH' seconds
 *     cdef long long ordinal, hh, mi, ss, t
 *     ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *     hh, mi, ss = dt.hour, dt.minute, dt.second
 *     t = (ordinal - EPOCH_DAY) * SS_DAY + hh * SS_HOUR + mi * SS_MINUTE + ss
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.utc = 0;
  __pyx_t_1 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1613, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "cytimes/utils.pxd":1614
 *     cdef long long ordinal, hh, mi, ss, t
 *     ordinal = dt_to_ordinal(dt, False)
 *     hh, mi, ss = dt.hour, dt.minute, dt.second             # <<<<<<<<<<<<<<
 *     t = (ordinal - EPOCH_DAY) * SS_DAY + hh * SS_HOUR + mi * SS_MINUTE + ss
 * 
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);
  __pyx_t_3 = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
  __pyx_t_4 = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);
  __pyx_v_hh = __pyx_t_1;
  __pyx_v_mi = __pyx_t_3;
  __pyx_v_ss = __pyx_t_4;

  /* "cytimes/utils.pxd":1615
 *     ordinal = dt_to_ordinal(dt, False)
 *     hh, mi, ss = dt.hour, dt.minute, dt.second
 *     t = (ordinal - EPOCH_DAY) * SS_DAY + hh * SS_HOUR + mi * SS_MINUTE + ss             # <<<<<<<<<<<<<<
 * 
 *     # Adjustment for Daylight Saving
 */
  __pyx_v_t = (((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_SS_DAY) + (__pyx_v_hh * __pyx_v_7cytimes_5utils_SS_HOUR)) + (__pyx_v_mi * __pyx_v_7cytimes_5utils_SS_MINUTE)) + __pyx_v_ss);

  /* "cytimes/utils.pxd":1619
 *     # Adjustment for Daylight Saving
 *     cdef long long adj1, adj2, u1, u2, t1, t2
 *     adj1 = ts_localtime(t) - t             # <<<<<<<<<<<<<<
 *     u1 = t - adj1
 *     t1 = ts_localtime(u1)
 */
  __pyx_t_5 = __pyx_f_7cytimes_5utils_ts_localtime(__pyx_v_t); if (unlikely(__pyx_t_5 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 1619, __pyx_L1_error)
  __pyx_v_adj1 = (__pyx_t_5 - __pyx_v_t);

  /* "cytimes/utils.pxd":1620
 *     cdef long long adj1, adj2, u1, u2, t1, t2
 *     adj1 = ts_localtime(t) - t
 *     u1 = t - adj1             # <<<<<<<<<<<<<<
 *     t1 = ts_localtime(u1)
 *     if t == t1:
 */
  __pyx_v_u1 = (__pyx_v_t - __pyx_v_adj1);

  /* "cytimes/utils.pxd":1621
 *     adj1 = ts_localtime(t) - t
 *     u1 = t - adj1
 *     t1 = ts_localtime(u1)             # <<<<<<<<<<<<<<
 *     if t == t1:
 *         # We found one solution, but it may not be the one we need.
 */
  __pyx_t_5 = __pyx_f_7cytimes_5utils_ts_localtime(__pyx_v_u1); if (unlikely(__pyx_t_5 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 1621, __pyx_L1_error)
  __pyx_v_t1 = __pyx_t_5;

  /* "cytimes/utils.pxd":1622
 *     u1 = t - adj1
 *     t1 = ts_localtime(u1)
 *     if t == t1:             # <<<<<<<<<<<<<<
 *         # We found one solution, but it may not be the one we need.
 *         # Look for an earlier solution (if `fold` is 0), or a later
 */
  __pyx_t_6 = (__pyx_v_t == __pyx_v_t1);
  if (__pyx_t_6) {

    /* "cytimes/utils.pxd":1626
 *         # Look for an earlier solution (if `fold` is 0), or a later
 *         # one (if `fold` is 1).
 *         u2 = u1 - SS_DAY if dt.fold == 0 else u1 + SS_DAY             # <<<<<<<<<<<<<<
 *         adj2 = ts_localtime(u2) - u2
 *         if adj1 == adj2:
 */
    __pyx_t_6 = (__pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt) == 0);
    if (__pyx_t_6) {
      __pyx_t_5 = (__pyx_v_u1 - __pyx_v_7cytimes_5utils_SS_DAY);
    } else {
      __pyx_t_5 = (__pyx_v_u1 + __pyx_v_7cytimes_5utils_SS_DAY);
    }
    __pyx_v_u2 = __pyx_t_5;

    /* "cytimes/utils.pxd":1627
 *         # one (if `fold` is 1).
 *         u2 = u1 - SS_DAY if dt.fold == 0 else u1 + SS_DAY
 *         adj2 = ts_localtime(u2) - u2             # <<<<<<<<<<<<<<
 *         if adj1 == adj2:
 *             return u1
 */
    __pyx_t_5 = __pyx_f_7cytimes_5utils_ts_localtime(__pyx_v_u2); if (unlikely(__pyx_t_5 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 1627, __pyx_L1_error)
    __pyx_v_adj2 = (__pyx_t_5 - __pyx_v_u2);

    /* "cytimes/utils.pxd":1628
 *         u2 = u1 - SS_DAY if dt.fold == 0 else u1 + SS_DAY
 *         adj2 = ts_localtime(u2) - u2
 *         if adj1 == adj2:             # <<<<<<<<<<<<<<
 *             return u1
 *     else:
 */
    __pyx_t_6 = (__pyx_v_adj1 == __pyx_v_adj2);
    if (__pyx_t_6) {

      /* "cytimes/utils.pxd":1629
 *         adj2 = ts_localtime(u2) - u2
 *         if adj1 == adj2:
 *             return u1             # <<<<<<<<<<<<<<
 *     else:
 *         adj2 = t1 - u1
 */
      __pyx_r = __pyx_v_u1;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":1628
 *         u2 = u1 - SS_DAY if dt.fold == 0 else u1 + SS_DAY
 *         adj2 = ts_localtime(u2) - u2
 *         if adj1 == adj2:             # <<<<<<<<<<<<<<
 *             return u1
 *     else:
 */
    }

    /* "cytimes/utils.pxd":1622
 *     u1 = t - adj1
 *     t1 = ts_localtime(u1)
 *     if t == t1:             # <<<<<<<<<<<<<<
 *         # We found one solution, but it may not be the one we need.
 *         # Look for an earlier solution (if `fold` is 0), or a later
 */
    goto __pyx_L3;
  }

  /* "cytimes/utils.pxd":1631
 *             return u1
 *     else:
 *         adj2 = t1 - u1             # <<<<<<<<<<<<<<
 * 
 *     # Final adjustment
 */
  /*else*/ {
    __pyx_v_adj2 = (__pyx_v_t1 - __pyx_v_u1);
  }
  __pyx_L3:;

  /* "cytimes/utils.pxd":1634
 * 
 *     # Final adjustment
 *     u2 = t - adj2             # <<<<<<<<<<<<<<
 *     t2 = ts_localtime(u2)
 *     if t == t2:
 */
  __pyx_v_u2 = (__pyx_v_t - __pyx_v_adj2);

  /* "cytimes/utils.pxd":1635
 *     # Final adjustment
 *     u2 = t - adj2
 *     t2 = ts_localtime(u2)             # <<<<<<<<<<<<<<
 *     if t == t2:
 *         return u2
 */
  __pyx_t_5 = __pyx_f_7cytimes_5utils_ts_localtime(__pyx_v_u2); if (unlikely(__pyx_t_5 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 1635, __pyx_L1_error)
  __pyx_v_t2 = __pyx_t_5;

  /* "cytimes/utils.pxd":1636
 *     u2 = t - adj2
 *     t2 = ts_localtime(u2)
 *     if t == t2:             # <<<<<<<<<<<<<<
 *         return u2
 *     if t == t1:
 */
  __pyx_t_6 = (__pyx_v_t == __pyx_v_t2);
  if (__pyx_t_6) {

    /* "cytimes/utils.pxd":1637
 *     t2 = ts_localtime(u2)
 *     if t == t2:
 *         return u2             # <<<<<<<<<<<<<<
 *     if t == t1:
 *         return u1
 */
    __pyx_r = __pyx_v_u2;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":1636
 *     u2 = t - adj2
 *     t2 = ts_localtime(u2)
 *     if t == t2:             # <<<<<<<<<<<<<<
 *         return u2
 *     if t == t1:
 */
  }

  /* "cytimes/utils.pxd":1638
 *     if t == t2:
 *         return u2
 *     if t == t1:             # <<<<<<<<<<<<<<
 *         return u1
 *     # We have found both offsets adj1 and adj2,
 */
  __pyx_t_6 = (__pyx_v_t == __pyx_v_t1);
  if (__pyx_t_6) {

    /* "cytimes/utils.pxd":1639
 *         return u2
 *     if t == t1:
 *         return u1             # <<<<<<<<<<<<<<
 *     # We have found both offsets adj1 and adj2,
 *     # but neither t - adj1 nor t - adj2 is the
 */
    __pyx_r = __pyx_v_u1;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":1638
 *     if t == t2:
 *         return u2
 *     if t == t1:             # <<<<<<<<<<<<<<
 *         return u1
 *     # We have found both offsets adj1 and adj2,
 */
  }

  /* "cytimes/utils.pxd":1643
 *     # but neither t - adj1 nor t - adj2 is the
 *     # solution. This means t is in the gap.
 *     return max(u1, u2) if dt.fold == 0 else min(u1, u2)             # <<<<<<<<<<<<<<
 * 
 * cdef inline double dt_to_ts(datetime.datetime dt):
 */
  __pyx_t_6 = (__pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt) == 0);
  if (__pyx_t_6) {
    __pyx_t_7 = __pyx_v_u2;
    __pyx_t_8 = __pyx_v_u1;
    __pyx_t_10 = (__pyx_t_7 > __pyx_t_8);
    if (__pyx_t_10) {
      __pyx_t_9 = __pyx_t_7;
    } else {
      __pyx_t_9 = __pyx_t_8;
    }
    __pyx_t_5 = __pyx_t_9;
  } else {
    __pyx_t_9 = __pyx_v_u2;
    __pyx_t_7 = __pyx_v_u1;
    __pyx_t_10 = (__pyx_t_9 < __pyx_t_7);
    if (__pyx_t_10) {
      __pyx_t_8 = __pyx_t_9;
    } else {
      __pyx_t_8 = __pyx_t_7;
    }
    __pyx_t_5 = __pyx_t_8;
  }
  __pyx_r = __pyx_t_5;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1609
 *     return ordinal
 * 
 * cdef inline long long dt_to_posix(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Convert datetime to POSIX Time (seconds) `<'int'>`."""
 *     # Compute 'EPOCH' seconds
 */

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

/* "cytimes/utils.pxd":1645
 *     return max(u1, u2) if dt.fold == 0 else min(u1, u2)
 * 
 * cdef inline double dt_to_ts(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Convert datetime to `EPOCH` timestamp `<'float'>`.
 * 
 */

static CYTHON_INLINE double __pyx_f_7cytimes_5utils_dt_to_ts(PyDateTime_DateTime *__pyx_v_dt) {
  double __pyx_v_ts;
  PyDateTime_Delta *__pyx_v_utc_off = NULL;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  double __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_seconds __pyx_t_4;
  PY_LONG_LONG __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_ts", 1);

  /* "cytimes/utils.pxd":1653
 *     # With timezone
 *     cdef double ts
 *     utc_off = dt_utcoffset(dt)             # <<<<<<<<<<<<<<
 *     if utc_off is not None:
 *         ts = dt_to_seconds(dt, False)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_utcoffset(__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_utc_off = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":1654
 *     cdef double ts
 *     utc_off = dt_utcoffset(dt)
 *     if utc_off is not None:             # <<<<<<<<<<<<<<
 *         ts = dt_to_seconds(dt, False)
 *         ts -= td_to_seconds(utc_off)
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_utc_off) != Py_None);
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":1655
 *     utc_off = dt_utcoffset(dt)
 *     if utc_off is not None:
 *         ts = dt_to_seconds(dt, False)             # <<<<<<<<<<<<<<
 *         ts -= td_to_seconds(utc_off)
 *         return ts
 */
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.utc = 0;
    __pyx_t_3 = __pyx_f_7cytimes_5utils_dt_to_seconds(__pyx_v_dt, &__pyx_t_4); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1655, __pyx_L1_error)
    __pyx_v_ts = __pyx_t_3;

    /* "cytimes/utils.pxd":1656
 *     if utc_off is not None:
 *         ts = dt_to_seconds(dt, False)
 *         ts -= td_to_seconds(utc_off)             # <<<<<<<<<<<<<<
 *         return ts
 * 
 */
    __pyx_t_3 = __pyx_f_7cytimes_5utils_td_to_seconds(__pyx_v_utc_off); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1656, __pyx_L1_error)
    __pyx_v_ts = (__pyx_v_ts - __pyx_t_3);

    /* "cytimes/utils.pxd":1657
 *         ts = dt_to_seconds(dt, False)
 *         ts -= td_to_seconds(utc_off)
 *         return ts             # <<<<<<<<<<<<<<
 * 
 *     # Without timezone
 */
    __pyx_r = __pyx_v_ts;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":1654
 *     cdef double ts
 *     utc_off = dt_utcoffset(dt)
 *     if utc_off is not None:             # <<<<<<<<<<<<<<
 *         ts = dt_to_seconds(dt, False)
 *         ts -= td_to_seconds(utc_off)
 */
  }

  /* "cytimes/utils.pxd":1660
 * 
 *     # Without timezone
 *     ts = <double> dt_to_posix(dt)             # <<<<<<<<<<<<<<
 *     return ts + (<double> dt.microsecond) / 1_000_000
 * 
 */
  __pyx_t_5 = __pyx_f_7cytimes_5utils_dt_to_posix(__pyx_v_dt); if (unlikely(__pyx_t_5 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 1660, __pyx_L1_error)
  __pyx_v_ts = ((double)__pyx_t_5);

  /* "cytimes/utils.pxd":1661
 *     # Without timezone
 *     ts = <double> dt_to_posix(dt)
 *     return ts + (<double> dt.microsecond) / 1_000_000             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long dt_as_epoch(datetime.datetime dt, str unit, bint utc=False):
 */
  __pyx_r = (__pyx_v_ts + (((double)__pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt)) / 1000000.0));
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1645
 *     return max(u1, u2) if dt.fold == 0 else min(u1, u2)
 * 
 * cdef inline double dt_to_ts(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Convert datetime to `EPOCH` timestamp `<'float'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt_to_ts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_utc_off);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_dt_as_epoch(PyDateTime_DateTime *__pyx_v_dt, PyObject *__pyx_v_unit, struct __pyx_opt_args_7cytimes_5utils_dt_as_epoch *__pyx_optional_args) {
  int __pyx_v_utc = ((int)0);
  Py_ssize_t __pyx_v_size;
  PY_LONG_LONG __pyx_v_ordinal;
  PY_LONG_LONG __pyx_v_hh;
  PY_LONG_LONG __pyx_v_mi;
  PY_LONG_LONG __pyx_v_ss;
  PY_LONG_LONG __pyx_v_us;
  Py_UCS4 __pyx_v_ch;
  PyDateTime_Delta *__pyx_v_utc_off = NULL;
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset __pyx_t_3;
  int __pyx_t_4;
  struct __pyx_opt_args_7cytimes_5utils_dt_add __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_as_epoch", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_utc = __pyx_optional_args->utc;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_dt);

  /* "cytimes/utils.pxd":1672
 *     """
 *     cdef:
 *         Py_ssize_t size = str_len(unit)             # <<<<<<<<<<<<<<
 *         long long ordinal, hh, mi, ss, us
 *         Py_UCS4 ch
 */
  __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_unit);

  /* "cytimes/utils.pxd":1677
 * 
 *     # Adjustment for UTC
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = tz_utcoffset(dt.tzinfo, dt)
 *         if utc_off is not None:
 */
  if (__pyx_v_utc) {

    /* "cytimes/utils.pxd":1678
 *     # Adjustment for UTC
 *     if utc:
 *         utc_off = tz_utcoffset(dt.tzinfo, dt)             # <<<<<<<<<<<<<<
 *         if utc_off is not None:
 *             dt = dt_add(
 */
    __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3.__pyx_n = 1;
    __pyx_t_3.dt = __pyx_v_dt;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_utc_off = ((PyDateTime_Delta *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/utils.pxd":1679
 *     if utc:
 *         utc_off = tz_utcoffset(dt.tzinfo, dt)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             dt = dt_add(
 *                 dt,
 */
    __pyx_t_4 = (((PyObject *)__pyx_v_utc_off) != Py_None);
    if (__pyx_t_4) {

      /* "cytimes/utils.pxd":1680
 *         utc_off = tz_utcoffset(dt.tzinfo, dt)
 *         if utc_off is not None:
 *             dt = dt_add(             # <<<<<<<<<<<<<<
 *                 dt,
 *                 -datetime.timedelta_days(utc_off),
 */
      __pyx_t_5.__pyx_n = 3;
      __pyx_t_5.days = (-__pyx_f_7cpython_8datetime_timedelta_days(((PyObject *)__pyx_v_utc_off)));
      __pyx_t_5.seconds = (-__pyx_f_7cpython_8datetime_timedelta_seconds(((PyObject *)__pyx_v_utc_off)));
      __pyx_t_5.microseconds = (-__pyx_f_7cpython_8datetime_timedelta_microseconds(((PyObject *)__pyx_v_utc_off)));
      __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_add(__pyx_v_dt, &__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1680, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "cytimes/utils.pxd":1679
 *     if utc:
 *         utc_off = tz_utcoffset(dt.tzinfo, dt)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             dt = dt_add(
 *                 dt,
 */
    }

    /* "cytimes/utils.pxd":1677
 * 
 *     # Adjustment for UTC
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = tz_utcoffset(dt.tzinfo, dt)
 *         if utc_off is not None:
 */
  }

  /* "cytimes/utils.pxd":1688
 * 
 *     # Unit: 's', 'm', 'h', 'D', 'W', 'M', 'Q', 'Y'
 *     if size == 1:             # <<<<<<<<<<<<<<
 *         ch = str_read(unit, 0)
 *         # . second
 */
  __pyx_t_4 = (__pyx_v_size == 1);
  if (__pyx_t_4) {

    /* "cytimes/utils.pxd":1689
 *     # Unit: 's', 'm', 'h', 'D', 'W', 'M', 'Q', 'Y'
 *     if size == 1:
 *         ch = str_read(unit, 0)             # <<<<<<<<<<<<<<
 *         # . second
 *         if ch == "s":
 */
    __pyx_t_6 = PyUnicode_ReadChar(__pyx_v_unit, 0); if (unlikely(__pyx_t_6 == ((Py_UCS4)-1))) __PYX_ERR(0, 1689, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_6;

    /* "cytimes/utils.pxd":1691
 *         ch = str_read(unit, 0)
 *         # . second
 *         if ch == "s":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss = dt.hour, dt.minute, dt.second
 */
    __pyx_t_4 = (__pyx_v_ch == 0x73);
    if (__pyx_t_4) {

      /* "cytimes/utils.pxd":1692
 *         # . second
 *         if ch == "s":
 *             ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *             hh, mi, ss = dt.hour, dt.minute, dt.second
 *             return (ordinal - EPOCH_DAY) * SS_DAY + hh * SS_HOUR + mi * SS_MINUTE + ss
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.utc = 0;
      __pyx_t_7 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1692, __pyx_L1_error)
      __pyx_v_ordinal = __pyx_t_7;

      /* "cytimes/utils.pxd":1693
 *         if ch == "s":
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss = dt.hour, dt.minute, dt.second             # <<<<<<<<<<<<<<
 *             return (ordinal - EPOCH_DAY) * SS_DAY + hh * SS_HOUR + mi * SS_MINUTE + ss
 *         # . minute
 */
      __pyx_t_7 = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);
      __pyx_t_9 = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
      __pyx_t_10 = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);
      __pyx_v_hh = __pyx_t_7;
      __pyx_v_mi = __pyx_t_9;
      __pyx_v_ss = __pyx_t_10;

      /* "cytimes/utils.pxd":1694
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss = dt.hour, dt.minute, dt.second
 *             return (ordinal - EPOCH_DAY) * SS_DAY + hh * SS_HOUR + mi * SS_MINUTE + ss             # <<<<<<<<<<<<<<
 *         # . minute
 *         if ch == "m":
 */
      __pyx_r = (((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_SS_DAY) + (__pyx_v_hh * __pyx_v_7cytimes_5utils_SS_HOUR)) + (__pyx_v_mi * __pyx_v_7cytimes_5utils_SS_MINUTE)) + __pyx_v_ss);
      goto __pyx_L0;

      /* "cytimes/utils.pxd":1691
 *         ch = str_read(unit, 0)
 *         # . second
 *         if ch == "s":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss = dt.hour, dt.minute, dt.second
 */
    }

    /* "cytimes/utils.pxd":1696
 *             return (ordinal - EPOCH_DAY) * SS_DAY + hh * SS_HOUR + mi * SS_MINUTE + ss
 *         # . minute
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi = dt.hour, dt.minute
 */
    __pyx_t_4 = (__pyx_v_ch == 0x6D);
    if (__pyx_t_4) {

      /* "cytimes/utils.pxd":1697
 *         # . minute
 *         if ch == "m":
 *             ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *             hh, mi = dt.hour, dt.minute
 *             return (ordinal - EPOCH_DAY) * 1_440 + hh * 60 + mi
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.utc = 0;
      __pyx_t_10 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_8); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1697, __pyx_L1_error)
      __pyx_v_ordinal = __pyx_t_10;

      /* "cytimes/utils.pxd":1698
 *         if ch == "m":
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi = dt.hour, dt.minute             # <<<<<<<<<<<<<<
 *             return (ordinal - EPOCH_DAY) * 1_440 + hh * 60 + mi
 *         # . hour
 */
      __pyx_t_10 = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);
      __pyx_t_9 = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
      __pyx_v_hh = __pyx_t_10;
      __pyx_v_mi = __pyx_t_9;

      /* "cytimes/utils.pxd":1699
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi = dt.hour, dt.minute
 *             return (ordinal - EPOCH_DAY) * 1_440 + hh * 60 + mi             # <<<<<<<<<<<<<<
 *         # . hour
 *         if ch == "h":
 */
      __pyx_r = ((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * 0x5A0) + (__pyx_v_hh * 60)) + __pyx_v_mi);
      goto __pyx_L0;

      /* "cytimes/utils.pxd":1696
 *             return (ordinal - EPOCH_DAY) * SS_DAY + hh * SS_HOUR + mi * SS_MINUTE + ss
 *         # . minute
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi = dt.hour, dt.minute
 */
    }

    /* "cytimes/utils.pxd":1701
 *             return (ordinal - EPOCH_DAY) * 1_440 + hh * 60 + mi
 *         # . hour
 *         if ch == "h":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             return (ordinal - EPOCH_DAY) * 24 + dt.hour
 */
    __pyx_t_4 = (__pyx_v_ch == 0x68);
    if (__pyx_t_4) {

      /* "cytimes/utils.pxd":1702
 *         # . hour
 *         if ch == "h":
 *             ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *             return (ordinal - EPOCH_DAY) * 24 + dt.hour
 *         # . day
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.utc = 0;
      __pyx_t_9 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1702, __pyx_L1_error)
      __pyx_v_ordinal = __pyx_t_9;

      /* "cytimes/utils.pxd":1703
 *         if ch == "h":
 *             ordinal = dt_to_ordinal(dt, False)
 *             return (ordinal - EPOCH_DAY) * 24 + dt.hour             # <<<<<<<<<<<<<<
 *         # . day
 *         if ch == "D":
 */
      __pyx_r = (((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * 24) + __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt));
      goto __pyx_L0;

      /* "cytimes/utils.pxd":1701
 *             return (ordinal - EPOCH_DAY) * 1_440 + hh * 60 + mi
 *         # . hour
 *         if ch == "h":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             return (ordinal - EPOCH_DAY) * 24 + dt.hour
 */
    }

    /* "cytimes/utils.pxd":1705
 *             return (ordinal - EPOCH_DAY) * 24 + dt.hour
 *         # . day
 *         if ch == "D":             # <<<<<<<<<<<<<<
 *             return dt_to_ordinal(dt, False) - EPOCH_DAY
 *         # . week
 */
    __pyx_t_4 = (__pyx_v_ch == 68);
    if (__pyx_t_4) {

      /* "cytimes/utils.pxd":1706
 *         # . day
 *         if ch == "D":
 *             return dt_to_ordinal(dt, False) - EPOCH_DAY             # <<<<<<<<<<<<<<
 *         # . week
 *         if ch == "W":
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.utc = 0;
      __pyx_t_9 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1706, __pyx_L1_error)
      __pyx_r = (__pyx_t_9 - __pyx_v_7cytimes_5utils_EPOCH_DAY);
      goto __pyx_L0;

      /* "cytimes/utils.pxd":1705
 *             return (ordinal - EPOCH_DAY) * 24 + dt.hour
 *         # . day
 *         if ch == "D":             # <<<<<<<<<<<<<<
 *             return dt_to_ordinal(dt, False) - EPOCH_DAY
 *         # . week
 */
    }

    /* "cytimes/utils.pxd":1708
 *             return dt_to_ordinal(dt, False) - EPOCH_DAY
 *         # . week
 *         if ch == "W":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             return (ordinal - EPOCH_DAY) // 7
 */
    __pyx_t_4 = (__pyx_v_ch == 87);
    if (__pyx_t_4) {

      /* "cytimes/utils.pxd":1709
 *         # . week
 *         if ch == "W":
 *             ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *             return (ordinal - EPOCH_DAY) // 7
 *         # . month
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.utc = 0;
      __pyx_t_9 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1709, __pyx_L1_error)
      __pyx_v_ordinal = __pyx_t_9;

      /* "cytimes/utils.pxd":1710
 *         if ch == "W":
 *             ordinal = dt_to_ordinal(dt, False)
 *             return (ordinal - EPOCH_DAY) // 7             # <<<<<<<<<<<<<<
 *         # . month
 *         if ch == "M":
 */
      __pyx_r = __Pyx_div_PY_LONG_LONG((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY), 7);
      goto __pyx_L0;

      /* "cytimes/utils.pxd":1708
 *             return dt_to_ordinal(dt, False) - EPOCH_DAY
 *         # . week
 *         if ch == "W":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             return (ordinal - EPOCH_DAY) // 7
 */
    }

    /* "cytimes/utils.pxd":1712
 *             return (ordinal - EPOCH_DAY) // 7
 *         # . month
 *         if ch == "M":             # <<<<<<<<<<<<<<
 *             return (dt.year - EPOCH_YEAR) * 12 + dt.month - 1
 *         # . quarter
 */
    __pyx_t_4 = (__pyx_v_ch == 77);
    if (__pyx_t_4) {

      /* "cytimes/utils.pxd":1713
 *         # . month
 *         if ch == "M":
 *             return (dt.year - EPOCH_YEAR) * 12 + dt.month - 1             # <<<<<<<<<<<<<<
 *         # . quarter
 *         if ch == "Q":
 */
      __pyx_r = ((((__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt) - __pyx_v_7cytimes_5utils_EPOCH_YEAR) * 12) + __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt)) - 1);
      goto __pyx_L0;

      /* "cytimes/utils.pxd":1712
 *             return (ordinal - EPOCH_DAY) // 7
 *         # . month
 *         if ch == "M":             # <<<<<<<<<<<<<<
 *             return (dt.year - EPOCH_YEAR) * 12 + dt.month - 1
 *         # . quarter
 */
    }

    /* "cytimes/utils.pxd":1715
 *             return (dt.year - EPOCH_YEAR) * 12 + dt.month - 1
 *         # . quarter
 *         if ch == "Q":             # <<<<<<<<<<<<<<
 *             return (dt.year - EPOCH_YEAR) * 4 + quarter_of_month(dt.month) - 1
 *         # . year
 */
    __pyx_t_4 = (__pyx_v_ch == 81);
    if (__pyx_t_4) {

      /* "cytimes/utils.pxd":1716
 *         # . quarter
 *         if ch == "Q":
 *             return (dt.year - EPOCH_YEAR) * 4 + quarter_of_month(dt.month) - 1             # <<<<<<<<<<<<<<
 *         # . year
 *         if ch == "Y":
 */
      __pyx_t_9 = __pyx_f_7cytimes_5utils_quarter_of_month(__pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1716, __pyx_L1_error)
      __pyx_r = ((((__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt) - __pyx_v_7cytimes_5utils_EPOCH_YEAR) * 4) + __pyx_t_9) - 1);
      goto __pyx_L0;

      /* "cytimes/utils.pxd":1715
 *             return (dt.year - EPOCH_YEAR) * 12 + dt.month - 1
 *         # . quarter
 *         if ch == "Q":             # <<<<<<<<<<<<<<
 *             return (dt.year - EPOCH_YEAR) * 4 + quarter_of_month(dt.month) - 1
 *         # . year
 */
    }

    /* "cytimes/utils.pxd":1718
 *             return (dt.year - EPOCH_YEAR) * 4 + quarter_of_month(dt.month) - 1
 *         # . year
 *         if ch == "Y":             # <<<<<<<<<<<<<<
 *             return dt.year - EPOCH_YEAR
 * 
 */
    __pyx_t_4 = (__pyx_v_ch == 89);
    if (__pyx_t_4) {

      /* "cytimes/utils.pxd":1719
 *         # . year
 *         if ch == "Y":
 *             return dt.year - EPOCH_YEAR             # <<<<<<<<<<<<<<
 * 
 *     # Unit: 'ns', 'us', 'ms'
 */
      __pyx_r = (__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt) - __pyx_v_7cytimes_5utils_EPOCH_YEAR);
      goto __pyx_L0;

      /* "cytimes/utils.pxd":1718
 *             return (dt.year - EPOCH_YEAR) * 4 + quarter_of_month(dt.month) - 1
 *         # . year
 *         if ch == "Y":             # <<<<<<<<<<<<<<
 *             return dt.year - EPOCH_YEAR
 * 
 */
    }

    /* "cytimes/utils.pxd":1688
 * 
 *     # Unit: 's', 'm', 'h', 'D', 'W', 'M', 'Q', 'Y'
 *     if size == 1:             # <<<<<<<<<<<<<<
 *         ch = str_read(unit, 0)
 *         # . second
 */
    goto __pyx_L5;
  }

  /* "cytimes/utils.pxd":1722
 * 
 *     # Unit: 'ns', 'us', 'ms'
 *     elif size == 2 and str_read(unit, 1) == "s":             # <<<<<<<<<<<<<<
 *         ch = str_read(unit, 0)
 *         # . nanosecond
 */
  __pyx_t_11 = (__pyx_v_size == 2);
  if (__pyx_t_11) {
  } else {
    __pyx_t_4 = __pyx_t_11;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_6 = PyUnicode_ReadChar(__pyx_v_unit, 1); if (unlikely(__pyx_t_6 == ((Py_UCS4)-1))) __PYX_ERR(0, 1722, __pyx_L1_error)
  __pyx_t_11 = (__pyx_t_6 == 0x73);
  __pyx_t_4 = __pyx_t_11;
  __pyx_L14_bool_binop_done:;
  if (__pyx_t_4) {

    /* "cytimes/utils.pxd":1723
 *     # Unit: 'ns', 'us', 'ms'
 *     elif size == 2 and str_read(unit, 1) == "s":
 *         ch = str_read(unit, 0)             # <<<<<<<<<<<<<<
 *         # . nanosecond
 *         if ch == "n":
 */
    __pyx_t_6 = PyUnicode_ReadChar(__pyx_v_unit, 0); if (unlikely(__pyx_t_6 == ((Py_UCS4)-1))) __PYX_ERR(0, 1723, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_6;

    /* "cytimes/utils.pxd":1725
 *         ch = str_read(unit, 0)
 *         # . nanosecond
 *         if ch == "n":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 */
    __pyx_t_4 = (__pyx_v_ch == 0x6E);
    if (__pyx_t_4) {

      /* "cytimes/utils.pxd":1726
 *         # . nanosecond
 *         if ch == "n":
 *             ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 *             return (
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.utc = 0;
      __pyx_t_9 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1726, __pyx_L1_error)
      __pyx_v_ordinal = __pyx_t_9;

      /* "cytimes/utils.pxd":1727
 *         if ch == "n":
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond             # <<<<<<<<<<<<<<
 *             return (
 *                 (ordinal - EPOCH_DAY) * NS_DAY
 */
      __pyx_t_9 = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);
      __pyx_t_10 = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
      __pyx_t_7 = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);
      __pyx_t_12 = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);
      __pyx_v_hh = __pyx_t_9;
      __pyx_v_mi = __pyx_t_10;
      __pyx_v_ss = __pyx_t_7;
      __pyx_v_us = __pyx_t_12;

      /* "cytimes/utils.pxd":1733
 *                 + mi * NS_MINUTE
 *                 + ss * NS_SECOND
 *                 + us * NS_MICROSECOND             # <<<<<<<<<<<<<<
 *             )
 *         # . microsecond
 */
      __pyx_r = ((((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_NS_DAY) + (__pyx_v_hh * __pyx_v_7cytimes_5utils_NS_HOUR)) + (__pyx_v_mi * __pyx_v_7cytimes_5utils_NS_MINUTE)) + (__pyx_v_ss * __pyx_v_7cytimes_5utils_NS_SECOND)) + (__pyx_v_us * __pyx_v_7cytimes_5utils_NS_MICROSECOND));
      goto __pyx_L0;

      /* "cytimes/utils.pxd":1725
 *         ch = str_read(unit, 0)
 *         # . nanosecond
 *         if ch == "n":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 */
    }

    /* "cytimes/utils.pxd":1736
 *             )
 *         # . microsecond
 *         if ch == "u":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 */
    __pyx_t_4 = (__pyx_v_ch == 0x75);
    if (__pyx_t_4) {

      /* "cytimes/utils.pxd":1737
 *         # . microsecond
 *         if ch == "u":
 *             ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 *             return (
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.utc = 0;
      __pyx_t_12 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_8); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 1737, __pyx_L1_error)
      __pyx_v_ordinal = __pyx_t_12;

      /* "cytimes/utils.pxd":1738
 *         if ch == "u":
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond             # <<<<<<<<<<<<<<
 *             return (
 *                 (ordinal - EPOCH_DAY) * US_DAY
 */
      __pyx_t_12 = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);
      __pyx_t_7 = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
      __pyx_t_10 = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);
      __pyx_t_9 = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);
      __pyx_v_hh = __pyx_t_12;
      __pyx_v_mi = __pyx_t_7;
      __pyx_v_ss = __pyx_t_10;
      __pyx_v_us = __pyx_t_9;

      /* "cytimes/utils.pxd":1744
 *                 + mi * US_MINUTE
 *                 + ss * US_SECOND
 *                 + us             # <<<<<<<<<<<<<<
 *             )
 *         # . millisecond
 */
      __pyx_r = ((((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_US_DAY) + (__pyx_v_hh * __pyx_v_7cytimes_5utils_US_HOUR)) + (__pyx_v_mi * __pyx_v_7cytimes_5utils_US_MINUTE)) + (__pyx_v_ss * __pyx_v_7cytimes_5utils_US_SECOND)) + __pyx_v_us);
      goto __pyx_L0;

      /* "cytimes/utils.pxd":1736
 *             )
 *         # . microsecond
 *         if ch == "u":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 */
    }

    /* "cytimes/utils.pxd":1747
 *             )
 *         # . millisecond
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 */
    __pyx_t_4 = (__pyx_v_ch == 0x6D);
    if (__pyx_t_4) {

      /* "cytimes/utils.pxd":1748
 *         # . millisecond
 *         if ch == "m":
 *             ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 *             return (
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.utc = 0;
      __pyx_t_9 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1748, __pyx_L1_error)
      __pyx_v_ordinal = __pyx_t_9;

      /* "cytimes/utils.pxd":1749
 *         if ch == "m":
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond             # <<<<<<<<<<<<<<
 *             return (
 *                 (ordinal - EPOCH_DAY) * MS_DAY
 */
      __pyx_t_9 = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);
      __pyx_t_10 = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
      __pyx_t_7 = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);
      __pyx_t_12 = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);
      __pyx_v_hh = __pyx_t_9;
      __pyx_v_mi = __pyx_t_10;
      __pyx_v_ss = __pyx_t_7;
      __pyx_v_us = __pyx_t_12;

      /* "cytimes/utils.pxd":1755
 *                 + mi * MS_MINUTE
 *                 + ss * MS_SECOND
 *                 + us // 1_000             # <<<<<<<<<<<<<<
 *             )
 * 
 */
      __pyx_r = ((((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_MS_DAY) + (__pyx_v_hh * __pyx_v_7cytimes_5utils_MS_HOUR)) + (__pyx_v_mi * __pyx_v_7cytimes_5utils_MS_MINUTE)) + (__pyx_v_ss * __pyx_v_7cytimes_5utils_MS_SECOND)) + __Pyx_div_PY_LONG_LONG(__pyx_v_us, 0x3E8));
      goto __pyx_L0;

      /* "cytimes/utils.pxd":1747
 *             )
 *         # . millisecond
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 */
    }

    /* "cytimes/utils.pxd":1722
 * 
 *     # Unit: 'ns', 'us', 'ms'
 *     elif size == 2 and str_read(unit, 1) == "s":             # <<<<<<<<<<<<<<
 *         ch = str_read(unit, 0)
 *         # . nanosecond
 */
    goto __pyx_L5;
  }

  /* "cytimes/utils.pxd":1759
 * 
 *     # Unit: 'min' for pandas compatibility
 *     elif size == 3 and unit == "min":             # <<<<<<<<<<<<<<
 *         ordinal = dt_to_ordinal(dt, False)
 *         return (ordinal - EPOCH_DAY) * 1_440 + dt.hour * 60 + dt.minute
 */
  __pyx_t_11 = (__pyx_v_size == 3);
  if (__pyx_t_11) {
  } else {
    __pyx_t_4 = __pyx_t_11;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_min, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1759, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_11;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "cytimes/utils.pxd":1760
 *     # Unit: 'min' for pandas compatibility
 *     elif size == 3 and unit == "min":
 *         ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *         return (ordinal - EPOCH_DAY) * 1_440 + dt.hour * 60 + dt.minute
 * 
 */
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.utc = 0;
    __pyx_t_12 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_8); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 1760, __pyx_L1_error)
    __pyx_v_ordinal = __pyx_t_12;

    /* "cytimes/utils.pxd":1761
 *     elif size == 3 and unit == "min":
 *         ordinal = dt_to_ordinal(dt, False)
 *         return (ordinal - EPOCH_DAY) * 1_440 + dt.hour * 60 + dt.minute             # <<<<<<<<<<<<<<
 * 
 *     # Unsupported unit
 */
    __pyx_r = ((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * 0x5A0) + (__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt) * 60)) + __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt));
    goto __pyx_L0;

    /* "cytimes/utils.pxd":1759
 * 
 *     # Unit: 'min' for pandas compatibility
 *     elif size == 3 and unit == "min":             # <<<<<<<<<<<<<<
 *         ordinal = dt_to_ordinal(dt, False)
 *         return (ordinal - EPOCH_DAY) * 1_440 + dt.hour * 60 + dt.minute
 */
  }
  __pyx_L5:;

  /* "cytimes/utils.pxd":1764
 * 
 *     # Unsupported unit
 *     raise ValueError("unsupported datetime unit '%s'." % unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long dt_as_epoch_iso_W(datetime.datetime dt, int weekday, bint utc=False):
 */
  __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_unsupported_datetime_unit_s, __pyx_v_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 1764, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.dt_as_epoch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_utc_off);
  __Pyx_XDECREF((PyObject *)__pyx_v_dt);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_dt_as_epoch_iso_W(PyDateTime_DateTime *__pyx_v_dt, int __pyx_v_weekday, struct __pyx_opt_args_7cytimes_5utils_dt_as_epoch_iso_W *__pyx_optional_args) {
  int __pyx_v_utc = ((int)0);
  int __pyx_v_ordinal;
  int __pyx_v_wkd_off;
  PY_LONG_LONG __pyx_r;
  int __pyx_t_1;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal __pyx_t_2;
  long __pyx_t_3;
  long __pyx_t_4;
  long __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_utc = __pyx_optional_args->utc;
    }
  }

  /* "cytimes/utils.pxd":1779
 *     substracts 'utcoffset' from the result.
 *     """
 *     cdef int ordinal = dt_to_ordinal(dt, utc)             # <<<<<<<<<<<<<<
 *     cdef int wkd_off = 4 - min(max(weekday, 1), 7)
 *     return (ordinal - EPOCH_DAY + wkd_off) // 7
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.utc = __pyx_v_utc;
  __pyx_t_1 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1779, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "cytimes/utils.pxd":1780
 *     """
 *     cdef int ordinal = dt_to_ordinal(dt, utc)
 *     cdef int wkd_off = 4 - min(max(weekday, 1), 7)             # <<<<<<<<<<<<<<
 *     return (ordinal - EPOCH_DAY + wkd_off) // 7
 * 
 */
  __pyx_t_3 = 7;
  __pyx_t_4 = 1;
  __pyx_t_1 = __pyx_v_weekday;
  __pyx_t_6 = (__pyx_t_4 > __pyx_t_1);
  if (__pyx_t_6) {
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_1;
  }
  __pyx_t_4 = __pyx_t_5;
  __pyx_t_6 = (__pyx_t_3 < __pyx_t_4);
  if (__pyx_t_6) {
    __pyx_t_5 = __pyx_t_3;
  } else {
    __pyx_t_5 = __pyx_t_4;
  }
  __pyx_v_wkd_off = (4 - __pyx_t_5);

  /* "cytimes/utils.pxd":1781
 *     cdef int ordinal = dt_to_ordinal(dt, utc)
 *     cdef int wkd_off = 4 - min(max(weekday, 1), 7)
 *     return (ordinal - EPOCH_DAY + wkd_off) // 7             # <<<<<<<<<<<<<<
 * 
 * # . conversion: from
 */
  __pyx_r = __Pyx_div_PY_LONG_LONG(((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) + __pyx_v_wkd_off), 7);
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_us(PY_LONG_LONG __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils_dt_fr_us *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  __pyx_t_7cytimes_5utils_hmsf __pyx_v__hmsf;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PY_LONG_LONG __pyx_t_1;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_2;
  __pyx_t_7cytimes_5utils_hmsf __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_fr_us", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "cytimes/utils.pxd":1787
 *     """Create datetime from `EPOCH` microseconds (int) `<'datetime.datetime'>`."""
 *     # Compute ymd & hmsf
 *     val += EPOCH_MICROSECOND             # <<<<<<<<<<<<<<
 *     _ymd = ymd_fr_ordinal(math_floor_div(val, US_DAY))
 *     _hmsf = hmsf_fr_us(val)
 */
  __pyx_v_val = (__pyx_v_val + __pyx_v_7cytimes_5utils_EPOCH_MICROSECOND);

  /* "cytimes/utils.pxd":1788
 *     # Compute ymd & hmsf
 *     val += EPOCH_MICROSECOND
 *     _ymd = ymd_fr_ordinal(math_floor_div(val, US_DAY))             # <<<<<<<<<<<<<<
 *     _hmsf = hmsf_fr_us(val)
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_val, __pyx_v_7cytimes_5utils_US_DAY, NULL); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 1788, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1788, __pyx_L1_error)
  __pyx_v__ymd = __pyx_t_2;

  /* "cytimes/utils.pxd":1789
 *     val += EPOCH_MICROSECOND
 *     _ymd = ymd_fr_ordinal(math_floor_div(val, US_DAY))
 *     _hmsf = hmsf_fr_us(val)             # <<<<<<<<<<<<<<
 * 
 *     # New datetime
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_hmsf_fr_us(__pyx_v_val); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1789, __pyx_L1_error)
  __pyx_v__hmsf = __pyx_t_3;

  /* "cytimes/utils.pxd":1792
 * 
 *     # New datetime
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         _ymd.year, _ymd.month, _ymd.day,
 *         _hmsf.hour, _hmsf.minute, _hmsf.second,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/utils.pxd":1795
 *         _ymd.year, _ymd.month, _ymd.day,
 *         _hmsf.hour, _hmsf.minute, _hmsf.second,
 *         _hmsf.microsecond, tz, 0             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.fold = 0;
  __pyx_t_4 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v__ymd.year, __pyx_v__ymd.month, __pyx_v__ymd.day, __pyx_v__hmsf.hour, __pyx_v__hmsf.minute, __pyx_v__hmsf.second, __pyx_v__hmsf.microsecond, __pyx_v_tz, &__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_seconds(double __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils_dt_fr_seconds *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt_fr_us __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_fr_seconds", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "cytimes/utils.pxd":1800
 * cdef inline datetime.datetime dt_fr_seconds(double val, object tz=None):
 *     """Create datetime from `EPOCH` seconds (float) `<'datetime.datetime'>`."""
 *     return dt_fr_us(<long long> int(val * US_SECOND), tz)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.datetime dt_fr_ordinal(int val, object tz=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.tz = __pyx_v_tz;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_us(((PY_LONG_LONG)((PY_LONG_LONG)(__pyx_v_val * __pyx_v_7cytimes_5utils_US_SECOND))), &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_ordinal(int __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils_dt_fr_ordinal *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_7cytimes_5utils_ymd __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_fr_ordinal", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "cytimes/utils.pxd":1808
 *     >>> datetime.datetime.fromordinal(val).replace(tzinfo=tz)
 *     """
 *     _ymd = ymd_fr_ordinal(val)             # <<<<<<<<<<<<<<
 *     return datetime.datetime_new(_ymd.year, _ymd.month, _ymd.day, 0, 0, 0, 0, tz, 0)
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(__pyx_v_val); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1808, __pyx_L1_error)
  __pyx_v__ymd = __pyx_t_1;

  /* "cytimes/utils.pxd":1809
 *     """
 *     _ymd = ymd_fr_ordinal(val)
 *     return datetime.datetime_new(_ymd.year, _ymd.month, _ymd.day, 0, 0, 0, 0, tz, 0)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.datetime dt_fr_ts(double val, object tz=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.fold = 0;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v__ymd.year, __pyx_v__ymd.month, __pyx_v__ymd.day, 0, 0, 0, 0, __pyx_v_tz, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

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

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

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

  /* "cytimes/utils.pxd":1817
 *     >>> datetime.datetime.fromtimestamp(val, tz)
 *     """
 *     return datetime.datetime_from_timestamp(val, tz)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.datetime dt_combine(datetime.date date=None, datetime.time time=None, tz: object = None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.tz = __pyx_v_tz;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_from_timestamp(__pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

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

/* "cytimes/utils.pxd":1819
 *     return datetime.datetime_from_timestamp(val, tz)
 * 
 * cdef inline datetime.datetime dt_combine(datetime.date date=None, datetime.time time=None, tz: object = None):             # <<<<<<<<<<<<<<
 *     """Create datetime by combining date & time `<'datetime.datetime'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_combine(struct __pyx_opt_args_7cytimes_5utils_dt_combine *__pyx_optional_args) {
  PyDateTime_Date *__pyx_v_date = ((PyDateTime_Date *)Py_None);
  PyDateTime_Time *__pyx_v_time = ((PyDateTime_Time *)Py_None);
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  int __pyx_v_yy;
  int __pyx_v_mm;
  int __pyx_v_dd;
  struct tm __pyx_v__tm;
  int __pyx_v_hh;
  int __pyx_v_mi;
  int __pyx_v_ss;
  int __pyx_v_us;
  int __pyx_v_fold;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  struct tm __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_combine", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_date = __pyx_optional_args->date;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_time = __pyx_optional_args->time;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_tz = __pyx_optional_args->tz;
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_tz);

  /* "cytimes/utils.pxd":1827
 *     # Date
 *     cdef int yy, mm, dd
 *     if date is None:             # <<<<<<<<<<<<<<
 *         _tm = tm_localtime(unix_time())
 *         yy, mm, dd = _tm.tm_year, _tm.tm_mon, _tm.tm_mday
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_date) == Py_None);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":1828
 *     cdef int yy, mm, dd
 *     if date is None:
 *         _tm = tm_localtime(unix_time())             # <<<<<<<<<<<<<<
 *         yy, mm, dd = _tm.tm_year, _tm.tm_mon, _tm.tm_mday
 *     else:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_tm_localtime(__pyx_f_7cpython_4time_time()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1828, __pyx_L1_error)
    __pyx_v__tm = __pyx_t_2;

    /* "cytimes/utils.pxd":1829
 *     if date is None:
 *         _tm = tm_localtime(unix_time())
 *         yy, mm, dd = _tm.tm_year, _tm.tm_mon, _tm.tm_mday             # <<<<<<<<<<<<<<
 *     else:
 *         yy, mm, dd = date.year, date.month, date.day
 */
    __pyx_t_3 = __pyx_v__tm.tm_year;
    __pyx_t_4 = __pyx_v__tm.tm_mon;
    __pyx_t_5 = __pyx_v__tm.tm_mday;
    __pyx_v_yy = __pyx_t_3;
    __pyx_v_mm = __pyx_t_4;
    __pyx_v_dd = __pyx_t_5;

    /* "cytimes/utils.pxd":1827
 *     # Date
 *     cdef int yy, mm, dd
 *     if date is None:             # <<<<<<<<<<<<<<
 *         _tm = tm_localtime(unix_time())
 *         yy, mm, dd = _tm.tm_year, _tm.tm_mon, _tm.tm_mday
 */
    goto __pyx_L3;
  }

  /* "cytimes/utils.pxd":1831
 *         yy, mm, dd = _tm.tm_year, _tm.tm_mon, _tm.tm_mday
 *     else:
 *         yy, mm, dd = date.year, date.month, date.day             # <<<<<<<<<<<<<<
 * 
 *     # Time
 */
  /*else*/ {
    __pyx_t_5 = __pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date);
    __pyx_t_4 = __pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date);
    __pyx_t_3 = __pyx_f_7cpython_8datetime_4date_3day_day(__pyx_v_date);
    __pyx_v_yy = __pyx_t_5;
    __pyx_v_mm = __pyx_t_4;
    __pyx_v_dd = __pyx_t_3;
  }
  __pyx_L3:;

  /* "cytimes/utils.pxd":1835
 *     # Time
 *     cdef int hh, mi, ss, us, fold
 *     if time is None:             # <<<<<<<<<<<<<<
 *         hh, mi, ss, us, fold = 0, 0, 0, 0, 0
 *     else:
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_time) == Py_None);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":1836
 *     cdef int hh, mi, ss, us, fold
 *     if time is None:
 *         hh, mi, ss, us, fold = 0, 0, 0, 0, 0             # <<<<<<<<<<<<<<
 *     else:
 *         hh, mi, ss, us, fold = time.hour, time.minute, time.second, time.microsecond, time.fold
 */
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_v_hh = __pyx_t_3;
    __pyx_v_mi = __pyx_t_4;
    __pyx_v_ss = __pyx_t_5;
    __pyx_v_us = __pyx_t_6;
    __pyx_v_fold = __pyx_t_7;

    /* "cytimes/utils.pxd":1835
 *     # Time
 *     cdef int hh, mi, ss, us, fold
 *     if time is None:             # <<<<<<<<<<<<<<
 *         hh, mi, ss, us, fold = 0, 0, 0, 0, 0
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":1838
 *         hh, mi, ss, us, fold = 0, 0, 0, 0, 0
 *     else:
 *         hh, mi, ss, us, fold = time.hour, time.minute, time.second, time.microsecond, time.fold             # <<<<<<<<<<<<<<
 *         if tz is None:
 *             tz = time.tzinfo
 */
  /*else*/ {
    __pyx_t_7 = __pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time);
    __pyx_t_6 = __pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time);
    __pyx_t_5 = __pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time);
    __pyx_t_4 = __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(__pyx_v_time);
    __pyx_t_3 = __pyx_f_7cpython_8datetime_4time_4fold_fold(__pyx_v_time);
    __pyx_v_hh = __pyx_t_7;
    __pyx_v_mi = __pyx_t_6;
    __pyx_v_ss = __pyx_t_5;
    __pyx_v_us = __pyx_t_4;
    __pyx_v_fold = __pyx_t_3;

    /* "cytimes/utils.pxd":1839
 *     else:
 *         hh, mi, ss, us, fold = time.hour, time.minute, time.second, time.microsecond, time.fold
 *         if tz is None:             # <<<<<<<<<<<<<<
 *             tz = time.tzinfo
 * 
 */
    __pyx_t_1 = (__pyx_v_tz == Py_None);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":1840
 *         hh, mi, ss, us, fold = time.hour, time.minute, time.second, time.microsecond, time.fold
 *         if tz is None:
 *             tz = time.tzinfo             # <<<<<<<<<<<<<<
 * 
 *     # Combine
 */
      __pyx_t_8 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1840, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "cytimes/utils.pxd":1839
 *     else:
 *         hh, mi, ss, us, fold = time.hour, time.minute, time.second, time.microsecond, time.fold
 *         if tz is None:             # <<<<<<<<<<<<<<
 *             tz = time.tzinfo
 * 
 */
    }
  }
  __pyx_L4:;

  /* "cytimes/utils.pxd":1843
 * 
 *     # Combine
 *     return datetime.datetime_new(yy, mm, dd, hh, mi, ss, us, tz, fold)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.datetime dt_fr_date(datetime.date date, object tz=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.fold = __pyx_v_fold;
  __pyx_t_8 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v_yy, __pyx_v_mm, __pyx_v_dd, __pyx_v_hh, __pyx_v_mi, __pyx_v_ss, __pyx_v_us, __pyx_v_tz, &__pyx_t_9)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_8);
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1819
 *     return datetime.datetime_from_timestamp(val, tz)
 * 
 * cdef inline datetime.datetime dt_combine(datetime.date date=None, datetime.time time=None, tz: object = None):             # <<<<<<<<<<<<<<
 *     """Create datetime by combining date & time `<'datetime.datetime'>`.
 * 
 */

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

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

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_date(PyDateTime_Date *__pyx_v_date, struct __pyx_opt_args_7cytimes_5utils_dt_fr_date *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_fr_date", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "cytimes/utils.pxd":1850
 *     #### All time fields are set to 0.
 *     """
 *     return datetime.datetime_new(date.year, date.month, date.day, 0, 0, 0, 0, tz, 0)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.datetime dt_fr_time(datetime.time time):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fold = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date), __pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date), __pyx_f_7cpython_8datetime_4date_3day_day(__pyx_v_date), 0, 0, 0, 0, __pyx_v_tz, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

/* "cytimes/utils.pxd":1852
 *     return datetime.datetime_new(date.year, date.month, date.day, 0, 0, 0, 0, tz, 0)
 * 
 * cdef inline datetime.datetime dt_fr_time(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Create datetime from time (include subclass) `<'datetime.datetime'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_time(PyDateTime_Time *__pyx_v_time) {
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_fr_time", 1);

  /* "cytimes/utils.pxd":1857
 *     #### Date fields are set to 1970-01-01.
 *     """
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         1970, 1, 1,
 *         time.hour, time.minute, time.second,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/utils.pxd":1860
 *         1970, 1, 1,
 *         time.hour, time.minute, time.second,
 *         time.microsecond, time.tzinfo, time.fold             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/utils.pxd":1857
 *     #### Date fields are set to 1970-01-01.
 *     """
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         1970, 1, 1,
 *         time.hour, time.minute, time.second,
 */
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.fold = __pyx_f_7cpython_8datetime_4time_4fold_fold(__pyx_v_time);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x7B2, 1, 1, __pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time), __pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time), __pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time), __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(__pyx_v_time), __pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1852
 *     return datetime.datetime_new(date.year, date.month, date.day, 0, 0, 0, 0, tz, 0)
 * 
 * cdef inline datetime.datetime dt_fr_time(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Create datetime from time (include subclass) `<'datetime.datetime'>`.
 * 
 */

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

/* "cytimes/utils.pxd":1863
 *     )
 * 
 * cdef inline datetime.datetime dt_fr_dt(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Create datetime from another datetime (include subclass) `<'datetime.datetime'>`."""
 *     return datetime.datetime_new(
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_dt(PyDateTime_DateTime *__pyx_v_dt) {
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_fr_dt", 1);

  /* "cytimes/utils.pxd":1865
 * cdef inline datetime.datetime dt_fr_dt(datetime.datetime dt):
 *     """Create datetime from another datetime (include subclass) `<'datetime.datetime'>`."""
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/utils.pxd":1868
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 *         dt.microsecond, dt.tzinfo, dt.fold             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/utils.pxd":1865
 * cdef inline datetime.datetime dt_fr_dt(datetime.datetime dt):
 *     """Create datetime from another datetime (include subclass) `<'datetime.datetime'>`."""
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 */
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.fold = __pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt), __pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1863
 *     )
 * 
 * cdef inline datetime.datetime dt_fr_dt(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Create datetime from another datetime (include subclass) `<'datetime.datetime'>`."""
 *     return datetime.datetime_new(
 */

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

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

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_add(PyDateTime_DateTime *__pyx_v_dt, struct __pyx_opt_args_7cytimes_5utils_dt_add *__pyx_optional_args) {
  int __pyx_v_days = ((int)0);
  int __pyx_v_seconds = ((int)0);
  int __pyx_v_microseconds = ((int)0);
  PY_LONG_LONG __pyx_v_dd;
  PY_LONG_LONG __pyx_v_hh;
  PY_LONG_LONG __pyx_v_mi;
  PY_LONG_LONG __pyx_v_ss;
  PY_LONG_LONG __pyx_v_us;
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  __pyx_t_7cytimes_5utils_hmsf __pyx_v__hmsf;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal __pyx_t_4;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PY_LONG_LONG __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_us __pyx_t_10;
  __pyx_t_7cytimes_5utils_hmsf __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_add", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_days = __pyx_optional_args->days;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_seconds = __pyx_optional_args->seconds;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_microseconds = __pyx_optional_args->microseconds;
        }
      }
    }
  }

  /* "cytimes/utils.pxd":1880
 *     # Fast-path
 *     cdef long long dd, hh, mi, ss, us
 *     if seconds == 0 and microseconds == 0:             # <<<<<<<<<<<<<<
 *         # No adjustment
 *         if days == 0:
 */
  __pyx_t_2 = (__pyx_v_seconds == 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_microseconds == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":1882
 *     if seconds == 0 and microseconds == 0:
 *         # No adjustment
 *         if days == 0:             # <<<<<<<<<<<<<<
 *             return dt  # exit
 * 
 */
    __pyx_t_1 = (__pyx_v_days == 0);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":1883
 *         # No adjustment
 *         if days == 0:
 *             return dt  # exit             # <<<<<<<<<<<<<<
 * 
 *         # Add 'day' delta
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_dt);
      __pyx_r = __pyx_v_dt;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":1882
 *     if seconds == 0 and microseconds == 0:
 *         # No adjustment
 *         if days == 0:             # <<<<<<<<<<<<<<
 *             return dt  # exit
 * 
 */
    }

    /* "cytimes/utils.pxd":1886
 * 
 *         # Add 'day' delta
 *         _ymd = ymd_fr_ordinal(dt_to_ordinal(dt, False) + days)             # <<<<<<<<<<<<<<
 *         hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 * 
 */
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.utc = 0;
    __pyx_t_3 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1886, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal((__pyx_t_3 + __pyx_v_days)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1886, __pyx_L1_error)
    __pyx_v__ymd = __pyx_t_5;

    /* "cytimes/utils.pxd":1887
 *         # Add 'day' delta
 *         _ymd = ymd_fr_ordinal(dt_to_ordinal(dt, False) + days)
 *         hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond             # <<<<<<<<<<<<<<
 * 
 *     # Compute full delta
 */
    __pyx_t_3 = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);
    __pyx_t_6 = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
    __pyx_t_7 = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);
    __pyx_t_8 = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);
    __pyx_v_hh = __pyx_t_3;
    __pyx_v_mi = __pyx_t_6;
    __pyx_v_ss = __pyx_t_7;
    __pyx_v_us = __pyx_t_8;

    /* "cytimes/utils.pxd":1880
 *     # Fast-path
 *     cdef long long dd, hh, mi, ss, us
 *     if seconds == 0 and microseconds == 0:             # <<<<<<<<<<<<<<
 *         # No adjustment
 *         if days == 0:
 */
    goto __pyx_L3;
  }

  /* "cytimes/utils.pxd":1892
 *     else:
 *         # Add 'us' delta
 *         dd, ss, us = days, seconds, microseconds             # <<<<<<<<<<<<<<
 *         us += dd * US_DAY + ss * US_SECOND
 *         us += dt_to_us(dt, False) + EPOCH_MICROSECOND
 */
  /*else*/ {
    __pyx_t_8 = __pyx_v_days;
    __pyx_t_7 = __pyx_v_seconds;
    __pyx_t_6 = __pyx_v_microseconds;
    __pyx_v_dd = __pyx_t_8;
    __pyx_v_ss = __pyx_t_7;
    __pyx_v_us = __pyx_t_6;

    /* "cytimes/utils.pxd":1893
 *         # Add 'us' delta
 *         dd, ss, us = days, seconds, microseconds
 *         us += dd * US_DAY + ss * US_SECOND             # <<<<<<<<<<<<<<
 *         us += dt_to_us(dt, False) + EPOCH_MICROSECOND
 *         _ymd = ymd_fr_ordinal(math_floor_div(us, US_DAY))
 */
    __pyx_v_us = (__pyx_v_us + ((__pyx_v_dd * __pyx_v_7cytimes_5utils_US_DAY) + (__pyx_v_ss * __pyx_v_7cytimes_5utils_US_SECOND)));

    /* "cytimes/utils.pxd":1894
 *         dd, ss, us = days, seconds, microseconds
 *         us += dd * US_DAY + ss * US_SECOND
 *         us += dt_to_us(dt, False) + EPOCH_MICROSECOND             # <<<<<<<<<<<<<<
 *         _ymd = ymd_fr_ordinal(math_floor_div(us, US_DAY))
 *         _hmsf = hmsf_fr_us(us)
 */
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.utc = 0;
    __pyx_t_9 = __pyx_f_7cytimes_5utils_dt_to_us(__pyx_v_dt, &__pyx_t_10); if (unlikely(__pyx_t_9 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 1894, __pyx_L1_error)
    __pyx_v_us = (__pyx_v_us + (__pyx_t_9 + __pyx_v_7cytimes_5utils_EPOCH_MICROSECOND));

    /* "cytimes/utils.pxd":1895
 *         us += dd * US_DAY + ss * US_SECOND
 *         us += dt_to_us(dt, False) + EPOCH_MICROSECOND
 *         _ymd = ymd_fr_ordinal(math_floor_div(us, US_DAY))             # <<<<<<<<<<<<<<
 *         _hmsf = hmsf_fr_us(us)
 *         hh, mi, ss, us = _hmsf.hour, _hmsf.minute, _hmsf.second, _hmsf.microsecond
 */
    __pyx_t_9 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_us, __pyx_v_7cytimes_5utils_US_DAY, NULL); if (unlikely(__pyx_t_9 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 1895, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(__pyx_t_9); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1895, __pyx_L1_error)
    __pyx_v__ymd = __pyx_t_5;

    /* "cytimes/utils.pxd":1896
 *         us += dt_to_us(dt, False) + EPOCH_MICROSECOND
 *         _ymd = ymd_fr_ordinal(math_floor_div(us, US_DAY))
 *         _hmsf = hmsf_fr_us(us)             # <<<<<<<<<<<<<<
 *         hh, mi, ss, us = _hmsf.hour, _hmsf.minute, _hmsf.second, _hmsf.microsecond
 * 
 */
    __pyx_t_11 = __pyx_f_7cytimes_5utils_hmsf_fr_us(__pyx_v_us); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1896, __pyx_L1_error)
    __pyx_v__hmsf = __pyx_t_11;

    /* "cytimes/utils.pxd":1897
 *         _ymd = ymd_fr_ordinal(math_floor_div(us, US_DAY))
 *         _hmsf = hmsf_fr_us(us)
 *         hh, mi, ss, us = _hmsf.hour, _hmsf.minute, _hmsf.second, _hmsf.microsecond             # <<<<<<<<<<<<<<
 * 
 *     # New datetime
 */
    __pyx_t_6 = __pyx_v__hmsf.hour;
    __pyx_t_7 = __pyx_v__hmsf.minute;
    __pyx_t_8 = __pyx_v__hmsf.second;
    __pyx_t_3 = __pyx_v__hmsf.microsecond;
    __pyx_v_hh = __pyx_t_6;
    __pyx_v_mi = __pyx_t_7;
    __pyx_v_ss = __pyx_t_8;
    __pyx_v_us = __pyx_t_3;
  }
  __pyx_L3:;

  /* "cytimes/utils.pxd":1900
 * 
 *     # New datetime
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         _ymd.year, _ymd.month, _ymd.day,
 *         hh, mi, ss, us, dt.tzinfo, dt.fold,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/utils.pxd":1902
 *     return datetime.datetime_new(
 *         _ymd.year, _ymd.month, _ymd.day,
 *         hh, mi, ss, us, dt.tzinfo, dt.fold,             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_12 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "cytimes/utils.pxd":1900
 * 
 *     # New datetime
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         _ymd.year, _ymd.month, _ymd.day,
 *         hh, mi, ss, us, dt.tzinfo, dt.fold,
 */
  __pyx_t_14.__pyx_n = 1;
  __pyx_t_14.fold = __pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt);
  __pyx_t_13 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v__ymd.year, __pyx_v__ymd.month, __pyx_v__ymd.day, __pyx_v_hh, __pyx_v_mi, __pyx_v_ss, __pyx_v_us, __pyx_t_12, &__pyx_t_14)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_13);
  __pyx_t_13 = 0;
  goto __pyx_L0;

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

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

/* "cytimes/utils.pxd":1905
 *     )
 * 
 * cdef inline datetime.datetime dt_replace_tz(datetime.datetime dt, object tz):             # <<<<<<<<<<<<<<
 *     """Replace the datetime timezone `<'datetime.datetime'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_replace_tz(PyDateTime_DateTime *__pyx_v_dt, PyObject *__pyx_v_tz) {
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_replace_tz", 1);

  /* "cytimes/utils.pxd":1912
 *     """
 *     # Same tzinfo
 *     if tz is datetime.datetime_tzinfo(dt):             # <<<<<<<<<<<<<<
 *         return dt
 * 
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_datetime_tzinfo(((PyObject *)__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_v_tz == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":1913
 *     # Same tzinfo
 *     if tz is datetime.datetime_tzinfo(dt):
 *         return dt             # <<<<<<<<<<<<<<
 * 
 *     # New datetime
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_dt);
    __pyx_r = __pyx_v_dt;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":1912
 *     """
 *     # Same tzinfo
 *     if tz is datetime.datetime_tzinfo(dt):             # <<<<<<<<<<<<<<
 *         return dt
 * 
 */
  }

  /* "cytimes/utils.pxd":1916
 * 
 *     # New datetime
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/utils.pxd":1919
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 *         dt.microsecond, tz, dt.fold,             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.fold = __pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt), __pyx_v_tz, &__pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1905
 *     )
 * 
 * cdef inline datetime.datetime dt_replace_tz(datetime.datetime dt, object tz):             # <<<<<<<<<<<<<<
 *     """Replace the datetime timezone `<'datetime.datetime'>`.
 * 
 */

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

/* "cytimes/utils.pxd":1922
 *     )
 * 
 * cdef inline datetime.datetime dt_replace_fold(datetime.datetime dt, int fold):             # <<<<<<<<<<<<<<
 *     """Replace the datetime fold `<'datetime.datetime'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_replace_fold(PyDateTime_DateTime *__pyx_v_dt, int __pyx_v_fold) {
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_replace_fold", 1);

  /* "cytimes/utils.pxd":1929
 *     """
 *     # Same fold
 *     if fold not in (0, 1) or fold == dt.fold:             # <<<<<<<<<<<<<<
 *         return dt
 * 
 */
  switch (__pyx_v_fold) {
    case 0:
    case 1:
    __pyx_t_2 = 0;
    break;
    default:
    __pyx_t_2 = 1;
    break;
  }
  __pyx_t_3 = __pyx_t_2;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_fold == __pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt));
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":1930
 *     # Same fold
 *     if fold not in (0, 1) or fold == dt.fold:
 *         return dt             # <<<<<<<<<<<<<<
 * 
 *     # New datetime
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_dt);
    __pyx_r = __pyx_v_dt;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":1929
 *     """
 *     # Same fold
 *     if fold not in (0, 1) or fold == dt.fold:             # <<<<<<<<<<<<<<
 *         return dt
 * 
 */
  }

  /* "cytimes/utils.pxd":1933
 * 
 *     # New datetime
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/utils.pxd":1936
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 *         dt.microsecond, dt.tzinfo, fold,             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_4 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "cytimes/utils.pxd":1933
 * 
 *     # New datetime
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 */
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.fold = __pyx_v_fold;
  __pyx_t_5 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt), __pyx_t_4, &__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_5);
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1922
 *     )
 * 
 * cdef inline datetime.datetime dt_replace_fold(datetime.datetime dt, int fold):             # <<<<<<<<<<<<<<
 *     """Replace the datetime fold `<'datetime.datetime'>`.
 * 
 */

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

/* "cytimes/utils.pxd":1939
 *     )
 * 
 * cdef inline datetime.datetime dt_astimezone(datetime.datetime dt, object tz=None):             # <<<<<<<<<<<<<<
 *     """Convert the datetime timezone `<'datetime.datetime'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_astimezone(PyDateTime_DateTime *__pyx_v_dt, struct __pyx_opt_args_7cytimes_5utils_dt_astimezone *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  PyObject *__pyx_v_mytz = NULL;
  PyDateTime_Delta *__pyx_v_myoffset = NULL;
  PY_LONG_LONG __pyx_v_us;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  struct __pyx_opt_args_7cytimes_5utils_tz_local __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PY_LONG_LONG __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_us __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_dt_fr_us __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  unsigned int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_astimezone", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_dt);
  __Pyx_INCREF(__pyx_v_tz);

  /* "cytimes/utils.pxd":1945
 *     >>> dt.astimezone(tz)
 *     """
 *     mytz = datetime.datetime_tzinfo(dt)             # <<<<<<<<<<<<<<
 *     if tz is None:
 *         tz = tz_local(dt)
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_datetime_tzinfo(((PyObject *)__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_mytz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":1946
 *     """
 *     mytz = datetime.datetime_tzinfo(dt)
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         tz = tz_local(dt)
 *         if mytz is None:
 */
  __pyx_t_2 = (__pyx_v_tz == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":1947
 *     mytz = datetime.datetime_tzinfo(dt)
 *     if tz is None:
 *         tz = tz_local(dt)             # <<<<<<<<<<<<<<
 *         if mytz is None:
 *             # since 'dt' is timezone-naive, we
 */
    __pyx_t_3.__pyx_n = 1;
    __pyx_t_3.dt = __pyx_v_dt;
    __pyx_t_1 = __pyx_f_7cytimes_5utils_tz_local(&__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1947, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/utils.pxd":1948
 *     if tz is None:
 *         tz = tz_local(dt)
 *         if mytz is None:             # <<<<<<<<<<<<<<
 *             # since 'dt' is timezone-naive, we
 *             # simply localize to the local timezone.
 */
    __pyx_t_2 = (__pyx_v_mytz == Py_None);
    if (__pyx_t_2) {

      /* "cytimes/utils.pxd":1951
 *             # since 'dt' is timezone-naive, we
 *             # simply localize to the local timezone.
 *             return dt_replace_tz(dt, tz)  # exit             # <<<<<<<<<<<<<<
 * 
 *     if mytz is None:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_replace_tz(__pyx_v_dt, __pyx_v_tz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1951, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":1948
 *     if tz is None:
 *         tz = tz_local(dt)
 *         if mytz is None:             # <<<<<<<<<<<<<<
 *             # since 'dt' is timezone-naive, we
 *             # simply localize to the local timezone.
 */
    }

    /* "cytimes/utils.pxd":1946
 *     """
 *     mytz = datetime.datetime_tzinfo(dt)
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         tz = tz_local(dt)
 *         if mytz is None:
 */
  }

  /* "cytimes/utils.pxd":1953
 *             return dt_replace_tz(dt, tz)  # exit
 * 
 *     if mytz is None:             # <<<<<<<<<<<<<<
 *         mytz = tz_local(dt)
 *         if mytz is tz:
 */
  __pyx_t_2 = (__pyx_v_mytz == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":1954
 * 
 *     if mytz is None:
 *         mytz = tz_local(dt)             # <<<<<<<<<<<<<<
 *         if mytz is tz:
 *             # Since 'dt' is timezone-naive, we
 */
    __pyx_t_3.__pyx_n = 1;
    __pyx_t_3.dt = __pyx_v_dt;
    __pyx_t_1 = __pyx_f_7cytimes_5utils_tz_local(&__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1954, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_mytz, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/utils.pxd":1955
 *     if mytz is None:
 *         mytz = tz_local(dt)
 *         if mytz is tz:             # <<<<<<<<<<<<<<
 *             # Since 'dt' is timezone-naive, we
 *             # simply localize to the target timezone.
 */
    __pyx_t_2 = (__pyx_v_mytz == __pyx_v_tz);
    if (__pyx_t_2) {

      /* "cytimes/utils.pxd":1958
 *             # Since 'dt' is timezone-naive, we
 *             # simply localize to the target timezone.
 *             return dt_replace_tz(dt, tz)  # exit             # <<<<<<<<<<<<<<
 *         myoffset = tz_utcoffset(mytz, dt)
 *     elif mytz is tz:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_replace_tz(__pyx_v_dt, __pyx_v_tz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1958, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":1955
 *     if mytz is None:
 *         mytz = tz_local(dt)
 *         if mytz is tz:             # <<<<<<<<<<<<<<
 *             # Since 'dt' is timezone-naive, we
 *             # simply localize to the target timezone.
 */
    }

    /* "cytimes/utils.pxd":1959
 *             # simply localize to the target timezone.
 *             return dt_replace_tz(dt, tz)  # exit
 *         myoffset = tz_utcoffset(mytz, dt)             # <<<<<<<<<<<<<<
 *     elif mytz is tz:
 *         return dt  # exit
 */
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.dt = __pyx_v_dt;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_v_mytz, &__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_myoffset = ((PyDateTime_Delta *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/utils.pxd":1953
 *             return dt_replace_tz(dt, tz)  # exit
 * 
 *     if mytz is None:             # <<<<<<<<<<<<<<
 *         mytz = tz_local(dt)
 *         if mytz is tz:
 */
    goto __pyx_L5;
  }

  /* "cytimes/utils.pxd":1960
 *             return dt_replace_tz(dt, tz)  # exit
 *         myoffset = tz_utcoffset(mytz, dt)
 *     elif mytz is tz:             # <<<<<<<<<<<<<<
 *         return dt  # exit
 *     else:
 */
  __pyx_t_2 = (__pyx_v_mytz == __pyx_v_tz);
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":1961
 *         myoffset = tz_utcoffset(mytz, dt)
 *     elif mytz is tz:
 *         return dt  # exit             # <<<<<<<<<<<<<<
 *     else:
 *         myoffset = tz_utcoffset(mytz, dt)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_dt);
    __pyx_r = __pyx_v_dt;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":1960
 *             return dt_replace_tz(dt, tz)  # exit
 *         myoffset = tz_utcoffset(mytz, dt)
 *     elif mytz is tz:             # <<<<<<<<<<<<<<
 *         return dt  # exit
 *     else:
 */
  }

  /* "cytimes/utils.pxd":1963
 *         return dt  # exit
 *     else:
 *         myoffset = tz_utcoffset(mytz, dt)             # <<<<<<<<<<<<<<
 *         if myoffset is None:
 *             mytz = tz_local(dt_replace_tz(dt, None))
 */
  /*else*/ {
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.dt = __pyx_v_dt;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_v_mytz, &__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_myoffset = ((PyDateTime_Delta *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/utils.pxd":1964
 *     else:
 *         myoffset = tz_utcoffset(mytz, dt)
 *         if myoffset is None:             # <<<<<<<<<<<<<<
 *             mytz = tz_local(dt_replace_tz(dt, None))
 *             if mytz is tz:
 */
    __pyx_t_2 = (((PyObject *)__pyx_v_myoffset) == Py_None);
    if (__pyx_t_2) {

      /* "cytimes/utils.pxd":1965
 *         myoffset = tz_utcoffset(mytz, dt)
 *         if myoffset is None:
 *             mytz = tz_local(dt_replace_tz(dt, None))             # <<<<<<<<<<<<<<
 *             if mytz is tz:
 *                 return dt  # exit
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_replace_tz(__pyx_v_dt, Py_None)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1965, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3.__pyx_n = 1;
      __pyx_t_3.dt = ((PyDateTime_DateTime *)__pyx_t_1);
      __pyx_t_5 = __pyx_f_7cytimes_5utils_tz_local(&__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1965, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF_SET(__pyx_v_mytz, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cytimes/utils.pxd":1966
 *         if myoffset is None:
 *             mytz = tz_local(dt_replace_tz(dt, None))
 *             if mytz is tz:             # <<<<<<<<<<<<<<
 *                 return dt  # exit
 *             myoffset = tz_utcoffset(mytz, dt)
 */
      __pyx_t_2 = (__pyx_v_mytz == __pyx_v_tz);
      if (__pyx_t_2) {

        /* "cytimes/utils.pxd":1967
 *             mytz = tz_local(dt_replace_tz(dt, None))
 *             if mytz is tz:
 *                 return dt  # exit             # <<<<<<<<<<<<<<
 *             myoffset = tz_utcoffset(mytz, dt)
 * 
 */
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __Pyx_INCREF((PyObject *)__pyx_v_dt);
        __pyx_r = __pyx_v_dt;
        goto __pyx_L0;

        /* "cytimes/utils.pxd":1966
 *         if myoffset is None:
 *             mytz = tz_local(dt_replace_tz(dt, None))
 *             if mytz is tz:             # <<<<<<<<<<<<<<
 *                 return dt  # exit
 *             myoffset = tz_utcoffset(mytz, dt)
 */
      }

      /* "cytimes/utils.pxd":1968
 *             if mytz is tz:
 *                 return dt  # exit
 *             myoffset = tz_utcoffset(mytz, dt)             # <<<<<<<<<<<<<<
 * 
 *     # Convert to UTC time
 */
      __pyx_t_4.__pyx_n = 1;
      __pyx_t_4.dt = __pyx_v_dt;
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_v_mytz, &__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1968, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_myoffset, ((PyDateTime_Delta *)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "cytimes/utils.pxd":1964
 *     else:
 *         myoffset = tz_utcoffset(mytz, dt)
 *         if myoffset is None:             # <<<<<<<<<<<<<<
 *             mytz = tz_local(dt_replace_tz(dt, None))
 *             if mytz is tz:
 */
    }
  }
  __pyx_L5:;

  /* "cytimes/utils.pxd":1971
 * 
 *     # Convert to UTC time
 *     cdef long long us = dt_to_us(dt, False)             # <<<<<<<<<<<<<<
 *     us -= td_to_us(myoffset)
 *     dt = dt_fr_us(us, tz)
 */
  __pyx_t_7.__pyx_n = 1;
  __pyx_t_7.utc = 0;
  __pyx_t_6 = __pyx_f_7cytimes_5utils_dt_to_us(__pyx_v_dt, &__pyx_t_7); if (unlikely(__pyx_t_6 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 1971, __pyx_L1_error)
  __pyx_v_us = __pyx_t_6;

  /* "cytimes/utils.pxd":1972
 *     # Convert to UTC time
 *     cdef long long us = dt_to_us(dt, False)
 *     us -= td_to_us(myoffset)             # <<<<<<<<<<<<<<
 *     dt = dt_fr_us(us, tz)
 * 
 */
  __pyx_t_6 = __pyx_f_7cytimes_5utils_td_to_us(__pyx_v_myoffset); if (unlikely(__pyx_t_6 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 1972, __pyx_L1_error)
  __pyx_v_us = (__pyx_v_us - __pyx_t_6);

  /* "cytimes/utils.pxd":1973
 *     cdef long long us = dt_to_us(dt, False)
 *     us -= td_to_us(myoffset)
 *     dt = dt_fr_us(us, tz)             # <<<<<<<<<<<<<<
 * 
 *     # Convert from UTC to tz's local time
 */
  __pyx_t_8.__pyx_n = 1;
  __pyx_t_8.tz = __pyx_v_tz;
  __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_us(__pyx_v_us, &__pyx_t_8)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_5));
  __pyx_t_5 = 0;

  /* "cytimes/utils.pxd":1976
 * 
 *     # Convert from UTC to tz's local time
 *     return tz.fromutc(dt)             # <<<<<<<<<<<<<<
 * 
 * # datetime.time ----------------------------------------------------------------------------------------
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_fromutc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = NULL;
  __pyx_t_10 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_10 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, ((PyObject *)__pyx_v_dt)};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(0, 1976, __pyx_L1_error)
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_5);
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1939
 *     )
 * 
 * cdef inline datetime.datetime dt_astimezone(datetime.datetime dt, object tz=None):             # <<<<<<<<<<<<<<
 *     """Convert the datetime timezone `<'datetime.datetime'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cytimes.utils.dt_astimezone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_mytz);
  __Pyx_XDECREF((PyObject *)__pyx_v_myoffset);
  __Pyx_XDECREF((PyObject *)__pyx_v_dt);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":1980
 * # datetime.time ----------------------------------------------------------------------------------------
 * # . generate
 * cdef inline datetime.time time_new(             # <<<<<<<<<<<<<<
 *     int hour=0, int minute=0, int second=0,
 *     int microsecond=0, object tz=None, int fold=0,
 */

static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_new(struct __pyx_opt_args_7cytimes_5utils_time_new *__pyx_optional_args) {
  int __pyx_v_hour = ((int)0);
  int __pyx_v_minute = ((int)0);
  int __pyx_v_second = ((int)0);
  int __pyx_v_microsecond = ((int)0);

  /* "cytimes/utils.pxd":1982
 * cdef inline datetime.time time_new(
 *     int hour=0, int minute=0, int second=0,
 *     int microsecond=0, object tz=None, int fold=0,             # <<<<<<<<<<<<<<
 * ):
 *     """Create a new time `<'datetime.time'>`.
 */
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  int __pyx_v_fold = ((int)0);
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_time_new __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_new", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_hour = __pyx_optional_args->hour;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_minute = __pyx_optional_args->minute;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_second = __pyx_optional_args->second;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_microsecond = __pyx_optional_args->microsecond;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_tz = __pyx_optional_args->tz;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_fold = __pyx_optional_args->fold;
              }
            }
          }
        }
      }
    }
  }

  /* "cytimes/utils.pxd":1989
 *     >>> datetime.time(hour, minute, second, microsecond, tz, fold)
 *     """
 *     hour = min(max(hour, 0), 23)             # <<<<<<<<<<<<<<
 *     minute = min(max(minute, 0), 59)
 *     second = min(max(second, 0), 59)
 */
  __pyx_t_1 = 23;
  __pyx_t_2 = 0;
  __pyx_t_3 = __pyx_v_hour;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_hour = __pyx_t_4;

  /* "cytimes/utils.pxd":1990
 *     """
 *     hour = min(max(hour, 0), 23)
 *     minute = min(max(minute, 0), 59)             # <<<<<<<<<<<<<<
 *     second = min(max(second, 0), 59)
 *     microsecond = min(max(microsecond, 0), 999_999)
 */
  __pyx_t_4 = 59;
  __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_v_minute;
  __pyx_t_5 = (__pyx_t_1 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  __pyx_t_1 = __pyx_t_2;
  __pyx_t_5 = (__pyx_t_4 < __pyx_t_1);
  if (__pyx_t_5) {
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_1;
  }
  __pyx_v_minute = __pyx_t_2;

  /* "cytimes/utils.pxd":1991
 *     hour = min(max(hour, 0), 23)
 *     minute = min(max(minute, 0), 59)
 *     second = min(max(second, 0), 59)             # <<<<<<<<<<<<<<
 *     microsecond = min(max(microsecond, 0), 999_999)
 *     return datetime.time_new(
 */
  __pyx_t_2 = 59;
  __pyx_t_4 = 0;
  __pyx_t_3 = __pyx_v_second;
  __pyx_t_5 = (__pyx_t_4 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_1 = __pyx_t_4;
  } else {
    __pyx_t_1 = __pyx_t_3;
  }
  __pyx_t_4 = __pyx_t_1;
  __pyx_t_5 = (__pyx_t_2 < __pyx_t_4);
  if (__pyx_t_5) {
    __pyx_t_1 = __pyx_t_2;
  } else {
    __pyx_t_1 = __pyx_t_4;
  }
  __pyx_v_second = __pyx_t_1;

  /* "cytimes/utils.pxd":1992
 *     minute = min(max(minute, 0), 59)
 *     second = min(max(second, 0), 59)
 *     microsecond = min(max(microsecond, 0), 999_999)             # <<<<<<<<<<<<<<
 *     return datetime.time_new(
 *         hour, minute, second, microsecond,
 */
  __pyx_t_1 = 0xF423F;
  __pyx_t_2 = 0;
  __pyx_t_3 = __pyx_v_microsecond;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_microsecond = __pyx_t_4;

  /* "cytimes/utils.pxd":1993
 *     second = min(max(second, 0), 59)
 *     microsecond = min(max(microsecond, 0), 999_999)
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         hour, minute, second, microsecond,
 *         tz, 1 if fold == 1 else 0,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/utils.pxd":1995
 *     return datetime.time_new(
 *         hour, minute, second, microsecond,
 *         tz, 1 if fold == 1 else 0,             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_5 = (__pyx_v_fold == 1);
  if (__pyx_t_5) {
    __pyx_t_3 = 1;
  } else {
    __pyx_t_3 = 0;
  }

  /* "cytimes/utils.pxd":1993
 *     second = min(max(second, 0), 59)
 *     microsecond = min(max(microsecond, 0), 999_999)
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         hour, minute, second, microsecond,
 *         tz, 1 if fold == 1 else 0,
 */
  __pyx_t_7.__pyx_n = 1;
  __pyx_t_7.fold = __pyx_t_3;
  __pyx_t_6 = ((PyObject *)__pyx_f_7cpython_8datetime_time_new(__pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, &__pyx_t_7)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = ((PyDateTime_Time *)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1980
 * # datetime.time ----------------------------------------------------------------------------------------
 * # . generate
 * cdef inline datetime.time time_new(             # <<<<<<<<<<<<<<
 *     int hour=0, int minute=0, int second=0,
 *     int microsecond=0, object tz=None, int fold=0,
 */

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

/* "cytimes/utils.pxd":1998
 *     )
 * 
 * cdef inline datetime.time time_now(object tz=None):             # <<<<<<<<<<<<<<
 *     """Get the current time `<'datetime.time'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_now(struct __pyx_opt_args_7cytimes_5utils_time_now *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  double __pyx_v_ts;
  PY_LONG_LONG __pyx_v_us;
  struct tm __pyx_v__tm;
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp __pyx_t_4;
  struct tm __pyx_t_5;
  struct __pyx_opt_args_7cpython_8datetime_time_new __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_now", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "cytimes/utils.pxd":2005
 *     """
 *     # With timezone
 *     if tz is not None:             # <<<<<<<<<<<<<<
 *         return time_fr_dt(datetime.datetime_from_timestamp(unix_time(), tz))
 * 
 */
  __pyx_t_1 = (__pyx_v_tz != Py_None);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2006
 *     # With timezone
 *     if tz is not None:
 *         return time_fr_dt(datetime.datetime_from_timestamp(unix_time(), tz))             # <<<<<<<<<<<<<<
 * 
 *     # Without timezone
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_f_7cpython_4time_time()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.tz = __pyx_v_tz;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_from_timestamp(__pyx_t_2, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_time_fr_dt(((PyDateTime_DateTime *)__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyDateTime_Time *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2005
 *     """
 *     # With timezone
 *     if tz is not None:             # <<<<<<<<<<<<<<
 *         return time_fr_dt(datetime.datetime_from_timestamp(unix_time(), tz))
 * 
 */
  }

  /* "cytimes/utils.pxd":2009
 * 
 *     # Without timezone
 *     cdef double ts = unix_time()             # <<<<<<<<<<<<<<
 *     cdef long long us = int(ts * 1_000_000)
 *     _tm = tm_localtime(ts)
 */
  __pyx_v_ts = __pyx_f_7cpython_4time_time();

  /* "cytimes/utils.pxd":2010
 *     # Without timezone
 *     cdef double ts = unix_time()
 *     cdef long long us = int(ts * 1_000_000)             # <<<<<<<<<<<<<<
 *     _tm = tm_localtime(ts)
 *     return datetime.time_new(
 */
  __pyx_v_us = ((PY_LONG_LONG)(__pyx_v_ts * 1000000.0));

  /* "cytimes/utils.pxd":2011
 *     cdef double ts = unix_time()
 *     cdef long long us = int(ts * 1_000_000)
 *     _tm = tm_localtime(ts)             # <<<<<<<<<<<<<<
 *     return datetime.time_new(
 *         _tm.tm_hour, _tm.tm_min, _tm.tm_sec, us % 1_000_000, None, 0
 */
  __pyx_t_5 = __pyx_f_7cytimes_5utils_tm_localtime(__pyx_v_ts); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2011, __pyx_L1_error)
  __pyx_v__tm = __pyx_t_5;

  /* "cytimes/utils.pxd":2012
 *     cdef long long us = int(ts * 1_000_000)
 *     _tm = tm_localtime(ts)
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         _tm.tm_hour, _tm.tm_min, _tm.tm_sec, us % 1_000_000, None, 0
 *     )
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/utils.pxd":2013
 *     _tm = tm_localtime(ts)
 *     return datetime.time_new(
 *         _tm.tm_hour, _tm.tm_min, _tm.tm_sec, us % 1_000_000, None, 0             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.fold = 0;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_time_new(__pyx_v__tm.tm_hour, __pyx_v__tm.tm_min, __pyx_v__tm.tm_sec, __Pyx_mod_PY_LONG_LONG(__pyx_v_us, 0xF4240), Py_None, &__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Time *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":1998
 *     )
 * 
 * cdef inline datetime.time time_now(object tz=None):             # <<<<<<<<<<<<<<
 *     """Get the current time `<'datetime.time'>`.
 * 
 */

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

/* "cytimes/utils.pxd":2017
 * 
 * # . type check
 * cdef inline bint is_time(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.time `<'bool'>`.
 * 
 */

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

  /* "cytimes/utils.pxd":2023
 *     >>> isinstance(obj, datetime.time)
 *     """
 *     return datetime.PyTime_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_time_exact(object obj) except -1:
 */
  __pyx_r = PyTime_Check(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2017
 * 
 * # . type check
 * cdef inline bint is_time(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.time `<'bool'>`.
 * 
 */

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

/* "cytimes/utils.pxd":2025
 *     return datetime.PyTime_Check(obj)
 * 
 * cdef inline bint is_time_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.time type `<'bool'>`.
 * 
 */

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

  /* "cytimes/utils.pxd":2031
 *     >>> type(obj) is datetime.time
 *     """
 *     return datetime.PyTime_CheckExact(obj)             # <<<<<<<<<<<<<<
 * 
 * # . tzinfo
 */
  __pyx_r = PyTime_CheckExact(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2025
 *     return datetime.PyTime_Check(obj)
 * 
 * cdef inline bint is_time_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.time type `<'bool'>`.
 * 
 */

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

/* "cytimes/utils.pxd":2034
 * 
 * # . tzinfo
 * cdef inline str time_tzname(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'tzname' of the time `<'str/None'>`.
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_time_tzname(PyDateTime_Time *__pyx_v_time) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_name __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_tzname", 1);

  /* "cytimes/utils.pxd":2040
 *     >>> time.tzname()
 *     """
 *     return tz_name(time.tzinfo, None)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta time_dst(datetime.time time):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.dt = ((PyDateTime_DateTime *)Py_None);
  __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_name(__pyx_t_1, &__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2034
 * 
 * # . tzinfo
 * cdef inline str time_tzname(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'tzname' of the time `<'str/None'>`.
 * 
 */

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

/* "cytimes/utils.pxd":2042
 *     return tz_name(time.tzinfo, None)
 * 
 * cdef inline datetime.timedelta time_dst(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'dst' of the time `<'datetime.timedelta/None'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_time_dst(PyDateTime_Time *__pyx_v_time) {
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_dst __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_dst", 1);

  /* "cytimes/utils.pxd":2048
 *     >>> time.dst()
 *     """
 *     return tz_dst(time.tzinfo, None)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta time_utcoffset(datetime.time time):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.dt = ((PyDateTime_DateTime *)Py_None);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_dst(__pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2042
 *     return tz_name(time.tzinfo, None)
 * 
 * cdef inline datetime.timedelta time_dst(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'dst' of the time `<'datetime.timedelta/None'>`.
 * 
 */

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

/* "cytimes/utils.pxd":2050
 *     return tz_dst(time.tzinfo, None)
 * 
 * cdef inline datetime.timedelta time_utcoffset(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'utcoffset' of the time `<'datetime.timedelta/None'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_time_utcoffset(PyDateTime_Time *__pyx_v_time) {
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_utcoffset", 1);

  /* "cytimes/utils.pxd":2056
 *     >>> time.utcoffset()
 *     """
 *     return tz_utcoffset(time.tzinfo, None)             # <<<<<<<<<<<<<<
 * 
 * # . conversion
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.dt = ((PyDateTime_DateTime *)Py_None);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2050
 *     return tz_dst(time.tzinfo, None)
 * 
 * cdef inline datetime.timedelta time_utcoffset(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'utcoffset' of the time `<'datetime.timedelta/None'>`.
 * 
 */

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

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

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_time_to_isoformat(PyDateTime_Time *__pyx_v_time, struct __pyx_opt_args_7cytimes_5utils_time_to_isoformat *__pyx_optional_args) {
  int __pyx_v_utc = ((int)0);
  int __pyx_v_us;
  PyObject *__pyx_v_utc_fmt = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcformat __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_to_isoformat", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_utc = __pyx_optional_args->utc;
    }
  }

  /* "cytimes/utils.pxd":2066
 *     """
 *     cdef:
 *         int us = time.microsecond             # <<<<<<<<<<<<<<
 *         str utc_fmt = tz_utcformat(time.tzinfo, None) if utc else None
 * 
 */
  __pyx_v_us = __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(__pyx_v_time);

  /* "cytimes/utils.pxd":2067
 *     cdef:
 *         int us = time.microsecond
 *         str utc_fmt = tz_utcformat(time.tzinfo, None) if utc else None             # <<<<<<<<<<<<<<
 * 
 *     if us == 0:
 */
  if (__pyx_v_utc) {
    __pyx_t_2 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2067, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.dt = ((PyDateTime_DateTime *)Py_None);
    __pyx_t_3 = __pyx_f_7cytimes_5utils_tz_utcformat(__pyx_t_2, &__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2067, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 2067, __pyx_L1_error)
  __pyx_v_utc_fmt = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":2069
 *         str utc_fmt = tz_utcformat(time.tzinfo, None) if utc else None
 * 
 *     if us == 0:             # <<<<<<<<<<<<<<
 *         if utc_fmt is None:
 *             return "%02d:%02d:%02d" % (time.hour, time.minute, time.second)
 */
  __pyx_t_5 = (__pyx_v_us == 0);
  if (__pyx_t_5) {

    /* "cytimes/utils.pxd":2070
 * 
 *     if us == 0:
 *         if utc_fmt is None:             # <<<<<<<<<<<<<<
 *             return "%02d:%02d:%02d" % (time.hour, time.minute, time.second)
 *         return "%02d:%02d:%02d%s" % (time.hour, time.minute, time.second, utc_fmt)
 */
    __pyx_t_5 = (__pyx_v_utc_fmt == ((PyObject*)Py_None));
    if (__pyx_t_5) {

      /* "cytimes/utils.pxd":2071
 *     if us == 0:
 *         if utc_fmt is None:
 *             return "%02d:%02d:%02d" % (time.hour, time.minute, time.second)             # <<<<<<<<<<<<<<
 *         return "%02d:%02d:%02d%s" % (time.hour, time.minute, time.second, utc_fmt)
 *     else:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2071, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = 0;
      __pyx_t_7 = 127;
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2071, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__11);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2071, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__11);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2071, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2071, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2070
 * 
 *     if us == 0:
 *         if utc_fmt is None:             # <<<<<<<<<<<<<<
 *             return "%02d:%02d:%02d" % (time.hour, time.minute, time.second)
 *         return "%02d:%02d:%02d%s" % (time.hour, time.minute, time.second, utc_fmt)
 */
    }

    /* "cytimes/utils.pxd":2072
 *         if utc_fmt is None:
 *             return "%02d:%02d:%02d" % (time.hour, time.minute, time.second)
 *         return "%02d:%02d:%02d%s" % (time.hour, time.minute, time.second, utc_fmt)             # <<<<<<<<<<<<<<
 *     else:
 *         if utc_fmt is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__11);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_kp_u__11);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_utc_fmt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 6, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2069
 *         str utc_fmt = tz_utcformat(time.tzinfo, None) if utc else None
 * 
 *     if us == 0:             # <<<<<<<<<<<<<<
 *         if utc_fmt is None:
 *             return "%02d:%02d:%02d" % (time.hour, time.minute, time.second)
 */
  }

  /* "cytimes/utils.pxd":2074
 *         return "%02d:%02d:%02d%s" % (time.hour, time.minute, time.second, utc_fmt)
 *     else:
 *         if utc_fmt is None:             # <<<<<<<<<<<<<<
 *             return "%02d:%02d:%02d.%06d" % (time.hour, time.minute, time.second, us)
 *         return "%02d:%02d:%02d.%06d%s" % (time.hour, time.minute, time.second, us, utc_fmt)
 */
  /*else*/ {
    __pyx_t_5 = (__pyx_v_utc_fmt == ((PyObject*)Py_None));
    if (__pyx_t_5) {

      /* "cytimes/utils.pxd":2075
 *     else:
 *         if utc_fmt is None:
 *             return "%02d:%02d:%02d.%06d" % (time.hour, time.minute, time.second, us)             # <<<<<<<<<<<<<<
 *         return "%02d:%02d:%02d.%06d%s" % (time.hour, time.minute, time.second, us, utc_fmt)
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2075, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = 0;
      __pyx_t_7 = 127;
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2075, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__11);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2075, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__11);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2075, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__14);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__14);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u__14);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_us, 6, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2075, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2075, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2074
 *         return "%02d:%02d:%02d%s" % (time.hour, time.minute, time.second, utc_fmt)
 *     else:
 *         if utc_fmt is None:             # <<<<<<<<<<<<<<
 *             return "%02d:%02d:%02d.%06d" % (time.hour, time.minute, time.second, us)
 *         return "%02d:%02d:%02d.%06d%s" % (time.hour, time.minute, time.second, us, utc_fmt)
 */
    }

    /* "cytimes/utils.pxd":2076
 *         if utc_fmt is None:
 *             return "%02d:%02d:%02d.%06d" % (time.hour, time.minute, time.second, us)
 *         return "%02d:%02d:%02d.%06d%s" % (time.hour, time.minute, time.second, us, utc_fmt)             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long time_to_us(datetime.time time, bint utc=False):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__11);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_kp_u__11);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__14);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__14);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_kp_u__14);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_us, 6, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_utc_fmt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 8, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

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

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

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

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_time_to_us(PyDateTime_Time *__pyx_v_time, struct __pyx_opt_args_7cytimes_5utils_time_to_us *__pyx_optional_args) {
  int __pyx_v_utc = ((int)0);
  PY_LONG_LONG __pyx_v_hh;
  PY_LONG_LONG __pyx_v_mi;
  PY_LONG_LONG __pyx_v_ss;
  PY_LONG_LONG __pyx_v_us;
  PyDateTime_Delta *__pyx_v_utc_off = NULL;
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PY_LONG_LONG __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_to_us", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_utc = __pyx_optional_args->utc;
    }
  }

  /* "cytimes/utils.pxd":2085
 *     """
 *     cdef:
 *         long long hh = time.hour             # <<<<<<<<<<<<<<
 *         long long mi = time.minute
 *         long long ss = time.second
 */
  __pyx_v_hh = __pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time);

  /* "cytimes/utils.pxd":2086
 *     cdef:
 *         long long hh = time.hour
 *         long long mi = time.minute             # <<<<<<<<<<<<<<
 *         long long ss = time.second
 *         long long us = time.microsecond
 */
  __pyx_v_mi = __pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time);

  /* "cytimes/utils.pxd":2087
 *         long long hh = time.hour
 *         long long mi = time.minute
 *         long long ss = time.second             # <<<<<<<<<<<<<<
 *         long long us = time.microsecond
 * 
 */
  __pyx_v_ss = __pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time);

  /* "cytimes/utils.pxd":2088
 *         long long mi = time.minute
 *         long long ss = time.second
 *         long long us = time.microsecond             # <<<<<<<<<<<<<<
 * 
 *     us += hh * US_HOUR + mi * US_MINUTE + ss * US_SECOND
 */
  __pyx_v_us = __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(__pyx_v_time);

  /* "cytimes/utils.pxd":2090
 *         long long us = time.microsecond
 * 
 *     us += hh * US_HOUR + mi * US_MINUTE + ss * US_SECOND             # <<<<<<<<<<<<<<
 *     if utc:
 *         utc_off = time_utcoffset(time)
 */
  __pyx_v_us = (__pyx_v_us + (((__pyx_v_hh * __pyx_v_7cytimes_5utils_US_HOUR) + (__pyx_v_mi * __pyx_v_7cytimes_5utils_US_MINUTE)) + (__pyx_v_ss * __pyx_v_7cytimes_5utils_US_SECOND)));

  /* "cytimes/utils.pxd":2091
 * 
 *     us += hh * US_HOUR + mi * US_MINUTE + ss * US_SECOND
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:
 */
  if (__pyx_v_utc) {

    /* "cytimes/utils.pxd":2092
 *     us += hh * US_HOUR + mi * US_MINUTE + ss * US_SECOND
 *     if utc:
 *         utc_off = time_utcoffset(time)             # <<<<<<<<<<<<<<
 *         if utc_off is not None:
 *             us -= td_to_us(utc_off)
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_time_utcoffset(__pyx_v_time)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2092, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_utc_off = ((PyDateTime_Delta *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/utils.pxd":2093
 *     if utc:
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             us -= td_to_us(utc_off)
 *     return us
 */
    __pyx_t_2 = (((PyObject *)__pyx_v_utc_off) != Py_None);
    if (__pyx_t_2) {

      /* "cytimes/utils.pxd":2094
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:
 *             us -= td_to_us(utc_off)             # <<<<<<<<<<<<<<
 *     return us
 * 
 */
      __pyx_t_3 = __pyx_f_7cytimes_5utils_td_to_us(__pyx_v_utc_off); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2094, __pyx_L1_error)
      __pyx_v_us = (__pyx_v_us - __pyx_t_3);

      /* "cytimes/utils.pxd":2093
 *     if utc:
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             us -= td_to_us(utc_off)
 *     return us
 */
    }

    /* "cytimes/utils.pxd":2091
 * 
 *     us += hh * US_HOUR + mi * US_MINUTE + ss * US_SECOND
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:
 */
  }

  /* "cytimes/utils.pxd":2095
 *         if utc_off is not None:
 *             us -= td_to_us(utc_off)
 *     return us             # <<<<<<<<<<<<<<
 * 
 * cdef inline double time_to_seconds(datetime.time time, bint utc=False):
 */
  __pyx_r = __pyx_v_us;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.time_to_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_utc_off);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static CYTHON_INLINE double __pyx_f_7cytimes_5utils_time_to_seconds(PyDateTime_Time *__pyx_v_time, struct __pyx_opt_args_7cytimes_5utils_time_to_seconds *__pyx_optional_args) {
  int __pyx_v_utc = ((int)0);
  double __pyx_v_hh;
  double __pyx_v_mi;
  double __pyx_v_ss;
  double __pyx_v_us;
  PyDateTime_Delta *__pyx_v_utc_off = NULL;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  double __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_to_seconds", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_utc = __pyx_optional_args->utc;
    }
  }

  /* "cytimes/utils.pxd":2104
 *     """
 *     cdef:
 *         double hh = time.hour             # <<<<<<<<<<<<<<
 *         double mi = time.minute
 *         double ss = time.second
 */
  __pyx_v_hh = __pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time);

  /* "cytimes/utils.pxd":2105
 *     cdef:
 *         double hh = time.hour
 *         double mi = time.minute             # <<<<<<<<<<<<<<
 *         double ss = time.second
 *         double us = time.microsecond
 */
  __pyx_v_mi = __pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time);

  /* "cytimes/utils.pxd":2106
 *         double hh = time.hour
 *         double mi = time.minute
 *         double ss = time.second             # <<<<<<<<<<<<<<
 *         double us = time.microsecond
 * 
 */
  __pyx_v_ss = __pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time);

  /* "cytimes/utils.pxd":2107
 *         double mi = time.minute
 *         double ss = time.second
 *         double us = time.microsecond             # <<<<<<<<<<<<<<
 * 
 *     ss += hh * SS_HOUR + mi * SS_MINUTE + us / 1_000_000
 */
  __pyx_v_us = __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(__pyx_v_time);

  /* "cytimes/utils.pxd":2109
 *         double us = time.microsecond
 * 
 *     ss += hh * SS_HOUR + mi * SS_MINUTE + us / 1_000_000             # <<<<<<<<<<<<<<
 *     if utc:
 *         utc_off = time_utcoffset(time)
 */
  __pyx_v_ss = (__pyx_v_ss + (((__pyx_v_hh * __pyx_v_7cytimes_5utils_SS_HOUR) + (__pyx_v_mi * __pyx_v_7cytimes_5utils_SS_MINUTE)) + (__pyx_v_us / 1000000.0)));

  /* "cytimes/utils.pxd":2110
 * 
 *     ss += hh * SS_HOUR + mi * SS_MINUTE + us / 1_000_000
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:
 */
  if (__pyx_v_utc) {

    /* "cytimes/utils.pxd":2111
 *     ss += hh * SS_HOUR + mi * SS_MINUTE + us / 1_000_000
 *     if utc:
 *         utc_off = time_utcoffset(time)             # <<<<<<<<<<<<<<
 *         if utc_off is not None:
 *             ss -= td_to_seconds(utc_off)
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_time_utcoffset(__pyx_v_time)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_utc_off = ((PyDateTime_Delta *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/utils.pxd":2112
 *     if utc:
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             ss -= td_to_seconds(utc_off)
 *     return ss
 */
    __pyx_t_2 = (((PyObject *)__pyx_v_utc_off) != Py_None);
    if (__pyx_t_2) {

      /* "cytimes/utils.pxd":2113
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:
 *             ss -= td_to_seconds(utc_off)             # <<<<<<<<<<<<<<
 *     return ss
 * 
 */
      __pyx_t_3 = __pyx_f_7cytimes_5utils_td_to_seconds(__pyx_v_utc_off); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2113, __pyx_L1_error)
      __pyx_v_ss = (__pyx_v_ss - __pyx_t_3);

      /* "cytimes/utils.pxd":2112
 *     if utc:
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             ss -= td_to_seconds(utc_off)
 *     return ss
 */
    }

    /* "cytimes/utils.pxd":2110
 * 
 *     ss += hh * SS_HOUR + mi * SS_MINUTE + us / 1_000_000
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:
 */
  }

  /* "cytimes/utils.pxd":2114
 *         if utc_off is not None:
 *             ss -= td_to_seconds(utc_off)
 *     return ss             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.time time_fr_us(long long val, object tz=None):
 */
  __pyx_r = __pyx_v_ss;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.time_to_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_utc_off);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_fr_us(PY_LONG_LONG __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils_time_fr_us *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  __pyx_t_7cytimes_5utils_hmsf __pyx_v__hmsf;
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_7cytimes_5utils_hmsf __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_time_new __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_fr_us", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "cytimes/utils.pxd":2118
 * cdef inline datetime.time time_fr_us(long long val, object tz=None):
 *     """Create time from microseconds (int) `<'datetime.time'>`."""
 *     _hmsf = hmsf_fr_us(val)             # <<<<<<<<<<<<<<
 *     return datetime.time_new(
 *         _hmsf.hour, _hmsf.minute, _hmsf.second, _hmsf.microsecond, tz, 0
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_hmsf_fr_us(__pyx_v_val); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2118, __pyx_L1_error)
  __pyx_v__hmsf = __pyx_t_1;

  /* "cytimes/utils.pxd":2119
 *     """Create time from microseconds (int) `<'datetime.time'>`."""
 *     _hmsf = hmsf_fr_us(val)
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         _hmsf.hour, _hmsf.minute, _hmsf.second, _hmsf.microsecond, tz, 0
 *     )
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/utils.pxd":2120
 *     _hmsf = hmsf_fr_us(val)
 *     return datetime.time_new(
 *         _hmsf.hour, _hmsf.minute, _hmsf.second, _hmsf.microsecond, tz, 0             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.fold = 0;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_time_new(__pyx_v__hmsf.hour, __pyx_v__hmsf.minute, __pyx_v__hmsf.second, __pyx_v__hmsf.microsecond, __pyx_v_tz, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Time *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_fr_seconds(double __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils_time_fr_seconds *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_time_fr_us __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_fr_seconds", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "cytimes/utils.pxd":2125
 * cdef inline datetime.time time_fr_seconds(double val, object tz=None):
 *     """Create time from seconds (float) `<'datetime.time'>`."""
 *     return time_fr_us(<long long> int(val * US_SECOND), tz)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.time time_fr_time(datetime.time time):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.tz = __pyx_v_tz;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_time_fr_us(((PY_LONG_LONG)((PY_LONG_LONG)(__pyx_v_val * __pyx_v_7cytimes_5utils_US_SECOND))), &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Time *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

/* "cytimes/utils.pxd":2127
 *     return time_fr_us(<long long> int(val * US_SECOND), tz)
 * 
 * cdef inline datetime.time time_fr_time(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Create time from another time (include subclass) `<'datetime.time'>`."""
 *     return datetime.time_new(
 */

static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_fr_time(PyDateTime_Time *__pyx_v_time) {
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_time_new __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_fr_time", 1);

  /* "cytimes/utils.pxd":2129
 * cdef inline datetime.time time_fr_time(datetime.time time):
 *     """Create time from another time (include subclass) `<'datetime.time'>`."""
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         time.hour, time.minute, time.second,
 *         time.microsecond, time.tzinfo, time.fold
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/utils.pxd":2131
 *     return datetime.time_new(
 *         time.hour, time.minute, time.second,
 *         time.microsecond, time.tzinfo, time.fold             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/utils.pxd":2129
 * cdef inline datetime.time time_fr_time(datetime.time time):
 *     """Create time from another time (include subclass) `<'datetime.time'>`."""
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         time.hour, time.minute, time.second,
 *         time.microsecond, time.tzinfo, time.fold
 */
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.fold = __pyx_f_7cpython_8datetime_4time_4fold_fold(__pyx_v_time);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_time_new(__pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time), __pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time), __pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time), __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(__pyx_v_time), __pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Time *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2127
 *     return time_fr_us(<long long> int(val * US_SECOND), tz)
 * 
 * cdef inline datetime.time time_fr_time(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Create time from another time (include subclass) `<'datetime.time'>`."""
 *     return datetime.time_new(
 */

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

/* "cytimes/utils.pxd":2134
 *     )
 * 
 * cdef inline datetime.time time_fr_dt(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Create time from datetime (include subclass) `<'datetime.time'>`."""
 *     return datetime.time_new(
 */

static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_fr_dt(PyDateTime_DateTime *__pyx_v_dt) {
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_time_new __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_fr_dt", 1);

  /* "cytimes/utils.pxd":2136
 * cdef inline datetime.time time_fr_dt(datetime.datetime dt):
 *     """Create time from datetime (include subclass) `<'datetime.time'>`."""
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         dt.hour, dt.minute, dt.second,
 *         dt.microsecond, dt.tzinfo, dt.fold
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/utils.pxd":2138
 *     return datetime.time_new(
 *         dt.hour, dt.minute, dt.second,
 *         dt.microsecond, dt.tzinfo, dt.fold             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/utils.pxd":2136
 * cdef inline datetime.time time_fr_dt(datetime.datetime dt):
 *     """Create time from datetime (include subclass) `<'datetime.time'>`."""
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         dt.hour, dt.minute, dt.second,
 *         dt.microsecond, dt.tzinfo, dt.fold
 */
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.fold = __pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_time_new(__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt), __pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Time *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2134
 *     )
 * 
 * cdef inline datetime.time time_fr_dt(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Create time from datetime (include subclass) `<'datetime.time'>`."""
 *     return datetime.time_new(
 */

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

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

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_td_new(struct __pyx_opt_args_7cytimes_5utils_td_new *__pyx_optional_args) {
  int __pyx_v_days = ((int)0);
  int __pyx_v_seconds = ((int)0);
  int __pyx_v_microseconds = ((int)0);
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td_new", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_days = __pyx_optional_args->days;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_seconds = __pyx_optional_args->seconds;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_microseconds = __pyx_optional_args->microseconds;
        }
      }
    }
  }

  /* "cytimes/utils.pxd":2149
 *     >>> datetime.timedelta(days, seconds, microseconds)
 *     """
 *     return datetime.timedelta_new(days, seconds, microseconds)             # <<<<<<<<<<<<<<
 * 
 * # . type check
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_seconds, __pyx_v_microseconds)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

/* "cytimes/utils.pxd":2152
 * 
 * # . type check
 * cdef inline bint is_td(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.timedelta `<'bool'>`.
 * 
 */

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

  /* "cytimes/utils.pxd":2158
 *     >>> isinstance(obj, datetime.timedelta)
 *     """
 *     return datetime.PyDelta_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_td_exact(object obj) except -1:
 */
  __pyx_r = PyDelta_Check(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2152
 * 
 * # . type check
 * cdef inline bint is_td(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.timedelta `<'bool'>`.
 * 
 */

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

/* "cytimes/utils.pxd":2160
 *     return datetime.PyDelta_Check(obj)
 * 
 * cdef inline bint is_td_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.timedelta type `<'bool'>`.
 * 
 */

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

  /* "cytimes/utils.pxd":2166
 *     >>> type(obj) is datetime.timedelta
 *     """
 *     return datetime.PyDelta_CheckExact(obj)             # <<<<<<<<<<<<<<
 * 
 * # . conversion
 */
  __pyx_r = PyDelta_CheckExact(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2160
 *     return datetime.PyDelta_Check(obj)
 * 
 * cdef inline bint is_td_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.timedelta type `<'bool'>`.
 * 
 */

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

/* "cytimes/utils.pxd":2169
 * 
 * # . conversion
 * cdef inline str td_to_isoformat(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Convert timedelta to string in ISO format `<'str'>`."""
 *     cdef:
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_td_to_isoformat(PyDateTime_Delta *__pyx_v_td) {
  PY_LONG_LONG __pyx_v_days;
  PY_LONG_LONG __pyx_v_hours;
  PY_LONG_LONG __pyx_v_minutes;
  PY_LONG_LONG __pyx_v_seconds;
  PY_LONG_LONG __pyx_v_us;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PY_LONG_LONG __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td_to_isoformat", 1);

  /* "cytimes/utils.pxd":2172
 *     """Convert timedelta to string in ISO format `<'str'>`."""
 *     cdef:
 *         long long days = td.day             # <<<<<<<<<<<<<<
 *         long long hours, minutes
 *         long long seconds = days * SS_DAY + td.second
 */
  __pyx_v_days = __pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td);

  /* "cytimes/utils.pxd":2174
 *         long long days = td.day
 *         long long hours, minutes
 *         long long seconds = days * SS_DAY + td.second             # <<<<<<<<<<<<<<
 *         long long us = td.microsecond
 * 
 */
  __pyx_v_seconds = ((__pyx_v_days * __pyx_v_7cytimes_5utils_SS_DAY) + __pyx_f_7cpython_8datetime_9timedelta_6second_second(__pyx_v_td));

  /* "cytimes/utils.pxd":2175
 *         long long hours, minutes
 *         long long seconds = days * SS_DAY + td.second
 *         long long us = td.microsecond             # <<<<<<<<<<<<<<
 * 
 *     # Positive timedelta
 */
  __pyx_v_us = __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(__pyx_v_td);

  /* "cytimes/utils.pxd":2178
 * 
 *     # Positive timedelta
 *     if seconds >= 0:             # <<<<<<<<<<<<<<
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         seconds -= hours * SS_HOUR
 */
  __pyx_t_1 = (__pyx_v_seconds >= 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2179
 *     # Positive timedelta
 *     if seconds >= 0:
 *         hours = math_floor_div(seconds, SS_HOUR)             # <<<<<<<<<<<<<<
 *         seconds -= hours * SS_HOUR
 *         minutes = math_floor_div(seconds, SS_MINUTE)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_seconds, __pyx_v_7cytimes_5utils_SS_HOUR, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2179, __pyx_L1_error)
    __pyx_v_hours = __pyx_t_2;

    /* "cytimes/utils.pxd":2180
 *     if seconds >= 0:
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         seconds -= hours * SS_HOUR             # <<<<<<<<<<<<<<
 *         minutes = math_floor_div(seconds, SS_MINUTE)
 *         seconds -= minutes * SS_MINUTE
 */
    __pyx_v_seconds = (__pyx_v_seconds - (__pyx_v_hours * __pyx_v_7cytimes_5utils_SS_HOUR));

    /* "cytimes/utils.pxd":2181
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         seconds -= hours * SS_HOUR
 *         minutes = math_floor_div(seconds, SS_MINUTE)             # <<<<<<<<<<<<<<
 *         seconds -= minutes * SS_MINUTE
 *         if us == 0:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_seconds, __pyx_v_7cytimes_5utils_SS_MINUTE, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2181, __pyx_L1_error)
    __pyx_v_minutes = __pyx_t_2;

    /* "cytimes/utils.pxd":2182
 *         seconds -= hours * SS_HOUR
 *         minutes = math_floor_div(seconds, SS_MINUTE)
 *         seconds -= minutes * SS_MINUTE             # <<<<<<<<<<<<<<
 *         if us == 0:
 *             return "%02d:%02d:%02d" % (hours, minutes, seconds)
 */
    __pyx_v_seconds = (__pyx_v_seconds - (__pyx_v_minutes * __pyx_v_7cytimes_5utils_SS_MINUTE));

    /* "cytimes/utils.pxd":2183
 *         minutes = math_floor_div(seconds, SS_MINUTE)
 *         seconds -= minutes * SS_MINUTE
 *         if us == 0:             # <<<<<<<<<<<<<<
 *             return "%02d:%02d:%02d" % (hours, minutes, seconds)
 *         return "%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 */
    __pyx_t_1 = (__pyx_v_us == 0);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":2184
 *         seconds -= minutes * SS_MINUTE
 *         if us == 0:
 *             return "%02d:%02d:%02d" % (hours, minutes, seconds)             # <<<<<<<<<<<<<<
 *         return "%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = 0;
      __pyx_t_5 = 127;
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_hours, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__11);
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_kp_u__11);
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = ((PyObject*)__pyx_t_6);
      __pyx_t_6 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2183
 *         minutes = math_floor_div(seconds, SS_MINUTE)
 *         seconds -= minutes * SS_MINUTE
 *         if us == 0:             # <<<<<<<<<<<<<<
 *             return "%02d:%02d:%02d" % (hours, minutes, seconds)
 *         return "%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 */
    }

    /* "cytimes/utils.pxd":2185
 *         if us == 0:
 *             return "%02d:%02d:%02d" % (hours, minutes, seconds)
 *         return "%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)             # <<<<<<<<<<<<<<
 * 
 *     # Negative w/o microseconds
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_hours, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_u__11);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_kp_u__11);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__14);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__14);
    PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_kp_u__14);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_us, 6, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_6, 7, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2178
 * 
 *     # Positive timedelta
 *     if seconds >= 0:             # <<<<<<<<<<<<<<
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         seconds -= hours * SS_HOUR
 */
  }

  /* "cytimes/utils.pxd":2188
 * 
 *     # Negative w/o microseconds
 *     if us == 0:             # <<<<<<<<<<<<<<
 *         seconds = -seconds
 *         if seconds >= SS_HOUR:
 */
  __pyx_t_1 = (__pyx_v_us == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2189
 *     # Negative w/o microseconds
 *     if us == 0:
 *         seconds = -seconds             # <<<<<<<<<<<<<<
 *         if seconds >= SS_HOUR:
 *             hours = math_floor_div(seconds, SS_HOUR)
 */
    __pyx_v_seconds = (-__pyx_v_seconds);

    /* "cytimes/utils.pxd":2190
 *     if us == 0:
 *         seconds = -seconds
 *         if seconds >= SS_HOUR:             # <<<<<<<<<<<<<<
 *             hours = math_floor_div(seconds, SS_HOUR)
 *             seconds -= hours * SS_HOUR
 */
    __pyx_t_1 = (__pyx_v_seconds >= __pyx_v_7cytimes_5utils_SS_HOUR);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":2191
 *         seconds = -seconds
 *         if seconds >= SS_HOUR:
 *             hours = math_floor_div(seconds, SS_HOUR)             # <<<<<<<<<<<<<<
 *             seconds -= hours * SS_HOUR
 *             minutes = math_floor_div(seconds, SS_MINUTE)
 */
      __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_seconds, __pyx_v_7cytimes_5utils_SS_HOUR, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2191, __pyx_L1_error)
      __pyx_v_hours = __pyx_t_2;

      /* "cytimes/utils.pxd":2192
 *         if seconds >= SS_HOUR:
 *             hours = math_floor_div(seconds, SS_HOUR)
 *             seconds -= hours * SS_HOUR             # <<<<<<<<<<<<<<
 *             minutes = math_floor_div(seconds, SS_MINUTE)
 *             seconds -= minutes * SS_MINUTE
 */
      __pyx_v_seconds = (__pyx_v_seconds - (__pyx_v_hours * __pyx_v_7cytimes_5utils_SS_HOUR));

      /* "cytimes/utils.pxd":2193
 *             hours = math_floor_div(seconds, SS_HOUR)
 *             seconds -= hours * SS_HOUR
 *             minutes = math_floor_div(seconds, SS_MINUTE)             # <<<<<<<<<<<<<<
 *             seconds -= minutes * SS_MINUTE
 *             return "-%02d:%02d:%02d" % (hours, minutes, seconds)
 */
      __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_seconds, __pyx_v_7cytimes_5utils_SS_MINUTE, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2193, __pyx_L1_error)
      __pyx_v_minutes = __pyx_t_2;

      /* "cytimes/utils.pxd":2194
 *             seconds -= hours * SS_HOUR
 *             minutes = math_floor_div(seconds, SS_MINUTE)
 *             seconds -= minutes * SS_MINUTE             # <<<<<<<<<<<<<<
 *             return "-%02d:%02d:%02d" % (hours, minutes, seconds)
 *         if seconds >= SS_MINUTE:
 */
      __pyx_v_seconds = (__pyx_v_seconds - (__pyx_v_minutes * __pyx_v_7cytimes_5utils_SS_MINUTE));

      /* "cytimes/utils.pxd":2195
 *             minutes = math_floor_div(seconds, SS_MINUTE)
 *             seconds -= minutes * SS_MINUTE
 *             return "-%02d:%02d:%02d" % (hours, minutes, seconds)             # <<<<<<<<<<<<<<
 *         if seconds >= SS_MINUTE:
 *             minutes = math_floor_div(seconds, SS_MINUTE)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2195, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = 0;
      __pyx_t_5 = 127;
      __Pyx_INCREF(__pyx_kp_u__9);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__9);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__9);
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_hours, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2195, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__11);
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2195, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__11);
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2195, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 6, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2195, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = ((PyObject*)__pyx_t_6);
      __pyx_t_6 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2190
 *     if us == 0:
 *         seconds = -seconds
 *         if seconds >= SS_HOUR:             # <<<<<<<<<<<<<<
 *             hours = math_floor_div(seconds, SS_HOUR)
 *             seconds -= hours * SS_HOUR
 */
    }

    /* "cytimes/utils.pxd":2196
 *             seconds -= minutes * SS_MINUTE
 *             return "-%02d:%02d:%02d" % (hours, minutes, seconds)
 *         if seconds >= SS_MINUTE:             # <<<<<<<<<<<<<<
 *             minutes = math_floor_div(seconds, SS_MINUTE)
 *             seconds -= minutes * SS_MINUTE
 */
    __pyx_t_1 = (__pyx_v_seconds >= __pyx_v_7cytimes_5utils_SS_MINUTE);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":2197
 *             return "-%02d:%02d:%02d" % (hours, minutes, seconds)
 *         if seconds >= SS_MINUTE:
 *             minutes = math_floor_div(seconds, SS_MINUTE)             # <<<<<<<<<<<<<<
 *             seconds -= minutes * SS_MINUTE
 *             return "-00:%02d:%02d" % (minutes, seconds)
 */
      __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_seconds, __pyx_v_7cytimes_5utils_SS_MINUTE, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2197, __pyx_L1_error)
      __pyx_v_minutes = __pyx_t_2;

      /* "cytimes/utils.pxd":2198
 *         if seconds >= SS_MINUTE:
 *             minutes = math_floor_div(seconds, SS_MINUTE)
 *             seconds -= minutes * SS_MINUTE             # <<<<<<<<<<<<<<
 *             return "-00:%02d:%02d" % (minutes, seconds)
 *         return "-00:00:%02d" % seconds
 */
      __pyx_v_seconds = (__pyx_v_seconds - (__pyx_v_minutes * __pyx_v_7cytimes_5utils_SS_MINUTE));

      /* "cytimes/utils.pxd":2199
 *             minutes = math_floor_div(seconds, SS_MINUTE)
 *             seconds -= minutes * SS_MINUTE
 *             return "-00:%02d:%02d" % (minutes, seconds)             # <<<<<<<<<<<<<<
 *         return "-00:00:%02d" % seconds
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = 0;
      __pyx_t_5 = 127;
      __Pyx_INCREF(__pyx_kp_u_00);
      __pyx_t_4 += 4;
      __Pyx_GIVEREF(__pyx_kp_u_00);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_00);
      __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__11);
      __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_6, 4, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2196
 *             seconds -= minutes * SS_MINUTE
 *             return "-%02d:%02d:%02d" % (hours, minutes, seconds)
 *         if seconds >= SS_MINUTE:             # <<<<<<<<<<<<<<
 *             minutes = math_floor_div(seconds, SS_MINUTE)
 *             seconds -= minutes * SS_MINUTE
 */
    }

    /* "cytimes/utils.pxd":2200
 *             seconds -= minutes * SS_MINUTE
 *             return "-00:%02d:%02d" % (minutes, seconds)
 *         return "-00:00:%02d" % seconds             # <<<<<<<<<<<<<<
 * 
 *     # Negative w/t microseconds
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_seconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_00_00_02d, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2188
 * 
 *     # Negative w/o microseconds
 *     if us == 0:             # <<<<<<<<<<<<<<
 *         seconds = -seconds
 *         if seconds >= SS_HOUR:
 */
  }

  /* "cytimes/utils.pxd":2203
 * 
 *     # Negative w/t microseconds
 *     us = -(seconds * US_SECOND + us)             # <<<<<<<<<<<<<<
 *     if us >= US_HOUR:
 *         hours = math_floor_div(us, US_HOUR)
 */
  __pyx_v_us = (-((__pyx_v_seconds * __pyx_v_7cytimes_5utils_US_SECOND) + __pyx_v_us));

  /* "cytimes/utils.pxd":2204
 *     # Negative w/t microseconds
 *     us = -(seconds * US_SECOND + us)
 *     if us >= US_HOUR:             # <<<<<<<<<<<<<<
 *         hours = math_floor_div(us, US_HOUR)
 *         us -= hours * US_HOUR
 */
  __pyx_t_1 = (__pyx_v_us >= __pyx_v_7cytimes_5utils_US_HOUR);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2205
 *     us = -(seconds * US_SECOND + us)
 *     if us >= US_HOUR:
 *         hours = math_floor_div(us, US_HOUR)             # <<<<<<<<<<<<<<
 *         us -= hours * US_HOUR
 *         minutes = math_floor_div(us, US_MINUTE)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_us, __pyx_v_7cytimes_5utils_US_HOUR, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2205, __pyx_L1_error)
    __pyx_v_hours = __pyx_t_2;

    /* "cytimes/utils.pxd":2206
 *     if us >= US_HOUR:
 *         hours = math_floor_div(us, US_HOUR)
 *         us -= hours * US_HOUR             # <<<<<<<<<<<<<<
 *         minutes = math_floor_div(us, US_MINUTE)
 *         us -= minutes * US_MINUTE
 */
    __pyx_v_us = (__pyx_v_us - (__pyx_v_hours * __pyx_v_7cytimes_5utils_US_HOUR));

    /* "cytimes/utils.pxd":2207
 *         hours = math_floor_div(us, US_HOUR)
 *         us -= hours * US_HOUR
 *         minutes = math_floor_div(us, US_MINUTE)             # <<<<<<<<<<<<<<
 *         us -= minutes * US_MINUTE
 *         seconds = math_floor_div(us, US_SECOND)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_us, __pyx_v_7cytimes_5utils_US_MINUTE, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2207, __pyx_L1_error)
    __pyx_v_minutes = __pyx_t_2;

    /* "cytimes/utils.pxd":2208
 *         us -= hours * US_HOUR
 *         minutes = math_floor_div(us, US_MINUTE)
 *         us -= minutes * US_MINUTE             # <<<<<<<<<<<<<<
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND
 */
    __pyx_v_us = (__pyx_v_us - (__pyx_v_minutes * __pyx_v_7cytimes_5utils_US_MINUTE));

    /* "cytimes/utils.pxd":2209
 *         minutes = math_floor_div(us, US_MINUTE)
 *         us -= minutes * US_MINUTE
 *         seconds = math_floor_div(us, US_SECOND)             # <<<<<<<<<<<<<<
 *         us -= seconds * US_SECOND
 *         return "-%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_us, __pyx_v_7cytimes_5utils_US_SECOND, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2209, __pyx_L1_error)
    __pyx_v_seconds = __pyx_t_2;

    /* "cytimes/utils.pxd":2210
 *         us -= minutes * US_MINUTE
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND             # <<<<<<<<<<<<<<
 *         return "-%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 *     if us >= US_MINUTE:
 */
    __pyx_v_us = (__pyx_v_us - (__pyx_v_seconds * __pyx_v_7cytimes_5utils_US_SECOND));

    /* "cytimes/utils.pxd":2211
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND
 *         return "-%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)             # <<<<<<<<<<<<<<
 *     if us >= US_MINUTE:
 *         minutes = math_floor_div(us, US_MINUTE)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = PyTuple_New(8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u__9);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__9);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u__9);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_hours, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__11);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u__11);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__14);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__14);
    PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_kp_u__14);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_us, 6, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 7, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_6, 8, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2204
 *     # Negative w/t microseconds
 *     us = -(seconds * US_SECOND + us)
 *     if us >= US_HOUR:             # <<<<<<<<<<<<<<
 *         hours = math_floor_div(us, US_HOUR)
 *         us -= hours * US_HOUR
 */
  }

  /* "cytimes/utils.pxd":2212
 *         us -= seconds * US_SECOND
 *         return "-%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 *     if us >= US_MINUTE:             # <<<<<<<<<<<<<<
 *         minutes = math_floor_div(us, US_MINUTE)
 *         us -= minutes * US_MINUTE
 */
  __pyx_t_1 = (__pyx_v_us >= __pyx_v_7cytimes_5utils_US_MINUTE);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2213
 *         return "-%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 *     if us >= US_MINUTE:
 *         minutes = math_floor_div(us, US_MINUTE)             # <<<<<<<<<<<<<<
 *         us -= minutes * US_MINUTE
 *         seconds = math_floor_div(us, US_SECOND)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_us, __pyx_v_7cytimes_5utils_US_MINUTE, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2213, __pyx_L1_error)
    __pyx_v_minutes = __pyx_t_2;

    /* "cytimes/utils.pxd":2214
 *     if us >= US_MINUTE:
 *         minutes = math_floor_div(us, US_MINUTE)
 *         us -= minutes * US_MINUTE             # <<<<<<<<<<<<<<
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND
 */
    __pyx_v_us = (__pyx_v_us - (__pyx_v_minutes * __pyx_v_7cytimes_5utils_US_MINUTE));

    /* "cytimes/utils.pxd":2215
 *         minutes = math_floor_div(us, US_MINUTE)
 *         us -= minutes * US_MINUTE
 *         seconds = math_floor_div(us, US_SECOND)             # <<<<<<<<<<<<<<
 *         us -= seconds * US_SECOND
 *         return "-00:%02d:%02d.%06d" % (minutes, seconds, us)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_us, __pyx_v_7cytimes_5utils_US_SECOND, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2215, __pyx_L1_error)
    __pyx_v_seconds = __pyx_t_2;

    /* "cytimes/utils.pxd":2216
 *         us -= minutes * US_MINUTE
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND             # <<<<<<<<<<<<<<
 *         return "-00:%02d:%02d.%06d" % (minutes, seconds, us)
 *     if us >= US_SECOND:
 */
    __pyx_v_us = (__pyx_v_us - (__pyx_v_seconds * __pyx_v_7cytimes_5utils_US_SECOND));

    /* "cytimes/utils.pxd":2217
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND
 *         return "-00:%02d:%02d.%06d" % (minutes, seconds, us)             # <<<<<<<<<<<<<<
 *     if us >= US_SECOND:
 *         seconds = math_floor_div(us, US_SECOND)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_00);
    __pyx_t_4 += 4;
    __Pyx_GIVEREF(__pyx_kp_u_00);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_00);
    __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__11);
    __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u__14);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__14);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__14);
    __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_us, 6, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 6, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2212
 *         us -= seconds * US_SECOND
 *         return "-%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 *     if us >= US_MINUTE:             # <<<<<<<<<<<<<<
 *         minutes = math_floor_div(us, US_MINUTE)
 *         us -= minutes * US_MINUTE
 */
  }

  /* "cytimes/utils.pxd":2218
 *         us -= seconds * US_SECOND
 *         return "-00:%02d:%02d.%06d" % (minutes, seconds, us)
 *     if us >= US_SECOND:             # <<<<<<<<<<<<<<
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND
 */
  __pyx_t_1 = (__pyx_v_us >= __pyx_v_7cytimes_5utils_US_SECOND);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2219
 *         return "-00:%02d:%02d.%06d" % (minutes, seconds, us)
 *     if us >= US_SECOND:
 *         seconds = math_floor_div(us, US_SECOND)             # <<<<<<<<<<<<<<
 *         us -= seconds * US_SECOND
 *         return "-00:00:%02d.%06d" % (seconds, us)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_us, __pyx_v_7cytimes_5utils_US_SECOND, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2219, __pyx_L1_error)
    __pyx_v_seconds = __pyx_t_2;

    /* "cytimes/utils.pxd":2220
 *     if us >= US_SECOND:
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND             # <<<<<<<<<<<<<<
 *         return "-00:00:%02d.%06d" % (seconds, us)
 *     return "-00:00:00.%06d" % us
 */
    __pyx_v_us = (__pyx_v_us - (__pyx_v_seconds * __pyx_v_7cytimes_5utils_US_SECOND));

    /* "cytimes/utils.pxd":2221
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND
 *         return "-00:00:%02d.%06d" % (seconds, us)             # <<<<<<<<<<<<<<
 *     return "-00:00:00.%06d" % us
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_00_00);
    __pyx_t_4 += 7;
    __Pyx_GIVEREF(__pyx_kp_u_00_00);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_00_00);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__14);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__14);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__14);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_us, 6, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_6, 4, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2218
 *         us -= seconds * US_SECOND
 *         return "-00:%02d:%02d.%06d" % (minutes, seconds, us)
 *     if us >= US_SECOND:             # <<<<<<<<<<<<<<
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND
 */
  }

  /* "cytimes/utils.pxd":2222
 *         us -= seconds * US_SECOND
 *         return "-00:00:%02d.%06d" % (seconds, us)
 *     return "-00:00:00.%06d" % us             # <<<<<<<<<<<<<<
 * 
 * cdef inline str td_to_utcformat(datetime.timedelta td):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_us); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_00_00_00_06d, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2169
 * 
 * # . conversion
 * cdef inline str td_to_isoformat(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Convert timedelta to string in ISO format `<'str'>`."""
 *     cdef:
 */

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

/* "cytimes/utils.pxd":2224
 *     return "-00:00:00.%06d" % us
 * 
 * cdef inline str td_to_utcformat(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Convert timedelta to string in UTC format ('+/-HH:MM') `<'str'>`."""
 *     cdef:
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_td_to_utcformat(PyDateTime_Delta *__pyx_v_td) {
  PY_LONG_LONG __pyx_v_days;
  PY_LONG_LONG __pyx_v_hours;
  PY_LONG_LONG __pyx_v_minutes;
  PY_LONG_LONG __pyx_v_seconds;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PY_LONG_LONG __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td_to_utcformat", 1);

  /* "cytimes/utils.pxd":2227
 *     """Convert timedelta to string in UTC format ('+/-HH:MM') `<'str'>`."""
 *     cdef:
 *         long long days = td.day             # <<<<<<<<<<<<<<
 *         long long hours, minutes
 *         long long seconds = days * SS_DAY + td.second
 */
  __pyx_v_days = __pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td);

  /* "cytimes/utils.pxd":2229
 *         long long days = td.day
 *         long long hours, minutes
 *         long long seconds = days * SS_DAY + td.second             # <<<<<<<<<<<<<<
 *     # Positive timedelta
 *     if seconds >= 0:
 */
  __pyx_v_seconds = ((__pyx_v_days * __pyx_v_7cytimes_5utils_SS_DAY) + __pyx_f_7cpython_8datetime_9timedelta_6second_second(__pyx_v_td));

  /* "cytimes/utils.pxd":2231
 *         long long seconds = days * SS_DAY + td.second
 *     # Positive timedelta
 *     if seconds >= 0:             # <<<<<<<<<<<<<<
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         minutes = math_floor_div(seconds - hours * SS_HOUR, SS_MINUTE)
 */
  __pyx_t_1 = (__pyx_v_seconds >= 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2232
 *     # Positive timedelta
 *     if seconds >= 0:
 *         hours = math_floor_div(seconds, SS_HOUR)             # <<<<<<<<<<<<<<
 *         minutes = math_floor_div(seconds - hours * SS_HOUR, SS_MINUTE)
 *         return "+%02d%02d" % (hours, minutes)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_seconds, __pyx_v_7cytimes_5utils_SS_HOUR, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2232, __pyx_L1_error)
    __pyx_v_hours = __pyx_t_2;

    /* "cytimes/utils.pxd":2233
 *     if seconds >= 0:
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         minutes = math_floor_div(seconds - hours * SS_HOUR, SS_MINUTE)             # <<<<<<<<<<<<<<
 *         return "+%02d%02d" % (hours, minutes)
 *     # Negative timedelta
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div((__pyx_v_seconds - (__pyx_v_hours * __pyx_v_7cytimes_5utils_SS_HOUR)), __pyx_v_7cytimes_5utils_SS_MINUTE, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2233, __pyx_L1_error)
    __pyx_v_minutes = __pyx_t_2;

    /* "cytimes/utils.pxd":2234
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         minutes = math_floor_div(seconds - hours * SS_HOUR, SS_MINUTE)
 *         return "+%02d%02d" % (hours, minutes)             # <<<<<<<<<<<<<<
 *     # Negative timedelta
 *     else:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u__15);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__15);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__15);
    __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_hours, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2231
 *         long long seconds = days * SS_DAY + td.second
 *     # Positive timedelta
 *     if seconds >= 0:             # <<<<<<<<<<<<<<
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         minutes = math_floor_div(seconds - hours * SS_HOUR, SS_MINUTE)
 */
  }

  /* "cytimes/utils.pxd":2237
 *     # Negative timedelta
 *     else:
 *         seconds = -seconds             # <<<<<<<<<<<<<<
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         minutes = math_floor_div(seconds - hours * SS_HOUR, SS_MINUTE)
 */
  /*else*/ {
    __pyx_v_seconds = (-__pyx_v_seconds);

    /* "cytimes/utils.pxd":2238
 *     else:
 *         seconds = -seconds
 *         hours = math_floor_div(seconds, SS_HOUR)             # <<<<<<<<<<<<<<
 *         minutes = math_floor_div(seconds - hours * SS_HOUR, SS_MINUTE)
 *         return "-%02d%02d" % (hours, minutes)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_seconds, __pyx_v_7cytimes_5utils_SS_HOUR, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2238, __pyx_L1_error)
    __pyx_v_hours = __pyx_t_2;

    /* "cytimes/utils.pxd":2239
 *         seconds = -seconds
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         minutes = math_floor_div(seconds - hours * SS_HOUR, SS_MINUTE)             # <<<<<<<<<<<<<<
 *         return "-%02d%02d" % (hours, minutes)
 * 
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div((__pyx_v_seconds - (__pyx_v_hours * __pyx_v_7cytimes_5utils_SS_HOUR)), __pyx_v_7cytimes_5utils_SS_MINUTE, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2239, __pyx_L1_error)
    __pyx_v_minutes = __pyx_t_2;

    /* "cytimes/utils.pxd":2240
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         minutes = math_floor_div(seconds - hours * SS_HOUR, SS_MINUTE)
 *         return "-%02d%02d" % (hours, minutes)             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long td_to_us(datetime.timedelta td):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u__9);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__9);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u__9);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_hours, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "cytimes/utils.pxd":2224
 *     return "-00:00:00.%06d" % us
 * 
 * cdef inline str td_to_utcformat(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Convert timedelta to string in UTC format ('+/-HH:MM') `<'str'>`."""
 *     cdef:
 */

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

/* "cytimes/utils.pxd":2242
 *         return "-%02d%02d" % (hours, minutes)
 * 
 * cdef inline long long td_to_us(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Convert timedelta to microseconds `<'int'>`."""
 *     cdef:
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_td_to_us(PyDateTime_Delta *__pyx_v_td) {
  PY_LONG_LONG __pyx_v_days;
  PY_LONG_LONG __pyx_v_seconds;
  PY_LONG_LONG __pyx_v_us;
  PY_LONG_LONG __pyx_r;

  /* "cytimes/utils.pxd":2245
 *     """Convert timedelta to microseconds `<'int'>`."""
 *     cdef:
 *         long long days = td.day             # <<<<<<<<<<<<<<
 *         long long seconds = td.second
 *         long long us = td.microsecond
 */
  __pyx_v_days = __pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td);

  /* "cytimes/utils.pxd":2246
 *     cdef:
 *         long long days = td.day
 *         long long seconds = td.second             # <<<<<<<<<<<<<<
 *         long long us = td.microsecond
 *     return days * US_DAY + seconds * US_SECOND + us
 */
  __pyx_v_seconds = __pyx_f_7cpython_8datetime_9timedelta_6second_second(__pyx_v_td);

  /* "cytimes/utils.pxd":2247
 *         long long days = td.day
 *         long long seconds = td.second
 *         long long us = td.microsecond             # <<<<<<<<<<<<<<
 *     return days * US_DAY + seconds * US_SECOND + us
 * 
 */
  __pyx_v_us = __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(__pyx_v_td);

  /* "cytimes/utils.pxd":2248
 *         long long seconds = td.second
 *         long long us = td.microsecond
 *     return days * US_DAY + seconds * US_SECOND + us             # <<<<<<<<<<<<<<
 * 
 * cdef inline double td_to_seconds(datetime.timedelta td):
 */
  __pyx_r = (((__pyx_v_days * __pyx_v_7cytimes_5utils_US_DAY) + (__pyx_v_seconds * __pyx_v_7cytimes_5utils_US_SECOND)) + __pyx_v_us);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2242
 *         return "-%02d%02d" % (hours, minutes)
 * 
 * cdef inline long long td_to_us(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Convert timedelta to microseconds `<'int'>`."""
 *     cdef:
 */

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

/* "cytimes/utils.pxd":2250
 *     return days * US_DAY + seconds * US_SECOND + us
 * 
 * cdef inline double td_to_seconds(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Convert timedelta to seconds `<'float'>`."""
 *     cdef:
 */

static CYTHON_INLINE double __pyx_f_7cytimes_5utils_td_to_seconds(PyDateTime_Delta *__pyx_v_td) {
  double __pyx_v_days;
  double __pyx_v_seconds;
  double __pyx_v_us;
  double __pyx_r;

  /* "cytimes/utils.pxd":2253
 *     """Convert timedelta to seconds `<'float'>`."""
 *     cdef:
 *         double days = td.day             # <<<<<<<<<<<<<<
 *         double seconds = td.second
 *         double us = td.microsecond
 */
  __pyx_v_days = __pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td);

  /* "cytimes/utils.pxd":2254
 *     cdef:
 *         double days = td.day
 *         double seconds = td.second             # <<<<<<<<<<<<<<
 *         double us = td.microsecond
 *     return days * SS_DAY + seconds + us / 1_000_000
 */
  __pyx_v_seconds = __pyx_f_7cpython_8datetime_9timedelta_6second_second(__pyx_v_td);

  /* "cytimes/utils.pxd":2255
 *         double days = td.day
 *         double seconds = td.second
 *         double us = td.microsecond             # <<<<<<<<<<<<<<
 *     return days * SS_DAY + seconds + us / 1_000_000
 * 
 */
  __pyx_v_us = __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(__pyx_v_td);

  /* "cytimes/utils.pxd":2256
 *         double seconds = td.second
 *         double us = td.microsecond
 *     return days * SS_DAY + seconds + us / 1_000_000             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta td_fr_us(long long val):
 */
  __pyx_r = (((__pyx_v_days * __pyx_v_7cytimes_5utils_SS_DAY) + __pyx_v_seconds) + (__pyx_v_us / 1000000.0));
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2250
 *     return days * US_DAY + seconds * US_SECOND + us
 * 
 * cdef inline double td_to_seconds(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Convert timedelta to seconds `<'float'>`."""
 *     cdef:
 */

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

/* "cytimes/utils.pxd":2258
 *     return days * SS_DAY + seconds + us / 1_000_000
 * 
 * cdef inline datetime.timedelta td_fr_us(long long val):             # <<<<<<<<<<<<<<
 *     """Create timedelta from microseconds (int) `<'datetime.timedelta'>`."""
 *     cdef long long days, seconds
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_td_fr_us(PY_LONG_LONG __pyx_v_val) {
  PY_LONG_LONG __pyx_v_days;
  PY_LONG_LONG __pyx_v_seconds;
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PY_LONG_LONG __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td_fr_us", 1);

  /* "cytimes/utils.pxd":2261
 *     """Create timedelta from microseconds (int) `<'datetime.timedelta'>`."""
 *     cdef long long days, seconds
 *     days = math_floor_div(val, US_DAY)             # <<<<<<<<<<<<<<
 *     val -= days * US_DAY
 *     seconds = math_floor_div(val, US_SECOND)
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_val, __pyx_v_7cytimes_5utils_US_DAY, NULL); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2261, __pyx_L1_error)
  __pyx_v_days = __pyx_t_1;

  /* "cytimes/utils.pxd":2262
 *     cdef long long days, seconds
 *     days = math_floor_div(val, US_DAY)
 *     val -= days * US_DAY             # <<<<<<<<<<<<<<
 *     seconds = math_floor_div(val, US_SECOND)
 *     val -= seconds * US_SECOND
 */
  __pyx_v_val = (__pyx_v_val - (__pyx_v_days * __pyx_v_7cytimes_5utils_US_DAY));

  /* "cytimes/utils.pxd":2263
 *     days = math_floor_div(val, US_DAY)
 *     val -= days * US_DAY
 *     seconds = math_floor_div(val, US_SECOND)             # <<<<<<<<<<<<<<
 *     val -= seconds * US_SECOND
 *     return datetime.timedelta_new(days, seconds, val)
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_val, __pyx_v_7cytimes_5utils_US_SECOND, NULL); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2263, __pyx_L1_error)
  __pyx_v_seconds = __pyx_t_1;

  /* "cytimes/utils.pxd":2264
 *     val -= days * US_DAY
 *     seconds = math_floor_div(val, US_SECOND)
 *     val -= seconds * US_SECOND             # <<<<<<<<<<<<<<
 *     return datetime.timedelta_new(days, seconds, val)
 * 
 */
  __pyx_v_val = (__pyx_v_val - (__pyx_v_seconds * __pyx_v_7cytimes_5utils_US_SECOND));

  /* "cytimes/utils.pxd":2265
 *     seconds = math_floor_div(val, US_SECOND)
 *     val -= seconds * US_SECOND
 *     return datetime.timedelta_new(days, seconds, val)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta td_fr_seconds(double val):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_seconds, __pyx_v_val)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2258
 *     return days * SS_DAY + seconds + us / 1_000_000
 * 
 * cdef inline datetime.timedelta td_fr_us(long long val):             # <<<<<<<<<<<<<<
 *     """Create timedelta from microseconds (int) `<'datetime.timedelta'>`."""
 *     cdef long long days, seconds
 */

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

/* "cytimes/utils.pxd":2267
 *     return datetime.timedelta_new(days, seconds, val)
 * 
 * cdef inline datetime.timedelta td_fr_seconds(double val):             # <<<<<<<<<<<<<<
 *     """Create timedelta from seconds (float) `<'datetime.timedelta'>`."""
 *     return td_fr_us(<long long> int(val * US_SECOND))
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_td_fr_seconds(double __pyx_v_val) {
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td_fr_seconds", 1);

  /* "cytimes/utils.pxd":2269
 * cdef inline datetime.timedelta td_fr_seconds(double val):
 *     """Create timedelta from seconds (float) `<'datetime.timedelta'>`."""
 *     return td_fr_us(<long long> int(val * US_SECOND))             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta td_fr_td(datetime.timedelta td):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_td_fr_us(((PY_LONG_LONG)((PY_LONG_LONG)(__pyx_v_val * __pyx_v_7cytimes_5utils_US_SECOND))))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2267
 *     return datetime.timedelta_new(days, seconds, val)
 * 
 * cdef inline datetime.timedelta td_fr_seconds(double val):             # <<<<<<<<<<<<<<
 *     """Create timedelta from seconds (float) `<'datetime.timedelta'>`."""
 *     return td_fr_us(<long long> int(val * US_SECOND))
 */

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

/* "cytimes/utils.pxd":2271
 *     return td_fr_us(<long long> int(val * US_SECOND))
 * 
 * cdef inline datetime.timedelta td_fr_td(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Create timedelta from another timedelta (include subclass) `<'datetime.timedelta'>`."""
 *     return datetime.timedelta_new(td.day, td.second, td.microsecond)
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_td_fr_td(PyDateTime_Delta *__pyx_v_td) {
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td_fr_td", 1);

  /* "cytimes/utils.pxd":2273
 * cdef inline datetime.timedelta td_fr_td(datetime.timedelta td):
 *     """Create timedelta from another timedelta (include subclass) `<'datetime.timedelta'>`."""
 *     return datetime.timedelta_new(td.day, td.second, td.microsecond)             # <<<<<<<<<<<<<<
 * 
 * # datetime.tzinfo --------------------------------------------------------------------------------------
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td), __pyx_f_7cpython_8datetime_9timedelta_6second_second(__pyx_v_td), __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(__pyx_v_td))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2271
 *     return td_fr_us(<long long> int(val * US_SECOND))
 * 
 * cdef inline datetime.timedelta td_fr_td(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Create timedelta from another timedelta (include subclass) `<'datetime.timedelta'>`."""
 *     return datetime.timedelta_new(td.day, td.second, td.microsecond)
 */

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

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

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tz_new(struct __pyx_opt_args_7cytimes_5utils_tz_new *__pyx_optional_args) {
  int __pyx_v_hours = ((int)0);
  int __pyx_v_minites = ((int)0);
  int __pyx_v_seconds = ((int)0);
  PY_LONG_LONG __pyx_v_offset;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_timezone_new __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_new", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_hours = __pyx_optional_args->hours;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_minites = __pyx_optional_args->minites;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_seconds = __pyx_optional_args->seconds;
        }
      }
    }
  }

  /* "cytimes/utils.pxd":2283
 *     >>> datetime.timezone(datetime.timedelta(hours=hours, minutes=minites))
 *     """
 *     cdef long long offset = hours * 3_600 + minites * 60 + seconds             # <<<<<<<<<<<<<<
 *     if not -86_340 <= offset <= 86_340:
 *         raise ValueError(
 */
  __pyx_v_offset = (((__pyx_v_hours * 0xE10) + (__pyx_v_minites * 60)) + __pyx_v_seconds);

  /* "cytimes/utils.pxd":2284
 *     """
 *     cdef long long offset = hours * 3_600 + minites * 60 + seconds
 *     if not -86_340 <= offset <= 86_340:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "timezone offset '%s' (seconds) out of range, "
 */
  __pyx_t_1 = (-86340LL <= __pyx_v_offset);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_offset <= 0x15144);
  }
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "cytimes/utils.pxd":2287
 *         raise ValueError(
 *             "timezone offset '%s' (seconds) out of range, "
 *             "must between -86340 and 86340." % offset             # <<<<<<<<<<<<<<
 *         )
 *     return datetime.timezone_new(datetime.timedelta_new(0, offset, 0), None)
 */
    __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_timezone_offset_s_seconds_out_of, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cytimes/utils.pxd":2285
 *     cdef long long offset = hours * 3_600 + minites * 60 + seconds
 *     if not -86_340 <= offset <= 86_340:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "timezone offset '%s' (seconds) out of range, "
 *             "must between -86340 and 86340." % offset
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2285, __pyx_L1_error)

    /* "cytimes/utils.pxd":2284
 *     """
 *     cdef long long offset = hours * 3_600 + minites * 60 + seconds
 *     if not -86_340 <= offset <= 86_340:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "timezone offset '%s' (seconds) out of range, "
 */
  }

  /* "cytimes/utils.pxd":2289
 *             "must between -86340 and 86340." % offset
 *         )
 *     return datetime.timezone_new(datetime.timedelta_new(0, offset, 0), None)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object tz_local(datetime.datetime dt=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(0, __pyx_v_offset, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.name = Py_None;
  __pyx_t_4 = __pyx_f_7cpython_8datetime_timezone_new(__pyx_t_3, &__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

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

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

/* "cytimes/utils.pxd":2291
 *     return datetime.timezone_new(datetime.timedelta_new(0, offset, 0), None)
 * 
 * cdef inline object tz_local(datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Get the local timezone `<'datetime.timezone'>`."""
 *     return _LOCAL_TZ
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tz_local(struct __pyx_opt_args_7cytimes_5utils_tz_local *__pyx_optional_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tz_local", 1);
  if (__pyx_optional_args) {
  }

  /* "cytimes/utils.pxd":2293
 * cdef inline object tz_local(datetime.datetime dt=None):
 *     """Get the local timezone `<'datetime.timezone'>`."""
 *     return _LOCAL_TZ             # <<<<<<<<<<<<<<
 * 
 * cdef inline int tz_local_seconds(datetime.datetime dt=None) except -200_000:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_7cytimes_5utils__LOCAL_TZ);
  __pyx_r = __pyx_v_7cytimes_5utils__LOCAL_TZ;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2291
 *     return datetime.timezone_new(datetime.timedelta_new(0, offset, 0), None)
 * 
 * cdef inline object tz_local(datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Get the local timezone `<'datetime.timezone'>`."""
 *     return _LOCAL_TZ
 */

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

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

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_tz_local_seconds(struct __pyx_opt_args_7cytimes_5utils_tz_local_seconds *__pyx_optional_args) {
  PyDateTime_DateTime *__pyx_v_dt = ((PyDateTime_DateTime *)Py_None);
  double __pyx_v_ts;
  PY_LONG_LONG __pyx_v_ts1;
  PY_LONG_LONG __pyx_v_ts2;
  struct tm __pyx_v_loc;
  struct tm __pyx_v_gmt;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PY_LONG_LONG __pyx_t_3;
  int __pyx_t_4;
  double __pyx_t_5;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_seconds __pyx_t_6;
  struct tm __pyx_t_7;
  struct tm __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_local_seconds", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_dt = __pyx_optional_args->dt;
    }
  }

  /* "cytimes/utils.pxd":2302
 *         long long ts1, ts2
 * 
 *     if dt is not None:             # <<<<<<<<<<<<<<
 *         if dt.tzinfo is None:
 *             ts1 = dt_to_posix(dt)
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_dt) != Py_None);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2303
 * 
 *     if dt is not None:
 *         if dt.tzinfo is None:             # <<<<<<<<<<<<<<
 *             ts1 = dt_to_posix(dt)
 *             # . detect gap
 */
    __pyx_t_2 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = (__pyx_t_2 == Py_None);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":2304
 *     if dt is not None:
 *         if dt.tzinfo is None:
 *             ts1 = dt_to_posix(dt)             # <<<<<<<<<<<<<<
 *             # . detect gap
 *             ts2 = dt_to_posix(dt_replace_fold(dt, 1-dt.fold))
 */
      __pyx_t_3 = __pyx_f_7cytimes_5utils_dt_to_posix(__pyx_v_dt); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2304, __pyx_L1_error)
      __pyx_v_ts1 = __pyx_t_3;

      /* "cytimes/utils.pxd":2306
 *             ts1 = dt_to_posix(dt)
 *             # . detect gap
 *             ts2 = dt_to_posix(dt_replace_fold(dt, 1-dt.fold))             # <<<<<<<<<<<<<<
 *             if ts2 != ts1 and (ts2 > ts1) == dt.fold:
 *                 ts = ts2
 */
      __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_replace_fold(__pyx_v_dt, (1 - __pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __pyx_f_7cytimes_5utils_dt_to_posix(((PyDateTime_DateTime *)__pyx_t_2)); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 2306, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ts2 = __pyx_t_3;

      /* "cytimes/utils.pxd":2307
 *             # . detect gap
 *             ts2 = dt_to_posix(dt_replace_fold(dt, 1-dt.fold))
 *             if ts2 != ts1 and (ts2 > ts1) == dt.fold:             # <<<<<<<<<<<<<<
 *                 ts = ts2
 *             else:
 */
      __pyx_t_4 = (__pyx_v_ts2 != __pyx_v_ts1);
      if (__pyx_t_4) {
      } else {
        __pyx_t_1 = __pyx_t_4;
        goto __pyx_L6_bool_binop_done;
      }
      __pyx_t_4 = ((__pyx_v_ts2 > __pyx_v_ts1) == __pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt));
      __pyx_t_1 = __pyx_t_4;
      __pyx_L6_bool_binop_done:;
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":2308
 *             ts2 = dt_to_posix(dt_replace_fold(dt, 1-dt.fold))
 *             if ts2 != ts1 and (ts2 > ts1) == dt.fold:
 *                 ts = ts2             # <<<<<<<<<<<<<<
 *             else:
 *                 ts = ts1
 */
        __pyx_v_ts = __pyx_v_ts2;

        /* "cytimes/utils.pxd":2307
 *             # . detect gap
 *             ts2 = dt_to_posix(dt_replace_fold(dt, 1-dt.fold))
 *             if ts2 != ts1 and (ts2 > ts1) == dt.fold:             # <<<<<<<<<<<<<<
 *                 ts = ts2
 *             else:
 */
        goto __pyx_L5;
      }

      /* "cytimes/utils.pxd":2310
 *                 ts = ts2
 *             else:
 *                 ts = ts1             # <<<<<<<<<<<<<<
 *         else:
 *             ts = dt_to_seconds(dt, True)
 */
      /*else*/ {
        __pyx_v_ts = __pyx_v_ts1;
      }
      __pyx_L5:;

      /* "cytimes/utils.pxd":2303
 * 
 *     if dt is not None:
 *         if dt.tzinfo is None:             # <<<<<<<<<<<<<<
 *             ts1 = dt_to_posix(dt)
 *             # . detect gap
 */
      goto __pyx_L4;
    }

    /* "cytimes/utils.pxd":2312
 *                 ts = ts1
 *         else:
 *             ts = dt_to_seconds(dt, True)             # <<<<<<<<<<<<<<
 *     else:
 *         ts = unix_time()
 */
    /*else*/ {
      __pyx_t_6.__pyx_n = 1;
      __pyx_t_6.utc = 1;
      __pyx_t_5 = __pyx_f_7cytimes_5utils_dt_to_seconds(__pyx_v_dt, &__pyx_t_6); if (unlikely(__pyx_t_5 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2312, __pyx_L1_error)
      __pyx_v_ts = __pyx_t_5;
    }
    __pyx_L4:;

    /* "cytimes/utils.pxd":2302
 *         long long ts1, ts2
 * 
 *     if dt is not None:             # <<<<<<<<<<<<<<
 *         if dt.tzinfo is None:
 *             ts1 = dt_to_posix(dt)
 */
    goto __pyx_L3;
  }

  /* "cytimes/utils.pxd":2314
 *             ts = dt_to_seconds(dt, True)
 *     else:
 *         ts = unix_time()             # <<<<<<<<<<<<<<
 * 
 *     # Compute offset
 */
  /*else*/ {
    __pyx_v_ts = __pyx_f_7cpython_4time_time();
  }
  __pyx_L3:;

  /* "cytimes/utils.pxd":2317
 * 
 *     # Compute offset
 *     loc, gmt = tm_localtime(ts), tm_gmtime(ts)             # <<<<<<<<<<<<<<
 *     return (
 *         (loc.tm_mday - gmt.tm_mday) * SS_DAY
 */
  __pyx_t_7 = __pyx_f_7cytimes_5utils_tm_localtime(__pyx_v_ts); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2317, __pyx_L1_error)
  __pyx_t_8 = __pyx_f_7cytimes_5utils_tm_gmtime(__pyx_v_ts); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2317, __pyx_L1_error)
  __pyx_v_loc = __pyx_t_7;
  __pyx_v_gmt = __pyx_t_8;

  /* "cytimes/utils.pxd":2322
 *         + (loc.tm_hour - gmt.tm_hour) * SS_HOUR
 *         + (loc.tm_min - gmt.tm_min) * SS_MINUTE
 *         + (loc.tm_sec - gmt.tm_sec)             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_r = (((((__pyx_v_loc.tm_mday - __pyx_v_gmt.tm_mday) * __pyx_v_7cytimes_5utils_SS_DAY) + ((__pyx_v_loc.tm_hour - __pyx_v_gmt.tm_hour) * __pyx_v_7cytimes_5utils_SS_HOUR)) + ((__pyx_v_loc.tm_min - __pyx_v_gmt.tm_min) * __pyx_v_7cytimes_5utils_SS_MINUTE)) + (__pyx_v_loc.tm_sec - __pyx_v_gmt.tm_sec));
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.tz_local_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -200000;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":2328
 * 
 * # . type check
 * cdef inline bint is_tz(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.tzinfo `<'bool'>`.
 * 
 */

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

  /* "cytimes/utils.pxd":2334
 *     >>> isinstance(obj, datetime.tzinfo)
 *     """
 *     return datetime.PyTZInfo_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_tz_exact(object obj) except -1:
 */
  __pyx_r = PyTZInfo_Check(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2328
 * 
 * # . type check
 * cdef inline bint is_tz(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.tzinfo `<'bool'>`.
 * 
 */

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

/* "cytimes/utils.pxd":2336
 *     return datetime.PyTZInfo_Check(obj)
 * 
 * cdef inline bint is_tz_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.tzinfo type `<'bool'>`.
 * 
 */

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

  /* "cytimes/utils.pxd":2342
 *     >>> type(obj) is datetime.date
 *     """
 *     return datetime.PyTZInfo_CheckExact(obj)             # <<<<<<<<<<<<<<
 * 
 * # . access
 */
  __pyx_r = PyTZInfo_CheckExact(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2336
 *     return datetime.PyTZInfo_Check(obj)
 * 
 * cdef inline bint is_tz_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.tzinfo type `<'bool'>`.
 * 
 */

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

/* "cytimes/utils.pxd":2345
 * 
 * # . access
 * cdef inline str tz_name(object tz, datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Access the name of the tzinfo `<'str/None'>`.
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tz_name(PyObject *__pyx_v_tz, struct __pyx_opt_args_7cytimes_5utils_tz_name *__pyx_optional_args) {
  PyDateTime_DateTime *__pyx_v_dt = ((PyDateTime_DateTime *)Py_None);
  PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_name", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_dt = __pyx_optional_args->dt;
    }
  }

  /* "cytimes/utils.pxd":2351
 *     >>> tz.tzname(dt)
 *     """
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  __pyx_t_1 = (__pyx_v_tz == Py_None);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2352
 *     """
 *     if tz is None:
 *         return None             # <<<<<<<<<<<<<<
 *     try:
 *         return tz.tzname(dt)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2351
 *     >>> tz.tzname(dt)
 *     """
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  }

  /* "cytimes/utils.pxd":2353
 *     if tz is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return tz.tzname(dt)
 *     except Exception as err:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "cytimes/utils.pxd":2354
 *         return None
 *     try:
 *         return tz.tzname(dt)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         if not is_tz(tz):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_tzname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2354, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_dt)};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2354, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 2354, __pyx_L4_error)
      __pyx_r = ((PyObject*)__pyx_t_5);
      __pyx_t_5 = 0;
      goto __pyx_L8_try_return;

      /* "cytimes/utils.pxd":2353
 *     if tz is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return tz.tzname(dt)
 *     except Exception as err:
 */
    }
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cytimes/utils.pxd":2355
 *     try:
 *         return tz.tzname(dt)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_9) {
      __Pyx_AddTraceback("cytimes.utils.tz_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 2355, __pyx_L6_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/utils.pxd":2356
 *         return tz.tzname(dt)
 *     except Exception as err:
 *         if not is_tz(tz):             # <<<<<<<<<<<<<<
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 *         raise err
 */
        __pyx_t_1 = __pyx_f_7cytimes_5utils_is_tz(__pyx_v_tz); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2356, __pyx_L15_error)
        __pyx_t_10 = (!__pyx_t_1);
        if (unlikely(__pyx_t_10)) {

          /* "cytimes/utils.pxd":2357
 *     except Exception as err:
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err             # <<<<<<<<<<<<<<
 *         raise err
 * 
 */
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_expects_datetime_tzinfo_got_s, ((PyObject *)Py_TYPE(__pyx_v_tz))); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2357, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2357, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_Raise(__pyx_t_12, 0, 0, __pyx_v_err);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __PYX_ERR(0, 2357, __pyx_L15_error)

          /* "cytimes/utils.pxd":2356
 *         return tz.tzname(dt)
 *     except Exception as err:
 *         if not is_tz(tz):             # <<<<<<<<<<<<<<
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 *         raise err
 */
        }

        /* "cytimes/utils.pxd":2358
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 *         raise err             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta tz_dst(object tz, datetime.datetime dt=None):
 */
        __Pyx_Raise(__pyx_v_err, 0, 0, 0);
        __PYX_ERR(0, 2358, __pyx_L15_error)
      }

      /* "cytimes/utils.pxd":2355
 *     try:
 *         return tz.tzname(dt)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 */
      /*finally:*/ {
        __pyx_L15_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_9 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L6_except_error;
        }
      }
    }
    goto __pyx_L6_except_error;

    /* "cytimes/utils.pxd":2353
 *     if tz is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return tz.tzname(dt)
 *     except Exception as err:
 */
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L8_try_return:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L0;
  }

  /* "cytimes/utils.pxd":2345
 * 
 * # . access
 * cdef inline str tz_name(object tz, datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Access the name of the tzinfo `<'str/None'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cytimes.utils.tz_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":2360
 *         raise err
 * 
 * cdef inline datetime.timedelta tz_dst(object tz, datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Access the 'dst' of the tzinfo `<'datetime.timedelta'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_tz_dst(PyObject *__pyx_v_tz, struct __pyx_opt_args_7cytimes_5utils_tz_dst *__pyx_optional_args) {
  PyDateTime_DateTime *__pyx_v_dt = ((PyDateTime_DateTime *)Py_None);
  PyObject *__pyx_v_err = NULL;
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_dst", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_dt = __pyx_optional_args->dt;
    }
  }

  /* "cytimes/utils.pxd":2366
 *     >>> tz.dst(dt)
 *     """
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  __pyx_t_1 = (__pyx_v_tz == Py_None);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2367
 *     """
 *     if tz is None:
 *         return None             # <<<<<<<<<<<<<<
 *     try:
 *         return tz.dst(dt)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_r = ((PyDateTime_Delta *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2366
 *     >>> tz.dst(dt)
 *     """
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  }

  /* "cytimes/utils.pxd":2368
 *     if tz is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return tz.dst(dt)
 *     except Exception as err:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "cytimes/utils.pxd":2369
 *         return None
 *     try:
 *         return tz.dst(dt)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         if not is_tz(tz):
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_dst); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2369, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_dt)};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2369, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(0, 2369, __pyx_L4_error)
      __pyx_r = ((PyDateTime_Delta *)__pyx_t_5);
      __pyx_t_5 = 0;
      goto __pyx_L8_try_return;

      /* "cytimes/utils.pxd":2368
 *     if tz is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return tz.dst(dt)
 *     except Exception as err:
 */
    }
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cytimes/utils.pxd":2370
 *     try:
 *         return tz.dst(dt)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_9) {
      __Pyx_AddTraceback("cytimes.utils.tz_dst", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 2370, __pyx_L6_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/utils.pxd":2371
 *         return tz.dst(dt)
 *     except Exception as err:
 *         if not is_tz(tz):             # <<<<<<<<<<<<<<
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 *         raise err
 */
        __pyx_t_1 = __pyx_f_7cytimes_5utils_is_tz(__pyx_v_tz); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2371, __pyx_L15_error)
        __pyx_t_10 = (!__pyx_t_1);
        if (unlikely(__pyx_t_10)) {

          /* "cytimes/utils.pxd":2372
 *     except Exception as err:
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err             # <<<<<<<<<<<<<<
 *         raise err
 * 
 */
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_expects_datetime_tzinfo_got_s, ((PyObject *)Py_TYPE(__pyx_v_tz))); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2372, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2372, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_Raise(__pyx_t_12, 0, 0, __pyx_v_err);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __PYX_ERR(0, 2372, __pyx_L15_error)

          /* "cytimes/utils.pxd":2371
 *         return tz.dst(dt)
 *     except Exception as err:
 *         if not is_tz(tz):             # <<<<<<<<<<<<<<
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 *         raise err
 */
        }

        /* "cytimes/utils.pxd":2373
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 *         raise err             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta tz_utcoffset(object tz, datetime.datetime dt=None):
 */
        __Pyx_Raise(__pyx_v_err, 0, 0, 0);
        __PYX_ERR(0, 2373, __pyx_L15_error)
      }

      /* "cytimes/utils.pxd":2370
 *     try:
 *         return tz.dst(dt)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 */
      /*finally:*/ {
        __pyx_L15_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_9 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L6_except_error;
        }
      }
    }
    goto __pyx_L6_except_error;

    /* "cytimes/utils.pxd":2368
 *     if tz is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return tz.dst(dt)
 *     except Exception as err:
 */
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L8_try_return:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L0;
  }

  /* "cytimes/utils.pxd":2360
 *         raise err
 * 
 * cdef inline datetime.timedelta tz_dst(object tz, datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Access the 'dst' of the tzinfo `<'datetime.timedelta'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cytimes.utils.tz_dst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":2375
 *         raise err
 * 
 * cdef inline datetime.timedelta tz_utcoffset(object tz, datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Access the 'utcoffset' of the tzinfo `<'datetime.timedelta'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_tz_utcoffset(PyObject *__pyx_v_tz, struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset *__pyx_optional_args) {
  PyDateTime_DateTime *__pyx_v_dt = ((PyDateTime_DateTime *)Py_None);
  PyObject *__pyx_v_err = NULL;
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_utcoffset", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_dt = __pyx_optional_args->dt;
    }
  }

  /* "cytimes/utils.pxd":2381
 *     >>> tz.utcoffset(dt)
 *     """
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  __pyx_t_1 = (__pyx_v_tz == Py_None);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2382
 *     """
 *     if tz is None:
 *         return None             # <<<<<<<<<<<<<<
 *     try:
 *         return tz.utcoffset(dt)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_r = ((PyDateTime_Delta *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2381
 *     >>> tz.utcoffset(dt)
 *     """
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  }

  /* "cytimes/utils.pxd":2383
 *     if tz is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return tz.utcoffset(dt)
 *     except Exception as err:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "cytimes/utils.pxd":2384
 *         return None
 *     try:
 *         return tz.utcoffset(dt)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         if not is_tz(tz):
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2384, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_dt)};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2384, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(0, 2384, __pyx_L4_error)
      __pyx_r = ((PyDateTime_Delta *)__pyx_t_5);
      __pyx_t_5 = 0;
      goto __pyx_L8_try_return;

      /* "cytimes/utils.pxd":2383
 *     if tz is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return tz.utcoffset(dt)
 *     except Exception as err:
 */
    }
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cytimes/utils.pxd":2385
 *     try:
 *         return tz.utcoffset(dt)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_9) {
      __Pyx_AddTraceback("cytimes.utils.tz_utcoffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 2385, __pyx_L6_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/utils.pxd":2386
 *         return tz.utcoffset(dt)
 *     except Exception as err:
 *         if not is_tz(tz):             # <<<<<<<<<<<<<<
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 *         raise err
 */
        __pyx_t_1 = __pyx_f_7cytimes_5utils_is_tz(__pyx_v_tz); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2386, __pyx_L15_error)
        __pyx_t_10 = (!__pyx_t_1);
        if (unlikely(__pyx_t_10)) {

          /* "cytimes/utils.pxd":2387
 *     except Exception as err:
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err             # <<<<<<<<<<<<<<
 *         raise err
 * 
 */
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_expects_datetime_tzinfo_got_s, ((PyObject *)Py_TYPE(__pyx_v_tz))); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2387, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2387, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_Raise(__pyx_t_12, 0, 0, __pyx_v_err);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __PYX_ERR(0, 2387, __pyx_L15_error)

          /* "cytimes/utils.pxd":2386
 *         return tz.utcoffset(dt)
 *     except Exception as err:
 *         if not is_tz(tz):             # <<<<<<<<<<<<<<
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 *         raise err
 */
        }

        /* "cytimes/utils.pxd":2388
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 *         raise err             # <<<<<<<<<<<<<<
 * 
 * cdef inline int tz_utcoffset_seconds(object tz, datetime.datetime dt=None) except -200_000:
 */
        __Pyx_Raise(__pyx_v_err, 0, 0, 0);
        __PYX_ERR(0, 2388, __pyx_L15_error)
      }

      /* "cytimes/utils.pxd":2385
 *     try:
 *         return tz.utcoffset(dt)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 */
      /*finally:*/ {
        __pyx_L15_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_9 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L6_except_error;
        }
      }
    }
    goto __pyx_L6_except_error;

    /* "cytimes/utils.pxd":2383
 *     if tz is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return tz.utcoffset(dt)
 *     except Exception as err:
 */
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L8_try_return:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L0;
  }

  /* "cytimes/utils.pxd":2375
 *         raise err
 * 
 * cdef inline datetime.timedelta tz_utcoffset(object tz, datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Access the 'utcoffset' of the tzinfo `<'datetime.timedelta'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cytimes.utils.tz_utcoffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_tz_utcoffset_seconds(PyObject *__pyx_v_tz, struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset_seconds *__pyx_optional_args) {
  PyDateTime_DateTime *__pyx_v_dt = ((PyDateTime_DateTime *)Py_None);
  PyDateTime_Delta *__pyx_v_offset = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_utcoffset_seconds", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_dt = __pyx_optional_args->dt;
    }
  }

  /* "cytimes/utils.pxd":2398
 *     >>> tz.utcoffset(dt).total_seconds()
 *     """
 *     offset = tz_utcoffset(tz, dt)             # <<<<<<<<<<<<<<
 *     if offset is None:
 *         return -100_000
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.dt = __pyx_v_dt;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_v_tz, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_offset = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":2399
 *     """
 *     offset = tz_utcoffset(tz, dt)
 *     if offset is None:             # <<<<<<<<<<<<<<
 *         return -100_000
 *     return datetime.timedelta_days(offset) * SS_DAY + datetime.timedelta_seconds(offset)
 */
  __pyx_t_3 = (((PyObject *)__pyx_v_offset) == Py_None);
  if (__pyx_t_3) {

    /* "cytimes/utils.pxd":2400
 *     offset = tz_utcoffset(tz, dt)
 *     if offset is None:
 *         return -100_000             # <<<<<<<<<<<<<<
 *     return datetime.timedelta_days(offset) * SS_DAY + datetime.timedelta_seconds(offset)
 * 
 */
    __pyx_r = -100000;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2399
 *     """
 *     offset = tz_utcoffset(tz, dt)
 *     if offset is None:             # <<<<<<<<<<<<<<
 *         return -100_000
 *     return datetime.timedelta_days(offset) * SS_DAY + datetime.timedelta_seconds(offset)
 */
  }

  /* "cytimes/utils.pxd":2401
 *     if offset is None:
 *         return -100_000
 *     return datetime.timedelta_days(offset) * SS_DAY + datetime.timedelta_seconds(offset)             # <<<<<<<<<<<<<<
 * 
 * cdef inline str tz_utcformat(object tz, datetime.datetime dt=None):
 */
  __pyx_r = ((__pyx_f_7cpython_8datetime_timedelta_days(((PyObject *)__pyx_v_offset)) * __pyx_v_7cytimes_5utils_SS_DAY) + __pyx_f_7cpython_8datetime_timedelta_seconds(((PyObject *)__pyx_v_offset)));
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.tz_utcoffset_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -200000;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_offset);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tz_utcformat(PyObject *__pyx_v_tz, struct __pyx_opt_args_7cytimes_5utils_tz_utcformat *__pyx_optional_args) {
  PyDateTime_DateTime *__pyx_v_dt = ((PyDateTime_DateTime *)Py_None);
  PyDateTime_Delta *__pyx_v_utc_off = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_utcformat", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_dt = __pyx_optional_args->dt;
    }
  }

  /* "cytimes/utils.pxd":2405
 * cdef inline str tz_utcformat(object tz, datetime.datetime dt=None):
 *     """Access tzinfo as string in UTC format ('+/-HH:MM') `<'str/None'>`."""
 *     utc_off = tz_utcoffset(tz, dt)             # <<<<<<<<<<<<<<
 *     if utc_off is None:
 *         return None
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.dt = __pyx_v_dt;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_v_tz, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_utc_off = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":2406
 *     """Access tzinfo as string in UTC format ('+/-HH:MM') `<'str/None'>`."""
 *     utc_off = tz_utcoffset(tz, dt)
 *     if utc_off is None:             # <<<<<<<<<<<<<<
 *         return None
 *     return td_to_utcformat(utc_off)
 */
  __pyx_t_3 = (((PyObject *)__pyx_v_utc_off) == Py_None);
  if (__pyx_t_3) {

    /* "cytimes/utils.pxd":2407
 *     utc_off = tz_utcoffset(tz, dt)
 *     if utc_off is None:
 *         return None             # <<<<<<<<<<<<<<
 *     return td_to_utcformat(utc_off)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2406
 *     """Access tzinfo as string in UTC format ('+/-HH:MM') `<'str/None'>`."""
 *     utc_off = tz_utcoffset(tz, dt)
 *     if utc_off is None:             # <<<<<<<<<<<<<<
 *         return None
 *     return td_to_utcformat(utc_off)
 */
  }

  /* "cytimes/utils.pxd":2408
 *     if utc_off is None:
 *         return None
 *     return td_to_utcformat(utc_off)             # <<<<<<<<<<<<<<
 * 
 * # NumPy: share -----------------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytimes_5utils_td_to_utcformat(__pyx_v_utc_off); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

/* "cytimes/utils.pxd":2412
 * # NumPy: share -----------------------------------------------------------------------------------------
 * # . time unit
 * cdef inline str map_nptime_unit_int2str(int unit):             # <<<<<<<<<<<<<<
 *     """Map numpy datetime64/timedelta64 unit from integer
 *     to the corresponding string representation `<'str'>`."""
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_map_nptime_unit_int2str(int __pyx_v_unit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map_nptime_unit_int2str", 1);

  /* "cytimes/utils.pxd":2416
 *     to the corresponding string representation `<'str'>`."""
 *     # Common units
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         return "ns"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2417
 *     # Common units
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         return "ns"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         return "us"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_ns);
    __pyx_r = __pyx_n_u_ns;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2416
 *     to the corresponding string representation `<'str'>`."""
 *     # Common units
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         return "ns"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
  }

  /* "cytimes/utils.pxd":2418
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         return "ns"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         return "us"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2419
 *         return "ns"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         return "us"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         return "ms"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_us);
    __pyx_r = __pyx_n_u_us;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2418
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         return "ns"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         return "us"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
  }

  /* "cytimes/utils.pxd":2420
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         return "us"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *         return "ms"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2421
 *         return "us"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         return "ms"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         return "s"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_ms);
    __pyx_r = __pyx_n_u_ms;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2420
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         return "us"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *         return "ms"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
  }

  /* "cytimes/utils.pxd":2422
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         return "ms"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *         return "s"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2423
 *         return "ms"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         return "s"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         return "m"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_s);
    __pyx_r = __pyx_n_u_s;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2422
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         return "ms"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *         return "s"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 */
  }

  /* "cytimes/utils.pxd":2424
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         return "s"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *         return "m"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2425
 *         return "s"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         return "m"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         return "h"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_m);
    __pyx_r = __pyx_n_u_m;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2424
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         return "s"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *         return "m"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 */
  }

  /* "cytimes/utils.pxd":2426
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         return "m"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *         return "h"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2427
 *         return "m"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         return "h"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         return "D"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_h);
    __pyx_r = __pyx_n_u_h;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2426
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         return "m"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *         return "h"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 */
  }

  /* "cytimes/utils.pxd":2428
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         return "h"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:             # <<<<<<<<<<<<<<
 *         return "D"
 * 
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2429
 *         return "h"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         return "D"             # <<<<<<<<<<<<<<
 * 
 *     # Uncommon units
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_D);
    __pyx_r = __pyx_n_u_D;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2428
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         return "h"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:             # <<<<<<<<<<<<<<
 *         return "D"
 * 
 */
  }

  /* "cytimes/utils.pxd":2432
 * 
 *     # Uncommon units
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         return "Y"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2433
 *     # Uncommon units
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         return "Y"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         return "M"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_Y);
    __pyx_r = __pyx_n_u_Y;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2432
 * 
 *     # Uncommon units
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         return "Y"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 */
  }

  /* "cytimes/utils.pxd":2434
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         return "Y"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:             # <<<<<<<<<<<<<<
 *         return "M"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2435
 *         return "Y"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         return "M"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:
 *         return "W"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_M);
    __pyx_r = __pyx_n_u_M;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2434
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         return "Y"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:             # <<<<<<<<<<<<<<
 *         return "M"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:
 */
  }

  /* "cytimes/utils.pxd":2436
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         return "M"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:             # <<<<<<<<<<<<<<
 *         return "W"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2437
 *         return "M"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:
 *         return "W"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:
 *         return "ps"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_W);
    __pyx_r = __pyx_n_u_W;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2436
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         return "M"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:             # <<<<<<<<<<<<<<
 *         return "W"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:
 */
  }

  /* "cytimes/utils.pxd":2438
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:
 *         return "W"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:             # <<<<<<<<<<<<<<
 *         return "ps"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2439
 *         return "W"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:
 *         return "ps"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:
 *         return "fs"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_ps);
    __pyx_r = __pyx_n_u_ps;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2438
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:
 *         return "W"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:             # <<<<<<<<<<<<<<
 *         return "ps"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:
 */
  }

  /* "cytimes/utils.pxd":2440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:
 *         return "ps"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:             # <<<<<<<<<<<<<<
 *         return "fs"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2441
 *         return "ps"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:
 *         return "fs"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:
 *         return "as"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_fs);
    __pyx_r = __pyx_n_u_fs;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:
 *         return "ps"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:             # <<<<<<<<<<<<<<
 *         return "fs"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:
 */
  }

  /* "cytimes/utils.pxd":2442
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:
 *         return "fs"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:             # <<<<<<<<<<<<<<
 *         return "as"
 *     # if unit == np.NPY_DATETIMEUNIT.NPY_FR_B:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2443
 *         return "fs"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:
 *         return "as"             # <<<<<<<<<<<<<<
 *     # if unit == np.NPY_DATETIMEUNIT.NPY_FR_B:
 *     #     return "B"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_as);
    __pyx_r = __pyx_n_u_as;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2442
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:
 *         return "fs"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:             # <<<<<<<<<<<<<<
 *         return "as"
 *     # if unit == np.NPY_DATETIMEUNIT.NPY_FR_B:
 */
  }

  /* "cytimes/utils.pxd":2448
 * 
 *     # Unsupported unit
 *     raise ValueError("unknown datetime unit '%d'." % unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int map_nptime_unit_str2int(str unit) except -1:
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_datetime_unit_d, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(0, 2448, __pyx_L1_error)

  /* "cytimes/utils.pxd":2412
 * # NumPy: share -----------------------------------------------------------------------------------------
 * # . time unit
 * cdef inline str map_nptime_unit_int2str(int unit):             # <<<<<<<<<<<<<<
 *     """Map numpy datetime64/timedelta64 unit from integer
 *     to the corresponding string representation `<'str'>`."""
 */

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

/* "cytimes/utils.pxd":2450
 *     raise ValueError("unknown datetime unit '%d'." % unit)
 * 
 * cdef inline int map_nptime_unit_str2int(str unit) except -1:             # <<<<<<<<<<<<<<
 *     """Map numpy datetime64/timedelta64 unit from string
 *     representation to the corresponding integer `<'int'>`."""
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(PyObject *__pyx_v_unit) {
  Py_ssize_t __pyx_v_size;
  Py_UCS4 __pyx_v_ch;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_UCS4 __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map_nptime_unit_str2int", 1);

  /* "cytimes/utils.pxd":2454
 *     representation to the corresponding integer `<'int'>`."""
 *     cdef:
 *         Py_ssize_t size = str_len(unit)             # <<<<<<<<<<<<<<
 *         Py_UCS4 ch
 * 
 */
  __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_unit);

  /* "cytimes/utils.pxd":2458
 * 
 *     # Unit: 's', 'm', 'h', 'D', 'Y', 'M', 'W', 'B'
 *     if size == 1:             # <<<<<<<<<<<<<<
 *         # Common units
 *         ch = str_read(unit, 0)
 */
  __pyx_t_1 = (__pyx_v_size == 1);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2460
 *     if size == 1:
 *         # Common units
 *         ch = str_read(unit, 0)             # <<<<<<<<<<<<<<
 *         if ch == "s":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_s
 */
    __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_unit, 0); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(0, 2460, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_2;

    /* "cytimes/utils.pxd":2461
 *         # Common units
 *         ch = str_read(unit, 0)
 *         if ch == "s":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_s
 *         if ch == "m":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x73);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":2462
 *         ch = str_read(unit, 0)
 *         if ch == "s":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_s             # <<<<<<<<<<<<<<
 *         if ch == "m":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_m
 */
      __pyx_r = NPY_FR_s;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2461
 *         # Common units
 *         ch = str_read(unit, 0)
 *         if ch == "s":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_s
 *         if ch == "m":
 */
    }

    /* "cytimes/utils.pxd":2463
 *         if ch == "s":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_s
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_m
 *         if ch == "h":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x6D);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":2464
 *             return np.NPY_DATETIMEUNIT.NPY_FR_s
 *         if ch == "m":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_m             # <<<<<<<<<<<<<<
 *         if ch == "h":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_h
 */
      __pyx_r = NPY_FR_m;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2463
 *         if ch == "s":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_s
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_m
 *         if ch == "h":
 */
    }

    /* "cytimes/utils.pxd":2465
 *         if ch == "m":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_m
 *         if ch == "h":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_h
 *         if ch == "D":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x68);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":2466
 *             return np.NPY_DATETIMEUNIT.NPY_FR_m
 *         if ch == "h":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_h             # <<<<<<<<<<<<<<
 *         if ch == "D":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_D
 */
      __pyx_r = NPY_FR_h;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2465
 *         if ch == "m":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_m
 *         if ch == "h":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_h
 *         if ch == "D":
 */
    }

    /* "cytimes/utils.pxd":2467
 *         if ch == "h":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_h
 *         if ch == "D":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_D
 *         # Uncommon units
 */
    __pyx_t_1 = (__pyx_v_ch == 68);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":2468
 *             return np.NPY_DATETIMEUNIT.NPY_FR_h
 *         if ch == "D":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_D             # <<<<<<<<<<<<<<
 *         # Uncommon units
 *         if ch == "Y":
 */
      __pyx_r = NPY_FR_D;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2467
 *         if ch == "h":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_h
 *         if ch == "D":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_D
 *         # Uncommon units
 */
    }

    /* "cytimes/utils.pxd":2470
 *             return np.NPY_DATETIMEUNIT.NPY_FR_D
 *         # Uncommon units
 *         if ch == "Y":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_Y
 *         if ch == "M":
 */
    __pyx_t_1 = (__pyx_v_ch == 89);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":2471
 *         # Uncommon units
 *         if ch == "Y":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_Y             # <<<<<<<<<<<<<<
 *         if ch == "M":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_M
 */
      __pyx_r = NPY_FR_Y;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2470
 *             return np.NPY_DATETIMEUNIT.NPY_FR_D
 *         # Uncommon units
 *         if ch == "Y":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_Y
 *         if ch == "M":
 */
    }

    /* "cytimes/utils.pxd":2472
 *         if ch == "Y":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_Y
 *         if ch == "M":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_M
 *         if ch == "W":
 */
    __pyx_t_1 = (__pyx_v_ch == 77);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":2473
 *             return np.NPY_DATETIMEUNIT.NPY_FR_Y
 *         if ch == "M":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_M             # <<<<<<<<<<<<<<
 *         if ch == "W":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_W
 */
      __pyx_r = NPY_FR_M;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2472
 *         if ch == "Y":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_Y
 *         if ch == "M":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_M
 *         if ch == "W":
 */
    }

    /* "cytimes/utils.pxd":2474
 *         if ch == "M":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_M
 *         if ch == "W":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_W
 *         # if ch == "B":
 */
    __pyx_t_1 = (__pyx_v_ch == 87);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":2475
 *             return np.NPY_DATETIMEUNIT.NPY_FR_M
 *         if ch == "W":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_W             # <<<<<<<<<<<<<<
 *         # if ch == "B":
 *         #     return np.NPY_DATETIMEUNIT.NPY_FR_B
 */
      __pyx_r = NPY_FR_W;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2474
 *         if ch == "M":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_M
 *         if ch == "W":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_W
 *         # if ch == "B":
 */
    }

    /* "cytimes/utils.pxd":2458
 * 
 *     # Unit: 's', 'm', 'h', 'D', 'Y', 'M', 'W', 'B'
 *     if size == 1:             # <<<<<<<<<<<<<<
 *         # Common units
 *         ch = str_read(unit, 0)
 */
    goto __pyx_L3;
  }

  /* "cytimes/utils.pxd":2480
 * 
 *     # Unit: 'ns', 'us', 'ms', 'ps', 'fs', 'as'
 *     elif size == 2 and str_read(unit, 1) == "s":             # <<<<<<<<<<<<<<
 *         # Common units
 *         ch = str_read(unit, 0)
 */
  __pyx_t_3 = (__pyx_v_size == 2);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_unit, 1); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(0, 2480, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 == 0x73);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L11_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2482
 *     elif size == 2 and str_read(unit, 1) == "s":
 *         # Common units
 *         ch = str_read(unit, 0)             # <<<<<<<<<<<<<<
 *         if ch == "n":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ns
 */
    __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_unit, 0); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(0, 2482, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_2;

    /* "cytimes/utils.pxd":2483
 *         # Common units
 *         ch = str_read(unit, 0)
 *         if ch == "n":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ns
 *         if ch == "u":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x6E);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":2484
 *         ch = str_read(unit, 0)
 *         if ch == "n":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ns             # <<<<<<<<<<<<<<
 *         if ch == "u":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_us
 */
      __pyx_r = NPY_FR_ns;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2483
 *         # Common units
 *         ch = str_read(unit, 0)
 *         if ch == "n":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ns
 *         if ch == "u":
 */
    }

    /* "cytimes/utils.pxd":2485
 *         if ch == "n":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ns
 *         if ch == "u":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_us
 *         if ch == "m":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x75);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":2486
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ns
 *         if ch == "u":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_us             # <<<<<<<<<<<<<<
 *         if ch == "m":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ms
 */
      __pyx_r = NPY_FR_us;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2485
 *         if ch == "n":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ns
 *         if ch == "u":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_us
 *         if ch == "m":
 */
    }

    /* "cytimes/utils.pxd":2487
 *         if ch == "u":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_us
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ms
 *         # Uncommon units
 */
    __pyx_t_1 = (__pyx_v_ch == 0x6D);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":2488
 *             return np.NPY_DATETIMEUNIT.NPY_FR_us
 *         if ch == "m":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ms             # <<<<<<<<<<<<<<
 *         # Uncommon units
 *         if ch == "p":
 */
      __pyx_r = NPY_FR_ms;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2487
 *         if ch == "u":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_us
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ms
 *         # Uncommon units
 */
    }

    /* "cytimes/utils.pxd":2490
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ms
 *         # Uncommon units
 *         if ch == "p":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ps
 *         if ch == "f":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x70);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":2491
 *         # Uncommon units
 *         if ch == "p":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ps             # <<<<<<<<<<<<<<
 *         if ch == "f":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_fs
 */
      __pyx_r = NPY_FR_ps;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2490
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ms
 *         # Uncommon units
 *         if ch == "p":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ps
 *         if ch == "f":
 */
    }

    /* "cytimes/utils.pxd":2492
 *         if ch == "p":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ps
 *         if ch == "f":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_fs
 *         if ch == "a":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x66);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":2493
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ps
 *         if ch == "f":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_fs             # <<<<<<<<<<<<<<
 *         if ch == "a":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_as
 */
      __pyx_r = NPY_FR_fs;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2492
 *         if ch == "p":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ps
 *         if ch == "f":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_fs
 *         if ch == "a":
 */
    }

    /* "cytimes/utils.pxd":2494
 *         if ch == "f":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_fs
 *         if ch == "a":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_as
 * 
 */
    __pyx_t_1 = (__pyx_v_ch == 97);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":2495
 *             return np.NPY_DATETIMEUNIT.NPY_FR_fs
 *         if ch == "a":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_as             # <<<<<<<<<<<<<<
 * 
 *     # Unit: 'min' for pandas compatibility
 */
      __pyx_r = NPY_FR_as;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2494
 *         if ch == "f":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_fs
 *         if ch == "a":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_as
 * 
 */
    }

    /* "cytimes/utils.pxd":2480
 * 
 *     # Unit: 'ns', 'us', 'ms', 'ps', 'fs', 'as'
 *     elif size == 2 and str_read(unit, 1) == "s":             # <<<<<<<<<<<<<<
 *         # Common units
 *         ch = str_read(unit, 0)
 */
    goto __pyx_L3;
  }

  /* "cytimes/utils.pxd":2498
 * 
 *     # Unit: 'min' for pandas compatibility
 *     elif size == 3 and unit == "min":             # <<<<<<<<<<<<<<
 *         return np.NPY_DATETIMEUNIT.NPY_FR_m
 * 
 */
  __pyx_t_3 = (__pyx_v_size == 3);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_min, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2498, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2499
 *     # Unit: 'min' for pandas compatibility
 *     elif size == 3 and unit == "min":
 *         return np.NPY_DATETIMEUNIT.NPY_FR_m             # <<<<<<<<<<<<<<
 * 
 *     # Unsupported unit
 */
    __pyx_r = NPY_FR_m;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2498
 * 
 *     # Unit: 'min' for pandas compatibility
 *     elif size == 3 and unit == "min":             # <<<<<<<<<<<<<<
 *         return np.NPY_DATETIMEUNIT.NPY_FR_m
 * 
 */
  }
  __pyx_L3:;

  /* "cytimes/utils.pxd":2502
 * 
 *     # Unsupported unit
 *     raise ValueError("unknown datetime unit '%s'." % unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int get_arr_nptime_unit(np.ndarray arr) except -1:
 */
  __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_unknown_datetime_unit_s, __pyx_v_unit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __PYX_ERR(0, 2502, __pyx_L1_error)

  /* "cytimes/utils.pxd":2450
 *     raise ValueError("unknown datetime unit '%d'." % unit)
 * 
 * cdef inline int map_nptime_unit_str2int(str unit) except -1:             # <<<<<<<<<<<<<<
 *     """Map numpy datetime64/timedelta64 unit from string
 *     representation to the corresponding integer `<'int'>`."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.map_nptime_unit_str2int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":2504
 *     raise ValueError("unknown datetime unit '%s'." % unit)
 * 
 * cdef inline int get_arr_nptime_unit(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Get ndarray[datetime64/timedelta64] unit from the,
 *     returns the unit in `<'int'>`."""
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_get_arr_nptime_unit(PyArrayObject *__pyx_v_arr) {
  int __pyx_v_dtype;
  int __pyx_v_ndim;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_arr_nptime_unit", 1);

  /* "cytimes/utils.pxd":2507
 *     """Get ndarray[datetime64/timedelta64] unit from the,
 *     returns the unit in `<'int'>`."""
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype not in (np.NPY_TYPES.NPY_DATETIME, np.NPY_TYPES.NPY_TIMEDELTA):
 *         raise TypeError("expects np.ndarray[datetime64/timedelta64], got '%s'." % arr.dtype)
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "cytimes/utils.pxd":2508
 *     returns the unit in `<'int'>`."""
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype not in (np.NPY_TYPES.NPY_DATETIME, np.NPY_TYPES.NPY_TIMEDELTA):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects np.ndarray[datetime64/timedelta64], got '%s'." % arr.dtype)
 * 
 */
  switch (__pyx_v_dtype) {
    case NPY_DATETIME:
    case NPY_TIMEDELTA:
    __pyx_t_1 = 0;
    break;
    default:
    __pyx_t_1 = 1;
    break;
  }
  __pyx_t_2 = __pyx_t_1;
  if (unlikely(__pyx_t_2)) {

    /* "cytimes/utils.pxd":2509
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype not in (np.NPY_TYPES.NPY_DATETIME, np.NPY_TYPES.NPY_TIMEDELTA):
 *         raise TypeError("expects np.ndarray[datetime64/timedelta64], got '%s'." % arr.dtype)             # <<<<<<<<<<<<<<
 * 
 *     cdef int ndim = arr.ndim
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_expects_np_ndarray_datetime64_ti, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2509, __pyx_L1_error)

    /* "cytimes/utils.pxd":2508
 *     returns the unit in `<'int'>`."""
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype not in (np.NPY_TYPES.NPY_DATETIME, np.NPY_TYPES.NPY_TIMEDELTA):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects np.ndarray[datetime64/timedelta64], got '%s'." % arr.dtype)
 * 
 */
  }

  /* "cytimes/utils.pxd":2511
 *         raise TypeError("expects np.ndarray[datetime64/timedelta64], got '%s'." % arr.dtype)
 * 
 *     cdef int ndim = arr.ndim             # <<<<<<<<<<<<<<
 *     cdef np.NPY_DATETIMEUNIT unit
 *     if ndim == 1:
 */
  __pyx_v_ndim = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr);

  /* "cytimes/utils.pxd":2513
 *     cdef int ndim = arr.ndim
 *     cdef np.NPY_DATETIMEUNIT unit
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return parse_arr_nptime_unit(arr)
 */
  __pyx_t_2 = (__pyx_v_ndim == 1);
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":2514
 *     cdef np.NPY_DATETIMEUNIT unit
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/utils.pxd":2515
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 *             return parse_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *         return np.get_datetime64_unit(arr[0])
 *     if ndim == 2:
 */
      __pyx_t_5 = __pyx_f_7cytimes_5utils_parse_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 2515, __pyx_L1_error)
      __pyx_r = __pyx_t_5;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2514
 *     cdef np.NPY_DATETIMEUNIT unit
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0])
 */
    }

    /* "cytimes/utils.pxd":2516
 *         if arr.shape[0] == 0:
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0])             # <<<<<<<<<<<<<<
 *     if ndim == 2:
 *         if arr.shape[1] == 0:
 */
    __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2513
 *     cdef int ndim = arr.ndim
 *     cdef np.NPY_DATETIMEUNIT unit
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return parse_arr_nptime_unit(arr)
 */
  }

  /* "cytimes/utils.pxd":2517
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0])
 *     if ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return parse_arr_nptime_unit(arr)
 */
  __pyx_t_2 = (__pyx_v_ndim == 2);
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":2518
 *         return np.get_datetime64_unit(arr[0])
 *     if ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[1]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/utils.pxd":2519
 *     if ndim == 2:
 *         if arr.shape[1] == 0:
 *             return parse_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *         return np.get_datetime64_unit(arr[0, 0])
 *     if ndim == 3:
 */
      __pyx_t_5 = __pyx_f_7cytimes_5utils_parse_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 2519, __pyx_L1_error)
      __pyx_r = __pyx_t_5;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2518
 *         return np.get_datetime64_unit(arr[0])
 *     if ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0])
 */
    }

    /* "cytimes/utils.pxd":2520
 *         if arr.shape[1] == 0:
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     if ndim == 3:
 *         if arr.shape[2] == 0:
 */
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2517
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0])
 *     if ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return parse_arr_nptime_unit(arr)
 */
  }

  /* "cytimes/utils.pxd":2521
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0])
 *     if ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return parse_arr_nptime_unit(arr)
 */
  __pyx_t_2 = (__pyx_v_ndim == 3);
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":2522
 *         return np.get_datetime64_unit(arr[0, 0])
 *     if ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[2]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/utils.pxd":2523
 *     if ndim == 3:
 *         if arr.shape[2] == 0:
 *             return parse_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *         return np.get_datetime64_unit(arr[0, 0, 0])
 *     if ndim == 4:
 */
      __pyx_t_5 = __pyx_f_7cytimes_5utils_parse_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 2523, __pyx_L1_error)
      __pyx_r = __pyx_t_5;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2522
 *         return np.get_datetime64_unit(arr[0, 0])
 *     if ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0])
 */
    }

    /* "cytimes/utils.pxd":2524
 *         if arr.shape[2] == 0:
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     if ndim == 4:
 *         if arr.shape[3] == 0:
 */
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2521
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0])
 *     if ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return parse_arr_nptime_unit(arr)
 */
  }

  /* "cytimes/utils.pxd":2525
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0])
 *     if ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return parse_arr_nptime_unit(arr)
 */
  __pyx_t_2 = (__pyx_v_ndim == 4);
  if (__pyx_t_2) {

    /* "cytimes/utils.pxd":2526
 *         return np.get_datetime64_unit(arr[0, 0, 0])
 *     if ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[3]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/utils.pxd":2527
 *     if ndim == 4:
 *         if arr.shape[3] == 0:
 *             return parse_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *         return np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     # Invalid
 */
      __pyx_t_5 = __pyx_f_7cytimes_5utils_parse_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 2527, __pyx_L1_error)
      __pyx_r = __pyx_t_5;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":2526
 *         return np.get_datetime64_unit(arr[0, 0, 0])
 *     if ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    }

    /* "cytimes/utils.pxd":2528
 *         if arr.shape[3] == 0:
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     # Invalid
 *     raise ValueError("support <'ndarray'> with 1-4 dimensions, got ndim '%d'." % ndim)
 */
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__18); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2525
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0])
 *     if ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return parse_arr_nptime_unit(arr)
 */
  }

  /* "cytimes/utils.pxd":2530
 *         return np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     # Invalid
 *     raise ValueError("support <'ndarray'> with 1-4 dimensions, got ndim '%d'." % ndim)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_arr_nptime_unit(np.ndarray arr) except -1:
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_support_ndarray_with_1_4_dimensi, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_ERR(0, 2530, __pyx_L1_error)

  /* "cytimes/utils.pxd":2504
 *     raise ValueError("unknown datetime unit '%s'." % unit)
 * 
 * cdef inline int get_arr_nptime_unit(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Get ndarray[datetime64/timedelta64] unit from the,
 *     returns the unit in `<'int'>`."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils.get_arr_nptime_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":2532
 *     raise ValueError("support <'ndarray'> with 1-4 dimensions, got ndim '%d'." % ndim)
 * 
 * cdef inline int parse_arr_nptime_unit(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Parse ndarray[datetime64/timedelta64] unit from the,
 *     returns the unit in `<'int'>`."""
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_arr_nptime_unit(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_v_dtype_str = 0;
  Py_ssize_t __pyx_v_size;
  PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_arr_nptime_unit", 1);

  /* "cytimes/utils.pxd":2536
 *     returns the unit in `<'int'>`."""
 *     # Validate
 *     if np.PyArray_TYPE(arr) not in (np.NPY_TYPES.NPY_DATETIME, np.NPY_TYPES.NPY_TIMEDELTA):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects 'np.ndarray[datetime64/timedelta64]', got '%s'." % arr.dtype)
 * 
 */
  __pyx_t_1 = PyArray_TYPE(__pyx_v_arr);
  __pyx_t_3 = (__pyx_t_1 != NPY_DATETIME);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_t_1 != NPY_TIMEDELTA);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  __pyx_t_3 = __pyx_t_2;
  if (unlikely(__pyx_t_3)) {

    /* "cytimes/utils.pxd":2537
 *     # Validate
 *     if np.PyArray_TYPE(arr) not in (np.NPY_TYPES.NPY_DATETIME, np.NPY_TYPES.NPY_TIMEDELTA):
 *         raise TypeError("expects 'np.ndarray[datetime64/timedelta64]', got '%s'." % arr.dtype)             # <<<<<<<<<<<<<<
 * 
 *     # Prase
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_expects_np_ndarray_datetime64_ti_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 2537, __pyx_L1_error)

    /* "cytimes/utils.pxd":2536
 *     returns the unit in `<'int'>`."""
 *     # Validate
 *     if np.PyArray_TYPE(arr) not in (np.NPY_TYPES.NPY_DATETIME, np.NPY_TYPES.NPY_TIMEDELTA):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects 'np.ndarray[datetime64/timedelta64]', got '%s'." % arr.dtype)
 * 
 */
  }

  /* "cytimes/utils.pxd":2540
 * 
 *     # Prase
 *     cdef str dtype_str = arr.dtype.str             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t size = str_len(dtype_str)
 *     if size < 6:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_str); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 2540, __pyx_L1_error)
  __pyx_v_dtype_str = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "cytimes/utils.pxd":2541
 *     # Prase
 *     cdef str dtype_str = arr.dtype.str
 *     cdef Py_ssize_t size = str_len(dtype_str)             # <<<<<<<<<<<<<<
 *     if size < 6:
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str)
 */
  __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_dtype_str);

  /* "cytimes/utils.pxd":2542
 *     cdef str dtype_str = arr.dtype.str
 *     cdef Py_ssize_t size = str_len(dtype_str)
 *     if size < 6:             # <<<<<<<<<<<<<<
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str)
 *     try:
 */
  __pyx_t_3 = (__pyx_v_size < 6);
  if (unlikely(__pyx_t_3)) {

    /* "cytimes/utils.pxd":2543
 *     cdef Py_ssize_t size = str_len(dtype_str)
 *     if size < 6:
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str)             # <<<<<<<<<<<<<<
 *     try:
 *         return map_nptime_unit_str2int(str_substr(dtype_str, 4, size - 1))
 */
    __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unable_to_parse_datetime_unit_fr, __pyx_v_dtype_str); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 2543, __pyx_L1_error)

    /* "cytimes/utils.pxd":2542
 *     cdef str dtype_str = arr.dtype.str
 *     cdef Py_ssize_t size = str_len(dtype_str)
 *     if size < 6:             # <<<<<<<<<<<<<<
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str)
 *     try:
 */
  }

  /* "cytimes/utils.pxd":2544
 *     if size < 6:
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str)
 *     try:             # <<<<<<<<<<<<<<
 *         return map_nptime_unit_str2int(str_substr(dtype_str, 4, size - 1))
 *     except ValueError as err:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "cytimes/utils.pxd":2545
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str)
 *     try:
 *         return map_nptime_unit_str2int(str_substr(dtype_str, 4, size - 1))             # <<<<<<<<<<<<<<
 *     except ValueError as err:
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str) from err
 */
      __pyx_t_4 = PyUnicode_Substring(__pyx_v_dtype_str, 4, (__pyx_v_size - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2545, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(((PyObject*)__pyx_t_4)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2545, __pyx_L7_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_1;
      goto __pyx_L11_try_return;

      /* "cytimes/utils.pxd":2544
 *     if size < 6:
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str)
 *     try:             # <<<<<<<<<<<<<<
 *         return map_nptime_unit_str2int(str_substr(dtype_str, 4, size - 1))
 *     except ValueError as err:
 */
    }
    __pyx_L7_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cytimes/utils.pxd":2546
 *     try:
 *         return map_nptime_unit_str2int(str_substr(dtype_str, 4, size - 1))
 *     except ValueError as err:             # <<<<<<<<<<<<<<
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str) from err
 * 
 */
    __pyx_t_1 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_1) {
      __Pyx_AddTraceback("cytimes.utils.parse_arr_nptime_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(0, 2546, __pyx_L9_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_v_err = __pyx_t_5;
      /*try:*/ {

        /* "cytimes/utils.pxd":2547
 *         return map_nptime_unit_str2int(str_substr(dtype_str, 4, size - 1))
 *     except ValueError as err:
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str) from err             # <<<<<<<<<<<<<<
 * 
 * # NumPy: datetime64 ------------------------------------------------------------------------------------
 */
        __pyx_t_10 = PyUnicode_Format(__pyx_kp_u_unable_to_parse_datetime_unit_fr, __pyx_v_dtype_str); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2547, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2547, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_Raise(__pyx_t_11, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __PYX_ERR(0, 2547, __pyx_L18_error)
      }

      /* "cytimes/utils.pxd":2546
 *     try:
 *         return map_nptime_unit_str2int(str_substr(dtype_str, 4, size - 1))
 *     except ValueError as err:             # <<<<<<<<<<<<<<
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str) from err
 * 
 */
      /*finally:*/ {
        __pyx_L18_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_1 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          }
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L9_except_error;
        }
      }
    }
    goto __pyx_L9_except_error;

    /* "cytimes/utils.pxd":2544
 *     if size < 6:
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str)
 *     try:             # <<<<<<<<<<<<<<
 *         return map_nptime_unit_str2int(str_substr(dtype_str, 4, size - 1))
 *     except ValueError as err:
 */
    __pyx_L9_except_error:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L11_try_return:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L0;
  }

  /* "cytimes/utils.pxd":2532
 *     raise ValueError("support <'ndarray'> with 1-4 dimensions, got ndim '%d'." % ndim)
 * 
 * cdef inline int parse_arr_nptime_unit(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Parse ndarray[datetime64/timedelta64] unit from the,
 *     returns the unit in `<'int'>`."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.utils.parse_arr_nptime_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dtype_str);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":2551
 * # NumPy: datetime64 ------------------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_dt64(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of np.datetime64 `<'bool'>`.
 * 
 */

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

  /* "cytimes/utils.pxd":2557
 *     >>> isinstance(obj, np.datetime64)
 *     """
 *     return np.is_datetime64_object(obj)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint validate_dt64(object obj) except -1:
 */
  __pyx_r = __pyx_f_5numpy_is_datetime64_object(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2551
 * # NumPy: datetime64 ------------------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_dt64(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of np.datetime64 `<'bool'>`.
 * 
 */

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

/* "cytimes/utils.pxd":2559
 *     return np.is_datetime64_object(obj)
 * 
 * cdef inline bint validate_dt64(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Validate if an object is an instance of np.datetime64,
 *     and raises `TypeError` if not."""
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_validate_dt64(PyObject *__pyx_v_obj) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("validate_dt64", 1);

  /* "cytimes/utils.pxd":2562
 *     """Validate if an object is an instance of np.datetime64,
 *     and raises `TypeError` if not."""
 *     if not np.is_datetime64_object(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects 'np.datetime64', got %s." % type(obj))
 *     return True
 */
  __pyx_t_1 = (!__pyx_f_5numpy_is_datetime64_object(__pyx_v_obj));
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":2563
 *     and raises `TypeError` if not."""
 *     if not np.is_datetime64_object(obj):
 *         raise TypeError("expects 'np.datetime64', got %s." % type(obj))             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
    __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_expects_np_datetime64_got_s, ((PyObject *)Py_TYPE(__pyx_v_obj))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2563, __pyx_L1_error)

    /* "cytimes/utils.pxd":2562
 *     """Validate if an object is an instance of np.datetime64,
 *     and raises `TypeError` if not."""
 *     if not np.is_datetime64_object(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects 'np.datetime64', got %s." % type(obj))
 *     return True
 */
  }

  /* "cytimes/utils.pxd":2564
 *     if not np.is_datetime64_object(obj):
 *         raise TypeError("expects 'np.datetime64', got %s." % type(obj))
 *     return True             # <<<<<<<<<<<<<<
 * 
 * # . conversion
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2559
 *     return np.is_datetime64_object(obj)
 * 
 * cdef inline bint validate_dt64(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Validate if an object is an instance of np.datetime64,
 *     and raises `TypeError` if not."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.validate_dt64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils_dt64_as_int64_us(PyObject *__pyx_v_dt64, struct __pyx_opt_args_7cytimes_5utils_dt64_as_int64_us *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  NPY_DATETIMEUNIT __pyx_v_unit;
  npy_int64 __pyx_v_val;
  npy_int64 __pyx_r;
  int __pyx_t_1;
  npy_int64 __pyx_t_2;
  struct __pyx_opt_args_7cytimes_5utils__dt64_W_as_int64_D __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils__dt64_M_as_int64_D __pyx_t_4;
  struct __pyx_opt_args_7cytimes_5utils__dt64_Y_as_int64_D __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }

  /* "cytimes/utils.pxd":2574
 *     """
 *     # Get unit & value
 *     validate_dt64(dt64)             # <<<<<<<<<<<<<<
 *     cdef np.NPY_DATETIMEUNIT unit = np.get_datetime64_unit(dt64)
 *     cdef np.npy_int64 val = np.get_datetime64_value(dt64)
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_validate_dt64(__pyx_v_dt64); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2574, __pyx_L1_error)

  /* "cytimes/utils.pxd":2575
 *     # Get unit & value
 *     validate_dt64(dt64)
 *     cdef np.NPY_DATETIMEUNIT unit = np.get_datetime64_unit(dt64)             # <<<<<<<<<<<<<<
 *     cdef np.npy_int64 val = np.get_datetime64_value(dt64)
 * 
 */
  __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_v_dt64);

  /* "cytimes/utils.pxd":2576
 *     validate_dt64(dt64)
 *     cdef np.NPY_DATETIMEUNIT unit = np.get_datetime64_unit(dt64)
 *     cdef np.npy_int64 val = np.get_datetime64_value(dt64)             # <<<<<<<<<<<<<<
 * 
 *     # Conversion
 */
  __pyx_v_val = __pyx_f_5numpy_get_datetime64_value(__pyx_v_dt64);

  /* "cytimes/utils.pxd":2579
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2580
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000 + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val + offset
 */
    __pyx_r = (__Pyx_div_npy_int64(__pyx_v_val, 0x3E8) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2579
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/utils.pxd":2581
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2582
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * US_MILLISECOND + offset
 */
    __pyx_r = (__pyx_v_val + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2581
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/utils.pxd":2583
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2584
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * US_MILLISECOND + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * US_SECOND + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_MILLISECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2583
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/utils.pxd":2585
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2586
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * US_SECOND + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * US_MINUTE + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_SECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2585
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/utils.pxd":2587
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2588
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * US_MINUTE + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_MINUTE) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2587
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/utils.pxd":2589
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2590
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_HOUR) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2589
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/utils.pxd":2591
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2592
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64_W_as_int64_D(val, US_DAY, offset)
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_DAY) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2591
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "cytimes/utils.pxd":2593
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2594
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64_W_as_int64_D(val, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64_M_as_int64_D(val, US_DAY, offset)
 */
    __pyx_t_3.__pyx_n = 2;
    __pyx_t_3.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_3.offset = __pyx_v_offset;
    __pyx_t_2 = __pyx_f_7cytimes_5utils__dt64_W_as_int64_D(__pyx_v_val, &__pyx_t_3); if (unlikely(__pyx_t_2 == ((npy_int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 2594, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2593
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "cytimes/utils.pxd":2595
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2596
 *         return _dt64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64_M_as_int64_D(val, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64_Y_as_int64_D(val, US_DAY, offset)
 */
    __pyx_t_4.__pyx_n = 2;
    __pyx_t_4.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_2 = __pyx_f_7cytimes_5utils__dt64_M_as_int64_D(__pyx_v_val, &__pyx_t_4); if (unlikely(__pyx_t_2 == ((npy_int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 2596, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2595
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "cytimes/utils.pxd":2597
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64_Y_as_int64_D(val, US_DAY, offset)
 *     # . unsupported
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2598
 *         return _dt64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64_Y_as_int64_D(val, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     _raise_dt64_as_int64_unit_error("us", unit)
 */
    __pyx_t_5.__pyx_n = 2;
    __pyx_t_5.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_5.offset = __pyx_v_offset;
    __pyx_t_2 = __pyx_f_7cytimes_5utils__dt64_Y_as_int64_D(__pyx_v_val, &__pyx_t_5); if (unlikely(__pyx_t_2 == ((npy_int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 2598, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2597
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64_Y_as_int64_D(val, US_DAY, offset)
 *     # . unsupported
 */
  }

  /* "cytimes/utils.pxd":2600
 *         return _dt64_Y_as_int64_D(val, US_DAY, offset)
 *     # . unsupported
 *     _raise_dt64_as_int64_unit_error("us", unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.npy_int64 _dt64_Y_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64_as_int64_unit_error(__pyx_n_u_us, __pyx_v_unit, NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2600, __pyx_L1_error)

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

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

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

static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__dt64_Y_as_int64_D(npy_int64 __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils__dt64_Y_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_year;
  npy_int64 __pyx_v_y_1;
  npy_int64 __pyx_v_leaps;
  npy_int64 __pyx_r;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "cytimes/utils.pxd":2605
 *     """(internal) Convert the value of np.datetime64[Y] to int64 under 'D' resolution `<'int'>`."""
 *     cdef:
 *         np.npy_int64 year = val + EPOCH_YEAR             # <<<<<<<<<<<<<<
 *         # Compute leap years
 *         np.npy_int64 y_1 = year - 1
 */
  __pyx_v_year = (__pyx_v_val + __pyx_v_7cytimes_5utils_EPOCH_YEAR);

  /* "cytimes/utils.pxd":2607
 *         np.npy_int64 year = val + EPOCH_YEAR
 *         # Compute leap years
 *         np.npy_int64 y_1 = year - 1             # <<<<<<<<<<<<<<
 *         np.npy_int64 leaps = (
 *             (y_1 // 4 - 1970 // 4)
 */
  __pyx_v_y_1 = (__pyx_v_year - 1);

  /* "cytimes/utils.pxd":2611
 *             (y_1 // 4 - 1970 // 4)
 *             - (y_1 // 100 - 1970 // 100)
 *             + (y_1 // 400 - 1970 // 400)             # <<<<<<<<<<<<<<
 *         )
 *     return (val * 365 + leaps) * factor + offset
 */
  __pyx_v_leaps = (((__Pyx_div_npy_int64(__pyx_v_y_1, 4) - 0x1ec) - (__Pyx_div_npy_int64(__pyx_v_y_1, 0x64) - 0x13)) + (__Pyx_div_npy_int64(__pyx_v_y_1, 0x190) - 0x4));

  /* "cytimes/utils.pxd":2613
 *             + (y_1 // 400 - 1970 // 400)
 *         )
 *     return (val * 365 + leaps) * factor + offset             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.npy_int64 _dt64_M_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_r = ((((__pyx_v_val * 0x16D) + __pyx_v_leaps) * __pyx_v_factor) + __pyx_v_offset);
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__dt64_M_as_int64_D(npy_int64 __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils__dt64_M_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_year_ep;
  npy_int64 __pyx_v_year;
  npy_int64 __pyx_v_month;
  npy_int64 __pyx_v_y_1;
  npy_int64 __pyx_v_leaps;
  npy_int64 __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "cytimes/utils.pxd":2618
 *     """(internal) Convert the value of np.datetime64[M] to int64 under 'D' resolution `<'int'>`."""
 *     cdef:
 *         np.npy_int64 year_ep = val // 12             # <<<<<<<<<<<<<<
 *         np.npy_int64 year = year_ep + EPOCH_YEAR
 *         np.npy_int64 month = val % 12 + 1
 */
  __pyx_v_year_ep = __Pyx_div_npy_int64(__pyx_v_val, 12);

  /* "cytimes/utils.pxd":2619
 *     cdef:
 *         np.npy_int64 year_ep = val // 12
 *         np.npy_int64 year = year_ep + EPOCH_YEAR             # <<<<<<<<<<<<<<
 *         np.npy_int64 month = val % 12 + 1
 *         # Compute leap years
 */
  __pyx_v_year = (__pyx_v_year_ep + __pyx_v_7cytimes_5utils_EPOCH_YEAR);

  /* "cytimes/utils.pxd":2620
 *         np.npy_int64 year_ep = val // 12
 *         np.npy_int64 year = year_ep + EPOCH_YEAR
 *         np.npy_int64 month = val % 12 + 1             # <<<<<<<<<<<<<<
 *         # Compute leap years
 *         np.npy_int64 y_1 = year - 1
 */
  __pyx_v_month = (__Pyx_mod_npy_int64(__pyx_v_val, 12) + 1);

  /* "cytimes/utils.pxd":2622
 *         np.npy_int64 month = val % 12 + 1
 *         # Compute leap years
 *         np.npy_int64 y_1 = year - 1             # <<<<<<<<<<<<<<
 *         np.npy_int64 leaps = (
 *             (y_1 // 4 - 1970 // 4)
 */
  __pyx_v_y_1 = (__pyx_v_year - 1);

  /* "cytimes/utils.pxd":2626
 *             (y_1 // 4 - 1970 // 4)
 *             - (y_1 // 100 - 1970 // 100)
 *             + (y_1 // 400 - 1970 // 400)             # <<<<<<<<<<<<<<
 *         )
 *     return (year_ep * 365 + leaps + days_bf_month(year, month)) * factor + offset
 */
  __pyx_v_leaps = (((__Pyx_div_npy_int64(__pyx_v_y_1, 4) - 0x1ec) - (__Pyx_div_npy_int64(__pyx_v_y_1, 0x64) - 0x13)) + (__Pyx_div_npy_int64(__pyx_v_y_1, 0x190) - 0x4));

  /* "cytimes/utils.pxd":2628
 *             + (y_1 // 400 - 1970 // 400)
 *         )
 *     return (year_ep * 365 + leaps + days_bf_month(year, month)) * factor + offset             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.npy_int64 _dt64_W_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2628, __pyx_L1_error)
  __pyx_r = (((((__pyx_v_year_ep * 0x16D) + __pyx_v_leaps) + __pyx_t_1) * __pyx_v_factor) + __pyx_v_offset);
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__dt64_W_as_int64_D(npy_int64 __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils__dt64_W_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_r;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "cytimes/utils.pxd":2632
 * cdef inline np.npy_int64 _dt64_W_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):
 *     """(internal) Convert the value of np.datetime64[W] to int64 under 'D' resolution `<'int'>`."""
 *     return val * 7 * factor + offset             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.datetime dt64_to_dt(object dt64, tz: object=None):
 */
  __pyx_r = (((__pyx_v_val * 7) * __pyx_v_factor) + __pyx_v_offset);
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt64_to_dt(PyObject *__pyx_v_dt64, struct __pyx_opt_args_7cytimes_5utils_dt64_to_dt *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  npy_int64 __pyx_t_1;
  struct __pyx_opt_args_7cytimes_5utils_dt64_as_int64_us __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt_fr_us __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64_to_dt", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "cytimes/utils.pxd":2636
 * cdef inline datetime.datetime dt64_to_dt(object dt64, tz: object=None):
 *     """Convert np.datetime64 to datetime `<'datetime.datetime'>`."""
 *     return dt_fr_us(dt64_as_int64_us(dt64, 0), tz)             # <<<<<<<<<<<<<<
 * 
 * # . errors: internal
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = __pyx_f_7cytimes_5utils_dt64_as_int64_us(__pyx_v_dt64, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((npy_int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 2636, __pyx_L1_error)
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.tz = __pyx_v_tz;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_us(__pyx_t_1, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_dt64_as_int64_unit_error(PyObject *__pyx_v_reso, int __pyx_v_unit, struct __pyx_opt_args_7cytimes_5utils__raise_dt64_as_int64_unit_error *__pyx_optional_args) {
  int __pyx_v_is_dt64 = ((int)1);
  PyObject *__pyx_v_obj_type = NULL;
  PyObject *__pyx_v_unit_str = NULL;
  PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_raise_dt64_as_int64_unit_error", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_is_dt64 = __pyx_optional_args->is_dt64;
    }
  }

  /* "cytimes/utils.pxd":2641
 * cdef inline bint _raise_dt64_as_int64_unit_error(str reso, int unit, bint is_dt64=True) except -1:
 *     """(internal) Raise unsupported unit for dt/td_as_int*() function."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"             # <<<<<<<<<<<<<<
 *     try:
 *         unit_str = map_nptime_unit_int2str(unit)
 */
  if (__pyx_v_is_dt64) {
    __Pyx_INCREF(__pyx_n_u_datetime64);
    __pyx_t_1 = __pyx_n_u_datetime64;
  } else {
    __Pyx_INCREF(__pyx_n_u_timedelta64);
    __pyx_t_1 = __pyx_n_u_timedelta64;
  }
  __pyx_v_obj_type = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":2642
 *     """(internal) Raise unsupported unit for dt/td_as_int*() function."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 *     try:             # <<<<<<<<<<<<<<
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "cytimes/utils.pxd":2643
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 *     try:
 *         unit_str = map_nptime_unit_int2str(unit)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         raise ValueError(
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2643, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_unit_str = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "cytimes/utils.pxd":2642
 *     """(internal) Raise unsupported unit for dt/td_as_int*() function."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 *     try:             # <<<<<<<<<<<<<<
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:
 */
    }

    /* "cytimes/utils.pxd":2651
 *         ) from err
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "cannot cast %s[%s] to an integer under '%s' resolution.\n"
 *             "%s with datetime unit '%s' is not supported."
 */
    /*else:*/ {

      /* "cytimes/utils.pxd":2652
 *     else:
 *         raise ValueError(
 *             "cannot cast %s[%s] to an integer under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *             "%s with datetime unit '%s' is not supported."
 *             % (obj_type, unit_str, reso, obj_type, unit_str)
 */
      __pyx_t_1 = PyTuple_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2652, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = 0;
      __pyx_t_6 = 127;
      __Pyx_INCREF(__pyx_kp_u_cannot_cast);
      __pyx_t_5 += 12;
      __Pyx_GIVEREF(__pyx_kp_u_cannot_cast);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_cannot_cast);

      /* "cytimes/utils.pxd":2654
 *             "cannot cast %s[%s] to an integer under '%s' resolution.\n"
 *             "%s with datetime unit '%s' is not supported."
 *             % (obj_type, unit_str, reso, obj_type, unit_str)             # <<<<<<<<<<<<<<
 *         )
 * 
 */
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_obj_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2654, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u__19);
      __pyx_t_5 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__19);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__19);
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_unit_str); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2654, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u_to_an_integer_under);
      __pyx_t_5 += 23;
      __Pyx_GIVEREF(__pyx_kp_u_to_an_integer_under);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_to_an_integer_under);
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_reso); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2654, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u_resolution);
      __pyx_t_5 += 14;
      __Pyx_GIVEREF(__pyx_kp_u_resolution);
      PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_resolution);
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_obj_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2654, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u_with_datetime_unit);
      __pyx_t_5 += 21;
      __Pyx_GIVEREF(__pyx_kp_u_with_datetime_unit);
      PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u_with_datetime_unit);
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_unit_str); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2654, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u_is_not_supported);
      __pyx_t_5 += 19;
      __Pyx_GIVEREF(__pyx_kp_u_is_not_supported);
      PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_kp_u_is_not_supported);

      /* "cytimes/utils.pxd":2652
 *     else:
 *         raise ValueError(
 *             "cannot cast %s[%s] to an integer under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *             "%s with datetime unit '%s' is not supported."
 *             % (obj_type, unit_str, reso, obj_type, unit_str)
 */
      __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 11, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2652, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cytimes/utils.pxd":2651
 *         ) from err
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "cannot cast %s[%s] to an integer under '%s' resolution.\n"
 *             "%s with datetime unit '%s' is not supported."
 */
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2651, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 2651, __pyx_L5_except_error)
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/utils.pxd":2644
 *     try:
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "cannot cast %s to an integer under '%s' resolution.\n"
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("cytimes.utils._raise_dt64_as_int64_unit_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(0, 2644, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_v_err = __pyx_t_7;
      /*try:*/ {

        /* "cytimes/utils.pxd":2646
 *     except Exception as err:
 *         raise ValueError(
 *             "cannot cast %s to an integer under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *             "%s with datetime unit '%d' is not supported."
 *             % (obj_type, reso, obj_type, unit)
 */
        __pyx_t_10 = PyTuple_New(9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2646, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_5 = 0;
        __pyx_t_6 = 127;
        __Pyx_INCREF(__pyx_kp_u_cannot_cast);
        __pyx_t_5 += 12;
        __Pyx_GIVEREF(__pyx_kp_u_cannot_cast);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_kp_u_cannot_cast);

        /* "cytimes/utils.pxd":2648
 *             "cannot cast %s to an integer under '%s' resolution.\n"
 *             "%s with datetime unit '%d' is not supported."
 *             % (obj_type, reso, obj_type, unit)             # <<<<<<<<<<<<<<
 *         ) from err
 *     else:
 */
        __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_obj_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2648, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_6;
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_INCREF(__pyx_kp_u_to_an_integer_under_2);
        __pyx_t_5 += 22;
        __Pyx_GIVEREF(__pyx_kp_u_to_an_integer_under_2);
        PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_kp_u_to_an_integer_under_2);
        __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_reso); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2648, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_6;
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_INCREF(__pyx_kp_u_resolution);
        __pyx_t_5 += 14;
        __Pyx_GIVEREF(__pyx_kp_u_resolution);
        PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_kp_u_resolution);
        __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_obj_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2648, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_6;
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_INCREF(__pyx_kp_u_with_datetime_unit);
        __pyx_t_5 += 21;
        __Pyx_GIVEREF(__pyx_kp_u_with_datetime_unit);
        PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_kp_u_with_datetime_unit);
        __pyx_t_11 = __Pyx_PyUnicode_From_int(__pyx_v_unit, 0, ' ', 'd'); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2648, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_INCREF(__pyx_kp_u_is_not_supported);
        __pyx_t_5 += 19;
        __Pyx_GIVEREF(__pyx_kp_u_is_not_supported);
        PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_kp_u_is_not_supported);

        /* "cytimes/utils.pxd":2646
 *     except Exception as err:
 *         raise ValueError(
 *             "cannot cast %s to an integer under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *             "%s with datetime unit '%d' is not supported."
 *             % (obj_type, reso, obj_type, unit)
 */
        __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_10, 9, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2646, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "cytimes/utils.pxd":2645
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "cannot cast %s to an integer under '%s' resolution.\n"
 *             "%s with datetime unit '%d' is not supported."
 */
        __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2645, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/utils.pxd":2649
 *             "%s with datetime unit '%d' is not supported."
 *             % (obj_type, reso, obj_type, unit)
 *         ) from err             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
        __Pyx_Raise(__pyx_t_10, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __PYX_ERR(0, 2645, __pyx_L14_error)
      }

      /* "cytimes/utils.pxd":2644
 *     try:
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "cannot cast %s to an integer under '%s' resolution.\n"
 */
      /*finally:*/ {
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_8 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          }
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/utils.pxd":2642
 *     """(internal) Raise unsupported unit for dt/td_as_int*() function."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 *     try:             # <<<<<<<<<<<<<<
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
  }

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.utils._raise_dt64_as_int64_unit_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_XDECREF(__pyx_v_obj_type);
  __Pyx_XDECREF(__pyx_v_unit_str);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":2659
 * # NumPy: timedelta64 -----------------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_td64(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of np.timedelta64 `<'bool'>`.
 * 
 */

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

  /* "cytimes/utils.pxd":2665
 *     >>> isinstance(obj, np.timedelta64)
 *     """
 *     return np.is_timedelta64_object(obj)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint validate_td64(object obj) except -1:
 */
  __pyx_r = __pyx_f_5numpy_is_timedelta64_object(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2659
 * # NumPy: timedelta64 -----------------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_td64(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of np.timedelta64 `<'bool'>`.
 * 
 */

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

/* "cytimes/utils.pxd":2667
 *     return np.is_timedelta64_object(obj)
 * 
 * cdef inline bint validate_td64(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Validate if an object is an instance of np.timedelta64,
 *     and raises `TypeError` if not."""
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_validate_td64(PyObject *__pyx_v_obj) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("validate_td64", 1);

  /* "cytimes/utils.pxd":2670
 *     """Validate if an object is an instance of np.timedelta64,
 *     and raises `TypeError` if not."""
 *     if not np.is_timedelta64_object(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects 'np.timedelta64', got %s." % type(obj))
 *     return True
 */
  __pyx_t_1 = (!__pyx_f_5numpy_is_timedelta64_object(__pyx_v_obj));
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":2671
 *     and raises `TypeError` if not."""
 *     if not np.is_timedelta64_object(obj):
 *         raise TypeError("expects 'np.timedelta64', got %s." % type(obj))             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
    __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_expects_np_timedelta64_got_s, ((PyObject *)Py_TYPE(__pyx_v_obj))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2671, __pyx_L1_error)

    /* "cytimes/utils.pxd":2670
 *     """Validate if an object is an instance of np.timedelta64,
 *     and raises `TypeError` if not."""
 *     if not np.is_timedelta64_object(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects 'np.timedelta64', got %s." % type(obj))
 *     return True
 */
  }

  /* "cytimes/utils.pxd":2672
 *     if not np.is_timedelta64_object(obj):
 *         raise TypeError("expects 'np.timedelta64', got %s." % type(obj))
 *     return True             # <<<<<<<<<<<<<<
 * 
 * # . conversion
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2667
 *     return np.is_timedelta64_object(obj)
 * 
 * cdef inline bint validate_td64(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Validate if an object is an instance of np.timedelta64,
 *     and raises `TypeError` if not."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.validate_td64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils_td64_as_int64_us(PyObject *__pyx_v_td64, struct __pyx_opt_args_7cytimes_5utils_td64_as_int64_us *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  NPY_DATETIMEUNIT __pyx_v_unit;
  npy_int64 __pyx_v_val;
  npy_int64 __pyx_r;
  int __pyx_t_1;
  npy_int64 __pyx_t_2;
  struct __pyx_opt_args_7cytimes_5utils__td64_W_as_int64_D __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils__td64_M_as_int64_D __pyx_t_4;
  struct __pyx_opt_args_7cytimes_5utils__td64_Y_as_int64_D __pyx_t_5;
  struct __pyx_opt_args_7cytimes_5utils__raise_dt64_as_int64_unit_error __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }

  /* "cytimes/utils.pxd":2682
 *     """
 *     # Get unit & value
 *     validate_td64(td64)             # <<<<<<<<<<<<<<
 *     cdef np.NPY_DATETIMEUNIT unit = np.get_datetime64_unit(td64)
 *     cdef np.npy_int64 val = np.get_timedelta64_value(td64)
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_validate_td64(__pyx_v_td64); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2682, __pyx_L1_error)

  /* "cytimes/utils.pxd":2683
 *     # Get unit & value
 *     validate_td64(td64)
 *     cdef np.NPY_DATETIMEUNIT unit = np.get_datetime64_unit(td64)             # <<<<<<<<<<<<<<
 *     cdef np.npy_int64 val = np.get_timedelta64_value(td64)
 * 
 */
  __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_v_td64);

  /* "cytimes/utils.pxd":2684
 *     validate_td64(td64)
 *     cdef np.NPY_DATETIMEUNIT unit = np.get_datetime64_unit(td64)
 *     cdef np.npy_int64 val = np.get_timedelta64_value(td64)             # <<<<<<<<<<<<<<
 * 
 *     # Conversion
 */
  __pyx_v_val = __pyx_f_5numpy_get_timedelta64_value(__pyx_v_td64);

  /* "cytimes/utils.pxd":2687
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2688
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000 + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val + offset
 */
    __pyx_r = (__Pyx_div_npy_int64(__pyx_v_val, 0x3E8) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2687
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/utils.pxd":2689
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2690
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * US_MILLISECOND + offset
 */
    __pyx_r = (__pyx_v_val + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2689
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/utils.pxd":2691
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2692
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * US_MILLISECOND + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * US_SECOND + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_MILLISECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2691
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/utils.pxd":2693
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2694
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * US_SECOND + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * US_MINUTE + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_SECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2693
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/utils.pxd":2695
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2696
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * US_MINUTE + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_MINUTE) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2695
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/utils.pxd":2697
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2698
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_HOUR) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2697
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/utils.pxd":2699
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2700
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _td64_W_as_int64_D(val, US_DAY, offset)
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_DAY) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2699
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "cytimes/utils.pxd":2701
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _td64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2702
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _td64_W_as_int64_D(val, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _td64_M_as_int64_D(val, US_DAY, offset)
 */
    __pyx_t_3.__pyx_n = 2;
    __pyx_t_3.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_3.offset = __pyx_v_offset;
    __pyx_t_2 = __pyx_f_7cytimes_5utils__td64_W_as_int64_D(__pyx_v_val, &__pyx_t_3); if (unlikely(__pyx_t_2 == ((npy_int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 2702, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2701
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _td64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "cytimes/utils.pxd":2703
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _td64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _td64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2704
 *         return _td64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _td64_M_as_int64_D(val, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _td64_Y_as_int64_D(val, US_DAY, offset)
 */
    __pyx_t_4.__pyx_n = 2;
    __pyx_t_4.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_2 = __pyx_f_7cytimes_5utils__td64_M_as_int64_D(__pyx_v_val, &__pyx_t_4); if (unlikely(__pyx_t_2 == ((npy_int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 2704, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2703
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _td64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _td64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "cytimes/utils.pxd":2705
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _td64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _td64_Y_as_int64_D(val, US_DAY, offset)
 *     # . unsupported unit
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2706
 *         return _td64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _td64_Y_as_int64_D(val, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported unit
 *     _raise_dt64_as_int64_unit_error("us", unit, False)
 */
    __pyx_t_5.__pyx_n = 2;
    __pyx_t_5.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_5.offset = __pyx_v_offset;
    __pyx_t_2 = __pyx_f_7cytimes_5utils__td64_Y_as_int64_D(__pyx_v_val, &__pyx_t_5); if (unlikely(__pyx_t_2 == ((npy_int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 2706, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2705
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _td64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _td64_Y_as_int64_D(val, US_DAY, offset)
 *     # . unsupported unit
 */
  }

  /* "cytimes/utils.pxd":2708
 *         return _td64_Y_as_int64_D(val, US_DAY, offset)
 *     # . unsupported unit
 *     _raise_dt64_as_int64_unit_error("us", unit, False)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.npy_int64 _td64_Y_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.is_dt64 = 0;
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64_as_int64_unit_error(__pyx_n_u_us, __pyx_v_unit, &__pyx_t_6); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2708, __pyx_L1_error)

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

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

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

static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__td64_Y_as_int64_D(npy_int64 __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils__td64_Y_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_td64_Y_as_int64_D", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "cytimes/utils.pxd":2716
 *     # Multiply by 3652425 and divide by 10000 to represent 365.2425 days/year.
 *     cdef np.npy_int64 days
 *     if factor == 1:  # day             # <<<<<<<<<<<<<<
 *         return val * 3_652_425 // 10_000 + offset  # val * 365.2425
 *     if factor == 24:  # hour
 */
  __pyx_t_1 = (__pyx_v_factor == 1);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2717
 *     cdef np.npy_int64 days
 *     if factor == 1:  # day
 *         return val * 3_652_425 // 10_000 + offset  # val * 365.2425             # <<<<<<<<<<<<<<
 *     if factor == 24:  # hour
 *         return val * 876_582 // 100 + offset  # val * 8765.82 (365.2425 * 24)
 */
    __pyx_r = (__Pyx_div_npy_int64((__pyx_v_val * 0x37BB49), 0x2710) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2716
 *     # Multiply by 3652425 and divide by 10000 to represent 365.2425 days/year.
 *     cdef np.npy_int64 days
 *     if factor == 1:  # day             # <<<<<<<<<<<<<<
 *         return val * 3_652_425 // 10_000 + offset  # val * 365.2425
 *     if factor == 24:  # hour
 */
  }

  /* "cytimes/utils.pxd":2718
 *     if factor == 1:  # day
 *         return val * 3_652_425 // 10_000 + offset  # val * 365.2425
 *     if factor == 24:  # hour             # <<<<<<<<<<<<<<
 *         return val * 876_582 // 100 + offset  # val * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute
 */
  __pyx_t_1 = (__pyx_v_factor == 24);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2719
 *         return val * 3_652_425 // 10_000 + offset  # val * 365.2425
 *     if factor == 24:  # hour
 *         return val * 876_582 // 100 + offset  # val * 8765.82 (365.2425 * 24)             # <<<<<<<<<<<<<<
 *     if factor == 1_440:  # minute
 *         return val * 5_259_492 // 10 + offset  # val * 525949.2 (365.2425 * 1440)
 */
    __pyx_r = (__Pyx_div_npy_int64((__pyx_v_val * 0xD6026), 0x64) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2718
 *     if factor == 1:  # day
 *         return val * 3_652_425 // 10_000 + offset  # val * 365.2425
 *     if factor == 24:  # hour             # <<<<<<<<<<<<<<
 *         return val * 876_582 // 100 + offset  # val * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute
 */
  }

  /* "cytimes/utils.pxd":2720
 *     if factor == 24:  # hour
 *         return val * 876_582 // 100 + offset  # val * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute             # <<<<<<<<<<<<<<
 *         return val * 5_259_492 // 10 + offset  # val * 525949.2 (365.2425 * 1440)
 *     if factor == SS_DAY:  # second
 */
  __pyx_t_1 = (__pyx_v_factor == 0x5A0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2721
 *         return val * 876_582 // 100 + offset  # val * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute
 *         return val * 5_259_492 // 10 + offset  # val * 525949.2 (365.2425 * 1440)             # <<<<<<<<<<<<<<
 *     if factor == SS_DAY:  # second
 *         return val * TD64_YY_SECOND + offset
 */
    __pyx_r = (__Pyx_div_npy_int64((__pyx_v_val * 0x5040E4), 10) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2720
 *     if factor == 24:  # hour
 *         return val * 876_582 // 100 + offset  # val * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute             # <<<<<<<<<<<<<<
 *         return val * 5_259_492 // 10 + offset  # val * 525949.2 (365.2425 * 1440)
 *     if factor == SS_DAY:  # second
 */
  }

  /* "cytimes/utils.pxd":2722
 *     if factor == 1_440:  # minute
 *         return val * 5_259_492 // 10 + offset  # val * 525949.2 (365.2425 * 1440)
 *     if factor == SS_DAY:  # second             # <<<<<<<<<<<<<<
 *         return val * TD64_YY_SECOND + offset
 *     if factor == MS_DAY:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_SS_DAY);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2723
 *         return val * 5_259_492 // 10 + offset  # val * 525949.2 (365.2425 * 1440)
 *     if factor == SS_DAY:  # second
 *         return val * TD64_YY_SECOND + offset             # <<<<<<<<<<<<<<
 *     if factor == MS_DAY:  # millisecond
 *         return val * TD64_YY_MILLISECOND + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_TD64_YY_SECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2722
 *     if factor == 1_440:  # minute
 *         return val * 5_259_492 // 10 + offset  # val * 525949.2 (365.2425 * 1440)
 *     if factor == SS_DAY:  # second             # <<<<<<<<<<<<<<
 *         return val * TD64_YY_SECOND + offset
 *     if factor == MS_DAY:  # millisecond
 */
  }

  /* "cytimes/utils.pxd":2724
 *     if factor == SS_DAY:  # second
 *         return val * TD64_YY_SECOND + offset
 *     if factor == MS_DAY:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * TD64_YY_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_MS_DAY);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2725
 *         return val * TD64_YY_SECOND + offset
 *     if factor == MS_DAY:  # millisecond
 *         return val * TD64_YY_MILLISECOND + offset             # <<<<<<<<<<<<<<
 *     if factor == US_DAY:  # microsecond
 *         return val * TD64_YY_MICROSECOND + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_TD64_YY_MILLISECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2724
 *     if factor == SS_DAY:  # second
 *         return val * TD64_YY_SECOND + offset
 *     if factor == MS_DAY:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * TD64_YY_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond
 */
  }

  /* "cytimes/utils.pxd":2726
 *     if factor == MS_DAY:  # millisecond
 *         return val * TD64_YY_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond             # <<<<<<<<<<<<<<
 *         return val * TD64_YY_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_US_DAY);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2727
 *         return val * TD64_YY_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond
 *         return val * TD64_YY_MICROSECOND + offset             # <<<<<<<<<<<<<<
 *     if factor == NS_DAY:  # nanosecond
 *         return val * TD64_YY_NANOSECOND + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_TD64_YY_MICROSECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2726
 *     if factor == MS_DAY:  # millisecond
 *         return val * TD64_YY_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond             # <<<<<<<<<<<<<<
 *         return val * TD64_YY_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond
 */
  }

  /* "cytimes/utils.pxd":2728
 *     if factor == US_DAY:  # microsecond
 *         return val * TD64_YY_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val * TD64_YY_NANOSECOND + offset
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_NS_DAY);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2729
 *         return val * TD64_YY_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond
 *         return val * TD64_YY_NANOSECOND + offset             # <<<<<<<<<<<<<<
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 * 
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_TD64_YY_NANOSECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2728
 *     if factor == US_DAY:  # microsecond
 *         return val * TD64_YY_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val * TD64_YY_NANOSECOND + offset
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 */
  }

  /* "cytimes/utils.pxd":2730
 *     if factor == NS_DAY:  # nanosecond
 *         return val * TD64_YY_NANOSECOND + offset
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.npy_int64 _td64_M_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unsupported_factor_d_for_timedel, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(0, 2730, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils._td64_Y_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__td64_M_as_int64_D(npy_int64 __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils__td64_M_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_td64_M_as_int64_D", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "cytimes/utils.pxd":2738
 *     # Multiply by 30436875 and divide by 1000000 to represent 30.436875 days/month.
 *     cdef np.npy_int64 days
 *     if factor == 1: #  day             # <<<<<<<<<<<<<<
 *         return val * 30_436_875 // 1_000_000 + offset  # val * 30.436875
 *     if factor == 24: #  hour
 */
  __pyx_t_1 = (__pyx_v_factor == 1);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2739
 *     cdef np.npy_int64 days
 *     if factor == 1: #  day
 *         return val * 30_436_875 // 1_000_000 + offset  # val * 30.436875             # <<<<<<<<<<<<<<
 *     if factor == 24: #  hour
 *         return val * 730_485 // 1_000 + offset  # val * 730.485 (30.436875 * 24)
 */
    __pyx_r = (__Pyx_div_npy_int64((__pyx_v_val * 0x1D06E0B), 0xF4240) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2738
 *     # Multiply by 30436875 and divide by 1000000 to represent 30.436875 days/month.
 *     cdef np.npy_int64 days
 *     if factor == 1: #  day             # <<<<<<<<<<<<<<
 *         return val * 30_436_875 // 1_000_000 + offset  # val * 30.436875
 *     if factor == 24: #  hour
 */
  }

  /* "cytimes/utils.pxd":2740
 *     if factor == 1: #  day
 *         return val * 30_436_875 // 1_000_000 + offset  # val * 30.436875
 *     if factor == 24: #  hour             # <<<<<<<<<<<<<<
 *         return val * 730_485 // 1_000 + offset  # val * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute
 */
  __pyx_t_1 = (__pyx_v_factor == 24);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2741
 *         return val * 30_436_875 // 1_000_000 + offset  # val * 30.436875
 *     if factor == 24: #  hour
 *         return val * 730_485 // 1_000 + offset  # val * 730.485 (30.436875 * 24)             # <<<<<<<<<<<<<<
 *     if factor == 1_440:  # minute
 *         return val * 438_291 // 10 + offset  # val * 43829.1 (30.436875 * 1440)
 */
    __pyx_r = (__Pyx_div_npy_int64((__pyx_v_val * 0xB2575), 0x3E8) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2740
 *     if factor == 1: #  day
 *         return val * 30_436_875 // 1_000_000 + offset  # val * 30.436875
 *     if factor == 24: #  hour             # <<<<<<<<<<<<<<
 *         return val * 730_485 // 1_000 + offset  # val * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute
 */
  }

  /* "cytimes/utils.pxd":2742
 *     if factor == 24: #  hour
 *         return val * 730_485 // 1_000 + offset  # val * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute             # <<<<<<<<<<<<<<
 *         return val * 438_291 // 10 + offset  # val * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second
 */
  __pyx_t_1 = (__pyx_v_factor == 0x5A0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2743
 *         return val * 730_485 // 1_000 + offset  # val * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute
 *         return val * 438_291 // 10 + offset  # val * 43829.1 (30.436875 * 1440)             # <<<<<<<<<<<<<<
 *     if factor == SS_DAY:  # second
 *         return val * TD64_MM_SECOND + offset
 */
    __pyx_r = (__Pyx_div_npy_int64((__pyx_v_val * 0x6B013), 10) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2742
 *     if factor == 24: #  hour
 *         return val * 730_485 // 1_000 + offset  # val * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute             # <<<<<<<<<<<<<<
 *         return val * 438_291 // 10 + offset  # val * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second
 */
  }

  /* "cytimes/utils.pxd":2744
 *     if factor == 1_440:  # minute
 *         return val * 438_291 // 10 + offset  # val * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second             # <<<<<<<<<<<<<<
 *         return val * TD64_MM_SECOND + offset
 *     if factor == MS_DAY:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_SS_DAY);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2745
 *         return val * 438_291 // 10 + offset  # val * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second
 *         return val * TD64_MM_SECOND + offset             # <<<<<<<<<<<<<<
 *     if factor == MS_DAY:  # millisecond
 *         return val * TD64_MM_MILLISECOND + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_TD64_MM_SECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2744
 *     if factor == 1_440:  # minute
 *         return val * 438_291 // 10 + offset  # val * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second             # <<<<<<<<<<<<<<
 *         return val * TD64_MM_SECOND + offset
 *     if factor == MS_DAY:  # millisecond
 */
  }

  /* "cytimes/utils.pxd":2746
 *     if factor == SS_DAY:  # second
 *         return val * TD64_MM_SECOND + offset
 *     if factor == MS_DAY:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * TD64_MM_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_MS_DAY);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2747
 *         return val * TD64_MM_SECOND + offset
 *     if factor == MS_DAY:  # millisecond
 *         return val * TD64_MM_MILLISECOND + offset             # <<<<<<<<<<<<<<
 *     if factor == US_DAY:  # microsecond
 *         return val * TD64_MM_MICROSECOND + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_TD64_MM_MILLISECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2746
 *     if factor == SS_DAY:  # second
 *         return val * TD64_MM_SECOND + offset
 *     if factor == MS_DAY:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * TD64_MM_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond
 */
  }

  /* "cytimes/utils.pxd":2748
 *     if factor == MS_DAY:  # millisecond
 *         return val * TD64_MM_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond             # <<<<<<<<<<<<<<
 *         return val * TD64_MM_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_US_DAY);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2749
 *         return val * TD64_MM_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond
 *         return val * TD64_MM_MICROSECOND + offset             # <<<<<<<<<<<<<<
 *     if factor == NS_DAY:  # nanosecond
 *         return val * TD64_MM_NANOSECOND + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_TD64_MM_MICROSECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2748
 *     if factor == MS_DAY:  # millisecond
 *         return val * TD64_MM_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond             # <<<<<<<<<<<<<<
 *         return val * TD64_MM_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond
 */
  }

  /* "cytimes/utils.pxd":2750
 *     if factor == US_DAY:  # microsecond
 *         return val * TD64_MM_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val * TD64_MM_NANOSECOND + offset
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_NS_DAY);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2751
 *         return val * TD64_MM_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond
 *         return val * TD64_MM_NANOSECOND + offset             # <<<<<<<<<<<<<<
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 * 
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_TD64_MM_NANOSECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2750
 *     if factor == US_DAY:  # microsecond
 *         return val * TD64_MM_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val * TD64_MM_NANOSECOND + offset
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 */
  }

  /* "cytimes/utils.pxd":2752
 *     if factor == NS_DAY:  # nanosecond
 *         return val * TD64_MM_NANOSECOND + offset
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.npy_int64 _td64_W_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unsupported_factor_d_for_timedel_2, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(0, 2752, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils._td64_M_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__td64_W_as_int64_D(npy_int64 __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils__td64_W_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_r;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "cytimes/utils.pxd":2756
 * cdef inline np.npy_int64 _td64_W_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):
 *     """(internal) Convert the value of np.timedelta[W] to int64 under 'D' resolution `<'int'>`."""
 *     return val * 7 * factor + offset             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta td64_to_td(object td64):
 */
  __pyx_r = (((__pyx_v_val * 7) * __pyx_v_factor) + __pyx_v_offset);
  goto __pyx_L0;

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

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

/* "cytimes/utils.pxd":2758
 *     return val * 7 * factor + offset
 * 
 * cdef inline datetime.timedelta td64_to_td(object td64):             # <<<<<<<<<<<<<<
 *     """Convert np.timedelta64 to timedelta `<'datetime.timedelta'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_td64_to_td(PyObject *__pyx_v_td64) {
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  npy_int64 __pyx_t_1;
  struct __pyx_opt_args_7cytimes_5utils_td64_as_int64_us __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td64_to_td", 1);

  /* "cytimes/utils.pxd":2765
 *     >>> datetime.timedelta(microseconds=int(us))
 *     """
 *     return td_fr_us(td64_as_int64_us(td64, 0))             # <<<<<<<<<<<<<<
 * 
 * # NumPy: ndarray ---------------------------------------------------------------------------------------
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = __pyx_f_7cytimes_5utils_td64_as_int64_us(__pyx_v_td64, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((npy_int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 2765, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_td_fr_us(__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2758
 *     return val * 7 * factor + offset
 * 
 * cdef inline datetime.timedelta td64_to_td(object td64):             # <<<<<<<<<<<<<<
 *     """Convert np.timedelta64 to timedelta `<'datetime.timedelta'>`.
 * 
 */

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

/* "cytimes/utils.pxd":2769
 * # NumPy: ndarray ---------------------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_arr(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of np.ndarray `<'bool'>`.
 * 
 */

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

  /* "cytimes/utils.pxd":2775
 *     >>> isinstance(obj, np.ndarray)
 *     """
 *     return np.PyArray_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * # . dtype
 */
  __pyx_r = PyArray_Check(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2769
 * # NumPy: ndarray ---------------------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_arr(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of np.ndarray `<'bool'>`.
 * 
 */

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

/* "cytimes/utils.pxd":2778
 * 
 * # . dtype
 * cdef inline np.ndarray arr_assure_int64(np.ndarray arr):             # <<<<<<<<<<<<<<
 *     """Assure the given ndarray is dtype of 'int64' `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_assure_int64(PyArrayObject *__pyx_v_arr) {
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_assure_int64", 1);

  /* "cytimes/utils.pxd":2783
 *     Automatically cast the 'arr' to 'int64' if not the correct dtype.
 *     """
 *     if np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_INT64:             # <<<<<<<<<<<<<<
 *         return arr
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 */
  __pyx_t_1 = (PyArray_TYPE(__pyx_v_arr) == NPY_INT64);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2784
 *     """
 *     if np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_INT64:
 *         return arr             # <<<<<<<<<<<<<<
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 * 
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2783
 *     Automatically cast the 'arr' to 'int64' if not the correct dtype.
 *     """
 *     if np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_INT64:             # <<<<<<<<<<<<<<
 *         return arr
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 */
  }

  /* "cytimes/utils.pxd":2785
 *     if np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_INT64:
 *         return arr
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_assure_int64_like(np.ndarray arr):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2785, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2778
 * 
 * # . dtype
 * cdef inline np.ndarray arr_assure_int64(np.ndarray arr):             # <<<<<<<<<<<<<<
 *     """Assure the given ndarray is dtype of 'int64' `<'ndarray[int64]'>`.
 * 
 */

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

/* "cytimes/utils.pxd":2787
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 * 
 * cdef inline np.ndarray arr_assure_int64_like(np.ndarray arr):             # <<<<<<<<<<<<<<
 *     """Assure the given ndarray is dtype of [int64/datetime64/timedelta64] `<'ndarray'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_assure_int64_like(PyArrayObject *__pyx_v_arr) {
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_assure_int64_like", 1);

  /* "cytimes/utils.pxd":2794
 *     Automatically cast the 'arr' to 'int64' if not the correct dtype.
 *     """
 *     if np.PyArray_TYPE(arr) in (             # <<<<<<<<<<<<<<
 *         np.NPY_TYPES.NPY_INT64,
 *         np.NPY_TYPES.NPY_DATETIME,
 */
  __pyx_t_1 = PyArray_TYPE(__pyx_v_arr);

  /* "cytimes/utils.pxd":2795
 *     """
 *     if np.PyArray_TYPE(arr) in (
 *         np.NPY_TYPES.NPY_INT64,             # <<<<<<<<<<<<<<
 *         np.NPY_TYPES.NPY_DATETIME,
 *         np.NPY_TYPES.NPY_TIMEDELTA,
 */
  __pyx_t_3 = (__pyx_t_1 == NPY_INT64);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cytimes/utils.pxd":2794
 *     Automatically cast the 'arr' to 'int64' if not the correct dtype.
 *     """
 *     if np.PyArray_TYPE(arr) in (             # <<<<<<<<<<<<<<
 *         np.NPY_TYPES.NPY_INT64,
 *         np.NPY_TYPES.NPY_DATETIME,
 */
  __pyx_t_3 = (__pyx_t_1 == NPY_DATETIME);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cytimes/utils.pxd":2797
 *         np.NPY_TYPES.NPY_INT64,
 *         np.NPY_TYPES.NPY_DATETIME,
 *         np.NPY_TYPES.NPY_TIMEDELTA,             # <<<<<<<<<<<<<<
 *     ):
 *         return arr
 */
  __pyx_t_3 = (__pyx_t_1 == NPY_TIMEDELTA);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;

  /* "cytimes/utils.pxd":2794
 *     Automatically cast the 'arr' to 'int64' if not the correct dtype.
 *     """
 *     if np.PyArray_TYPE(arr) in (             # <<<<<<<<<<<<<<
 *         np.NPY_TYPES.NPY_INT64,
 *         np.NPY_TYPES.NPY_DATETIME,
 */
  __pyx_t_3 = __pyx_t_2;
  if (__pyx_t_3) {

    /* "cytimes/utils.pxd":2799
 *         np.NPY_TYPES.NPY_TIMEDELTA,
 *     ):
 *         return arr             # <<<<<<<<<<<<<<
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 * 
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2794
 *     Automatically cast the 'arr' to 'int64' if not the correct dtype.
 *     """
 *     if np.PyArray_TYPE(arr) in (             # <<<<<<<<<<<<<<
 *         np.NPY_TYPES.NPY_INT64,
 *         np.NPY_TYPES.NPY_DATETIME,
 */
  }

  /* "cytimes/utils.pxd":2800
 *     ):
 *         return arr
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_assure_float64(np.ndarray arr):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_4 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2800, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2787
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 * 
 * cdef inline np.ndarray arr_assure_int64_like(np.ndarray arr):             # <<<<<<<<<<<<<<
 *     """Assure the given ndarray is dtype of [int64/datetime64/timedelta64] `<'ndarray'>`.
 * 
 */

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

/* "cytimes/utils.pxd":2802
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 * 
 * cdef inline np.ndarray arr_assure_float64(np.ndarray arr):             # <<<<<<<<<<<<<<
 *     """Assure the given ndarray is dtype of 'float64' `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_assure_float64(PyArrayObject *__pyx_v_arr) {
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_assure_float64", 1);

  /* "cytimes/utils.pxd":2807
 *     Automatically cast the 'arr' to 'flaot64' if not the correct dtype.
 *     """
 *     if np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_FLOAT64:             # <<<<<<<<<<<<<<
 *         return arr
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_FLOAT64)
 */
  __pyx_t_1 = (PyArray_TYPE(__pyx_v_arr) == NPY_FLOAT64);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2808
 *     """
 *     if np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_FLOAT64:
 *         return arr             # <<<<<<<<<<<<<<
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_FLOAT64)
 * 
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2807
 *     Automatically cast the 'arr' to 'flaot64' if not the correct dtype.
 *     """
 *     if np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_FLOAT64:             # <<<<<<<<<<<<<<
 *         return arr
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_FLOAT64)
 */
  }

  /* "cytimes/utils.pxd":2809
 *     if np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_FLOAT64:
 *         return arr
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_FLOAT64)             # <<<<<<<<<<<<<<
 * 
 * # . create
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = PyArray_Cast(__pyx_v_arr, NPY_FLOAT64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2809, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2802
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 * 
 * cdef inline np.ndarray arr_assure_float64(np.ndarray arr):             # <<<<<<<<<<<<<<
 *     """Assure the given ndarray is dtype of 'float64' `<'ndarray[int64]'>`.
 * 
 */

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

/* "cytimes/utils.pxd":2812
 * 
 * # . create
 * cdef inline np.ndarray arr_zero_int64(np.npy_int64 size):             # <<<<<<<<<<<<<<
 *     """Create an 1-dimensional ndarray[int64] filled with zero `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_zero_int64(npy_int64 __pyx_v_size) {
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  npy_intp __pyx_t_3[1];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_zero_int64", 1);

  /* "cytimes/utils.pxd":2819
 *     """
 *     # Validate
 *     if size < 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("ndarray size must be an integer greater than 0.")
 * 
 */
  __pyx_t_1 = (__pyx_v_size < 1);
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":2820
 *     # Validate
 *     if size < 1:
 *         raise ValueError("ndarray size must be an integer greater than 0.")             # <<<<<<<<<<<<<<
 * 
 *     # New array
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2820, __pyx_L1_error)

    /* "cytimes/utils.pxd":2819
 *     """
 *     # Validate
 *     if size < 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("ndarray size must be an integer greater than 0.")
 * 
 */
  }

  /* "cytimes/utils.pxd":2823
 * 
 *     # New array
 *     return np.PyArray_ZEROS(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_full_int64(np.npy_int64 value, np.npy_int64 size):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_2 = PyArray_ZEROS(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2823, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2812
 * 
 * # . create
 * cdef inline np.ndarray arr_zero_int64(np.npy_int64 size):             # <<<<<<<<<<<<<<
 *     """Create an 1-dimensional ndarray[int64] filled with zero `<'ndarray[int64]'>`.
 * 
 */

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

/* "cytimes/utils.pxd":2825
 *     return np.PyArray_ZEROS(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 * 
 * cdef inline np.ndarray arr_full_int64(np.npy_int64 value, np.npy_int64 size):             # <<<<<<<<<<<<<<
 *     """Create a new 1-dimensional ndarray[int64] filled with 'value' `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_full_int64(npy_int64 __pyx_v_value, npy_int64 __pyx_v_size) {
  PyArrayObject *__pyx_v_arr = 0;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_full_int64", 1);

  /* "cytimes/utils.pxd":2832
 *     """
 *     # Fast-path
 *     if value == 0:             # <<<<<<<<<<<<<<
 *         return arr_zero_int64(size)
 * 
 */
  __pyx_t_1 = (__pyx_v_value == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":2833
 *     # Fast-path
 *     if value == 0:
 *         return arr_zero_int64(size)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_zero_int64(__pyx_v_size)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":2832
 *     """
 *     # Fast-path
 *     if value == 0:             # <<<<<<<<<<<<<<
 *         return arr_zero_int64(size)
 * 
 */
  }

  /* "cytimes/utils.pxd":2836
 * 
 *     # Validate
 *     if size < 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("ndarray size must be an integer greater than 0.")
 * 
 */
  __pyx_t_1 = (__pyx_v_size < 1);
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":2837
 *     # Validate
 *     if size < 1:
 *         raise ValueError("ndarray size must be an integer greater than 0.")             # <<<<<<<<<<<<<<
 * 
 *     # New array
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2837, __pyx_L1_error)

    /* "cytimes/utils.pxd":2836
 * 
 *     # Validate
 *     if size < 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("ndarray size must be an integer greater than 0.")
 * 
 */
  }

  /* "cytimes/utils.pxd":2841
 *     # New array
 *     cdef:
 *         np.ndarray arr = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2841, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":2842
 *     cdef:
 *         np.ndarray arr = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":2845
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         arr_ptr[i] = value
 *     return arr
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":2846
 * 
 *     for i in range(size):
 *         arr_ptr[i] = value             # <<<<<<<<<<<<<<
 *     return arr
 * 
 */
    (__pyx_v_arr_ptr[__pyx_v_i]) = __pyx_v_value;
  }

  /* "cytimes/utils.pxd":2847
 *     for i in range(size):
 *         arr_ptr[i] = value
 *     return arr             # <<<<<<<<<<<<<<
 * 
 * # . range
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __pyx_r = __pyx_v_arr;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":2825
 *     return np.PyArray_ZEROS(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 * 
 * cdef inline np.ndarray arr_full_int64(np.npy_int64 value, np.npy_int64 size):             # <<<<<<<<<<<<<<
 *     """Create a new 1-dimensional ndarray[int64] filled with 'value' `<'ndarray[int64]'>`.
 * 
 */

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_clip(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_minimum, npy_int64 __pyx_v_maximum, struct __pyx_opt_args_7cytimes_5utils_arr_clip *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_v;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2[1];
  npy_int64 __pyx_t_3;
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_clip", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":2860
 *     """
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":2864
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":2865
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_2[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_2, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2865, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":2866
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i, v
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":2867
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, v
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":2870
 *         np.npy_int64 i, v
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         v = arr_ptr[i]
 *         if v > maximum:
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "cytimes/utils.pxd":2871
 * 
 *     for i in range(size):
 *         v = arr_ptr[i]             # <<<<<<<<<<<<<<
 *         if v > maximum:
 *             v = maximum
 */
    __pyx_v_v = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "cytimes/utils.pxd":2872
 *     for i in range(size):
 *         v = arr_ptr[i]
 *         if v > maximum:             # <<<<<<<<<<<<<<
 *             v = maximum
 *         elif v < minimum:
 */
    __pyx_t_6 = (__pyx_v_v > __pyx_v_maximum);
    if (__pyx_t_6) {

      /* "cytimes/utils.pxd":2873
 *         v = arr_ptr[i]
 *         if v > maximum:
 *             v = maximum             # <<<<<<<<<<<<<<
 *         elif v < minimum:
 *             v = minimum
 */
      __pyx_v_v = __pyx_v_maximum;

      /* "cytimes/utils.pxd":2872
 *     for i in range(size):
 *         v = arr_ptr[i]
 *         if v > maximum:             # <<<<<<<<<<<<<<
 *             v = maximum
 *         elif v < minimum:
 */
      goto __pyx_L5;
    }

    /* "cytimes/utils.pxd":2874
 *         if v > maximum:
 *             v = maximum
 *         elif v < minimum:             # <<<<<<<<<<<<<<
 *             v = minimum
 *         res_ptr[i] = v + offset
 */
    __pyx_t_6 = (__pyx_v_v < __pyx_v_minimum);
    if (__pyx_t_6) {

      /* "cytimes/utils.pxd":2875
 *             v = maximum
 *         elif v < minimum:
 *             v = minimum             # <<<<<<<<<<<<<<
 *         res_ptr[i] = v + offset
 *     return res
 */
      __pyx_v_v = __pyx_v_minimum;

      /* "cytimes/utils.pxd":2874
 *         if v > maximum:
 *             v = maximum
 *         elif v < minimum:             # <<<<<<<<<<<<<<
 *             v = minimum
 *         res_ptr[i] = v + offset
 */
    }
    __pyx_L5:;

    /* "cytimes/utils.pxd":2876
 *         elif v < minimum:
 *             v = minimum
 *         res_ptr[i] = v + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_v_v + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":2877
 *             v = minimum
 *         res_ptr[i] = v + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_min(np.ndarray arr, np.npy_int64 value, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_min(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_value, struct __pyx_opt_args_7cytimes_5utils_arr_min *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2[1];
  npy_int64 __pyx_t_3;
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_min", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":2889
 *     """
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":2893
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":2894
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_2[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_2, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2894, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":2895
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":2896
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":2899
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = min(arr_ptr[i], value) + offset
 *     return res
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "cytimes/utils.pxd":2900
 * 
 *     for i in range(size):
 *         res_ptr[i] = min(arr_ptr[i], value) + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_6 = __pyx_v_value;
    __pyx_t_7 = (__pyx_v_arr_ptr[__pyx_v_i]);
    __pyx_t_9 = (__pyx_t_6 < __pyx_t_7);
    if (__pyx_t_9) {
      __pyx_t_8 = __pyx_t_6;
    } else {
      __pyx_t_8 = __pyx_t_7;
    }
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_t_8 + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":2901
 *     for i in range(size):
 *         res_ptr[i] = min(arr_ptr[i], value) + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_max(np.ndarray arr, np.npy_int64 value, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_max(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_value, struct __pyx_opt_args_7cytimes_5utils_arr_max *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2[1];
  npy_int64 __pyx_t_3;
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_max", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":2913
 *     """
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":2917
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":2918
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_2[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_2, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2918, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":2919
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":2920
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":2923
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = max(arr_ptr[i], value) + offset
 *     return res
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "cytimes/utils.pxd":2924
 * 
 *     for i in range(size):
 *         res_ptr[i] = max(arr_ptr[i], value) + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_6 = __pyx_v_value;
    __pyx_t_7 = (__pyx_v_arr_ptr[__pyx_v_i]);
    __pyx_t_9 = (__pyx_t_6 > __pyx_t_7);
    if (__pyx_t_9) {
      __pyx_t_8 = __pyx_t_6;
    } else {
      __pyx_t_8 = __pyx_t_7;
    }
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_t_8 + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":2925
 *     for i in range(size):
 *         res_ptr[i] = max(arr_ptr[i], value) + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_min_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_min_arr(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2, struct __pyx_opt_args_7cytimes_5utils_arr_min_arr *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr1_ptr;
  npy_int64 *__pyx_v_arr2_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  npy_int64 __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_min_arr", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr1);
  __Pyx_INCREF((PyObject *)__pyx_v_arr2);

  /* "cytimes/utils.pxd":2937
 *     """
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]             # <<<<<<<<<<<<<<
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr1)[0]);

  /* "cytimes/utils.pxd":2938
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  __pyx_t_1 = (__pyx_v_size != (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr2)[0]));
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":2939
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot compare ndarrays with different shapes.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2939, __pyx_L1_error)

    /* "cytimes/utils.pxd":2938
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  }

  /* "cytimes/utils.pxd":2940
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)             # <<<<<<<<<<<<<<
 *     arr2 = arr_assure_int64_like(arr2)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr1, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":2941
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr2, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":2945
 *     # Compute
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2945, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":2946
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":2947
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 *         np.npy_int64 i
 */
  __pyx_v_arr1_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr1));

  /* "cytimes/utils.pxd":2948
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr2_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr2));

  /* "cytimes/utils.pxd":2951
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = min(arr1_ptr[i], arr2_ptr[i]) + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":2952
 * 
 *     for i in range(size):
 *         res_ptr[i] = min(arr1_ptr[i], arr2_ptr[i]) + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_7 = (__pyx_v_arr2_ptr[__pyx_v_i]);
    __pyx_t_8 = (__pyx_v_arr1_ptr[__pyx_v_i]);
    __pyx_t_1 = (__pyx_t_7 < __pyx_t_8);
    if (__pyx_t_1) {
      __pyx_t_9 = __pyx_t_7;
    } else {
      __pyx_t_9 = __pyx_t_8;
    }
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_t_9 + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":2953
 *     for i in range(size):
 *         res_ptr[i] = min(arr1_ptr[i], arr2_ptr[i]) + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_max_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_max_arr(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2, struct __pyx_opt_args_7cytimes_5utils_arr_max_arr *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr1_ptr;
  npy_int64 *__pyx_v_arr2_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  npy_int64 __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_max_arr", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr1);
  __Pyx_INCREF((PyObject *)__pyx_v_arr2);

  /* "cytimes/utils.pxd":2965
 *     """
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]             # <<<<<<<<<<<<<<
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr1)[0]);

  /* "cytimes/utils.pxd":2966
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  __pyx_t_1 = (__pyx_v_size != (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr2)[0]));
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":2967
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot compare ndarrays with different shapes.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2967, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2967, __pyx_L1_error)

    /* "cytimes/utils.pxd":2966
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  }

  /* "cytimes/utils.pxd":2968
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)             # <<<<<<<<<<<<<<
 *     arr2 = arr_assure_int64_like(arr2)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr1, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":2969
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr2, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":2973
 *     # Compute
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2973, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":2974
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":2975
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 *         np.npy_int64 i
 */
  __pyx_v_arr1_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr1));

  /* "cytimes/utils.pxd":2976
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr2_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr2));

  /* "cytimes/utils.pxd":2979
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = max(arr1_ptr[i], arr2_ptr[i]) + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":2980
 * 
 *     for i in range(size):
 *         res_ptr[i] = max(arr1_ptr[i], arr2_ptr[i]) + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_7 = (__pyx_v_arr2_ptr[__pyx_v_i]);
    __pyx_t_8 = (__pyx_v_arr1_ptr[__pyx_v_i]);
    __pyx_t_1 = (__pyx_t_7 > __pyx_t_8);
    if (__pyx_t_1) {
      __pyx_t_9 = __pyx_t_7;
    } else {
      __pyx_t_9 = __pyx_t_8;
    }
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_t_9 + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":2981
 *     for i in range(size):
 *         res_ptr[i] = max(arr1_ptr[i], arr2_ptr[i]) + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * # . arithmetic
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_abs(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_arr_abs *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_v;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2[1];
  npy_int64 __pyx_t_3;
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_abs", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":2994
 *     """
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":2998
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":2999
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_2[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_2, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2999, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3000
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i, v
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3001
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, v
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3004
 *         np.npy_int64 i, v
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         v = arr_ptr[i]
 *         if v < 0:
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "cytimes/utils.pxd":3005
 * 
 *     for i in range(size):
 *         v = arr_ptr[i]             # <<<<<<<<<<<<<<
 *         if v < 0:
 *             res_ptr[i] = -v + offset
 */
    __pyx_v_v = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "cytimes/utils.pxd":3006
 *     for i in range(size):
 *         v = arr_ptr[i]
 *         if v < 0:             # <<<<<<<<<<<<<<
 *             res_ptr[i] = -v + offset
 *         else:
 */
    __pyx_t_6 = (__pyx_v_v < 0);
    if (__pyx_t_6) {

      /* "cytimes/utils.pxd":3007
 *         v = arr_ptr[i]
 *         if v < 0:
 *             res_ptr[i] = -v + offset             # <<<<<<<<<<<<<<
 *         else:
 *             res_ptr[i] = v + offset
 */
      (__pyx_v_res_ptr[__pyx_v_i]) = ((-__pyx_v_v) + __pyx_v_offset);

      /* "cytimes/utils.pxd":3006
 *     for i in range(size):
 *         v = arr_ptr[i]
 *         if v < 0:             # <<<<<<<<<<<<<<
 *             res_ptr[i] = -v + offset
 *         else:
 */
      goto __pyx_L5;
    }

    /* "cytimes/utils.pxd":3009
 *             res_ptr[i] = -v + offset
 *         else:
 *             res_ptr[i] = v + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    /*else*/ {
      (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_v_v + __pyx_v_offset);
    }
    __pyx_L5:;
  }

  /* "cytimes/utils.pxd":3010
 *         else:
 *             res_ptr[i] = v + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_add(np.ndarray arr, np.npy_int64 value):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

/* "cytimes/utils.pxd":3012
 *     return res
 * 
 * cdef inline np.ndarray arr_add(np.ndarray arr, np.npy_int64 value):             # <<<<<<<<<<<<<<
 *     """Add the value to the ndarray `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_add(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_value) {
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_add", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3022
 *     """
 *     # Fast-path
 *     if value == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  __pyx_t_1 = (__pyx_v_value == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3023
 *     # Fast-path
 *     if value == 0:
 *         return arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3023, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":3022
 *     """
 *     # Fast-path
 *     if value == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  }

  /* "cytimes/utils.pxd":3026
 * 
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":3030
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3031
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3031, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":3032
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3033
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3036
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] + value
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3037
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] + value             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_value);
  }

  /* "cytimes/utils.pxd":3038
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] + value
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":3012
 *     return res
 * 
 * cdef inline np.ndarray arr_add(np.ndarray arr, np.npy_int64 value):             # <<<<<<<<<<<<<<
 *     """Add the value to the ndarray `<'ndarray[int64]'>`.
 * 
 */

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_mul(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_arr_mul *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_mul", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3050
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  __pyx_t_2 = (__pyx_v_factor == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_offset == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3051
 *     # Fast-path
 *     if factor == 1 and offset == 0:
 *         return arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3051, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":3050
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  }

  /* "cytimes/utils.pxd":3054
 * 
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":3058
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3059
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_4[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3059, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":3060
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3061
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3064
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] * factor + offset
 *     return res
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "cytimes/utils.pxd":3065
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] * factor + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (((__pyx_v_arr_ptr[__pyx_v_i]) * __pyx_v_factor) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3066
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] * factor + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_div(np.ndarray arr, np.npy_float64 factor, np.npy_float64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_div(PyArrayObject *__pyx_v_arr, npy_float64 __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_arr_div *__pyx_optional_args) {
  npy_float64 __pyx_v_offset = ((npy_float64)0.0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_float64 *__pyx_v_res_ptr;
  npy_float64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_div", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3079
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_float64(arr)
 * 
 */
  __pyx_t_2 = (__pyx_v_factor == 1.0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_offset == 0.0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3080
 *     # Fast-path
 *     if factor == 1 and offset == 0:
 *         return arr_assure_float64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_float64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3080, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":3079
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_float64(arr)
 * 
 */
  }

  /* "cytimes/utils.pxd":3083
 * 
 *     # Validate
 *     arr = arr_assure_float64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_float64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":3087
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_FLOAT64, 0)
 *         np.npy_float64* res_ptr = <np.npy_float64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3088
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_FLOAT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_float64* res_ptr = <np.npy_float64*> np.PyArray_DATA(res)
 *         np.npy_float64* arr_ptr = <np.npy_float64*> np.PyArray_DATA(arr)
 */
  __pyx_t_4[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_4, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3088, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":3089
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_FLOAT64, 0)
 *         np.npy_float64* res_ptr = <np.npy_float64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_float64* arr_ptr = <np.npy_float64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_float64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3090
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_FLOAT64, 0)
 *         np.npy_float64* res_ptr = <np.npy_float64*> np.PyArray_DATA(res)
 *         np.npy_float64* arr_ptr = <np.npy_float64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_float64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3094
 * 
 *     with cython.cdivision(True):
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             res_ptr[i] = arr_ptr[i] / factor + offset
 *     return res
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "cytimes/utils.pxd":3095
 *     with cython.cdivision(True):
 *         for i in range(size):
 *             res_ptr[i] = arr_ptr[i] / factor + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (((__pyx_v_arr_ptr[__pyx_v_i]) / __pyx_v_factor) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3096
 *         for i in range(size):
 *             res_ptr[i] = arr_ptr[i] / factor + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_mod(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_mod(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_arr_mod *__pyx_optional_args) {
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  int __pyx_v_neg_f;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_r;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_mod", 0);
  if (__pyx_optional_args) {
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3110
 *     """
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero in 'arr_mod()'.")
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3111
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero in 'arr_mod()'.")
 * 
 */
  __pyx_t_2 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_2)) {

    /* "cytimes/utils.pxd":3112
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero in 'arr_mod()'.")             # <<<<<<<<<<<<<<
 * 
 *     # Prepare for computation
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 3112, __pyx_L1_error)

    /* "cytimes/utils.pxd":3111
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero in 'arr_mod()'.")
 * 
 */
  }

  /* "cytimes/utils.pxd":3116
 *     # Prepare for computation
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3117
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3117, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3118
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3119
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         bint neg_f = factor < 0
 *         np.npy_int64 i, r
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3120
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, r
 * 
 */
  __pyx_v_neg_f = (__pyx_v_factor < 0);

  /* "cytimes/utils.pxd":3124
 * 
 *     with cython.cdivision(True):
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             r = arr_ptr[i] % factor
 *             if r != 0:
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3125
 *     with cython.cdivision(True):
 *         for i in range(size):
 *             r = arr_ptr[i] % factor             # <<<<<<<<<<<<<<
 *             if r != 0:
 *                 if not neg_f:
 */
    __pyx_v_r = ((__pyx_v_arr_ptr[__pyx_v_i]) % __pyx_v_factor);

    /* "cytimes/utils.pxd":3126
 *         for i in range(size):
 *             r = arr_ptr[i] % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if r < 0:
 */
    __pyx_t_2 = (__pyx_v_r != 0);
    if (__pyx_t_2) {

      /* "cytimes/utils.pxd":3127
 *             r = arr_ptr[i] % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if r < 0:
 *                         r += factor
 */
      __pyx_t_2 = (!__pyx_v_neg_f);
      if (__pyx_t_2) {

        /* "cytimes/utils.pxd":3128
 *             if r != 0:
 *                 if not neg_f:
 *                     if r < 0:             # <<<<<<<<<<<<<<
 *                         r += factor
 *                 else:
 */
        __pyx_t_2 = (__pyx_v_r < 0);
        if (__pyx_t_2) {

          /* "cytimes/utils.pxd":3129
 *                 if not neg_f:
 *                     if r < 0:
 *                         r += factor             # <<<<<<<<<<<<<<
 *                 else:
 *                     if r > 0:
 */
          __pyx_v_r = (__pyx_v_r + __pyx_v_factor);

          /* "cytimes/utils.pxd":3128
 *             if r != 0:
 *                 if not neg_f:
 *                     if r < 0:             # <<<<<<<<<<<<<<
 *                         r += factor
 *                 else:
 */
        }

        /* "cytimes/utils.pxd":3127
 *             r = arr_ptr[i] % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if r < 0:
 *                         r += factor
 */
        goto __pyx_L7;
      }

      /* "cytimes/utils.pxd":3131
 *                         r += factor
 *                 else:
 *                     if r > 0:             # <<<<<<<<<<<<<<
 *                         r += factor
 *             res_ptr[i] = r
 */
      /*else*/ {
        __pyx_t_2 = (__pyx_v_r > 0);
        if (__pyx_t_2) {

          /* "cytimes/utils.pxd":3132
 *                 else:
 *                     if r > 0:
 *                         r += factor             # <<<<<<<<<<<<<<
 *             res_ptr[i] = r
 *     return res
 */
          __pyx_v_r = (__pyx_v_r + __pyx_v_factor);

          /* "cytimes/utils.pxd":3131
 *                         r += factor
 *                 else:
 *                     if r > 0:             # <<<<<<<<<<<<<<
 *                         r += factor
 *             res_ptr[i] = r
 */
        }
      }
      __pyx_L7:;

      /* "cytimes/utils.pxd":3126
 *         for i in range(size):
 *             r = arr_ptr[i] % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if r < 0:
 */
    }

    /* "cytimes/utils.pxd":3133
 *                     if r > 0:
 *                         r += factor
 *             res_ptr[i] = r             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_v_r;
  }

  /* "cytimes/utils.pxd":3134
 *                         r += factor
 *             res_ptr[i] = r
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_round_div(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_round_div(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_arr_round_div *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  int __pyx_v_neg_f;
  npy_int64 __pyx_v_abs_f;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_n;
  npy_int64 __pyx_v_q;
  npy_int64 __pyx_v_r;
  npy_int64 __pyx_v_abs_r;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_round_div", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3148
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  __pyx_t_2 = (__pyx_v_factor == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_offset == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3149
 *     # Fast-path
 *     if factor == 1 and offset == 0:
 *         return arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":3148
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  }

  /* "cytimes/utils.pxd":3152
 * 
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.arr_round_div()'.")
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":3153
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.arr_round_div()'.")
 * 
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":3154
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.arr_round_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 3154, __pyx_L1_error)

    /* "cytimes/utils.pxd":3153
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.arr_round_div()'.")
 * 
 */
  }

  /* "cytimes/utils.pxd":3158
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3159
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_4[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3159, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":3160
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3161
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         bint neg_f = factor < 0
 *         np.npy_int64 abs_f = -factor if neg_f else factor
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3162
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0             # <<<<<<<<<<<<<<
 *         np.npy_int64 abs_f = -factor if neg_f else factor
 *         np.npy_int64 i, n, q, r, abs_r
 */
  __pyx_v_neg_f = (__pyx_v_factor < 0);

  /* "cytimes/utils.pxd":3163
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0
 *         np.npy_int64 abs_f = -factor if neg_f else factor             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, n, q, r, abs_r
 * 
 */
  if (__pyx_v_neg_f) {
    __pyx_t_5 = (-__pyx_v_factor);
  } else {
    __pyx_t_5 = __pyx_v_factor;
  }
  __pyx_v_abs_f = __pyx_t_5;

  /* "cytimes/utils.pxd":3167
 * 
 *     with cython.cdivision(True):
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             n = arr_ptr[i]
 *             q = n // factor
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "cytimes/utils.pxd":3168
 *     with cython.cdivision(True):
 *         for i in range(size):
 *             n = arr_ptr[i]             # <<<<<<<<<<<<<<
 *             q = n // factor
 *             r = n % factor
 */
    __pyx_v_n = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "cytimes/utils.pxd":3169
 *         for i in range(size):
 *             n = arr_ptr[i]
 *             q = n // factor             # <<<<<<<<<<<<<<
 *             r = n % factor
 *             abs_r = -r if r < 0 else r
 */
    __pyx_v_q = (__pyx_v_n / __pyx_v_factor);

    /* "cytimes/utils.pxd":3170
 *             n = arr_ptr[i]
 *             q = n // factor
 *             r = n % factor             # <<<<<<<<<<<<<<
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:
 */
    __pyx_v_r = (__pyx_v_n % __pyx_v_factor);

    /* "cytimes/utils.pxd":3171
 *             q = n // factor
 *             r = n % factor
 *             abs_r = -r if r < 0 else r             # <<<<<<<<<<<<<<
 *             if abs_r * 2 >= abs_f:
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):
 */
    __pyx_t_1 = (__pyx_v_r < 0);
    if (__pyx_t_1) {
      __pyx_t_8 = (-__pyx_v_r);
    } else {
      __pyx_t_8 = __pyx_v_r;
    }
    __pyx_v_abs_r = __pyx_t_8;

    /* "cytimes/utils.pxd":3172
 *             r = n % factor
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:             # <<<<<<<<<<<<<<
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):
 *                     q += 1
 */
    __pyx_t_1 = ((__pyx_v_abs_r * 2) >= __pyx_v_abs_f);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":3173
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):             # <<<<<<<<<<<<<<
 *                     q += 1
 *                 else:
 */
      __pyx_t_2 = (!__pyx_v_neg_f);
      if (!__pyx_t_2) {
        goto __pyx_L12_next_or;
      } else {
      }
      __pyx_t_2 = (__pyx_v_n >= 0);
      if (!__pyx_t_2) {
      } else {
        __pyx_t_1 = __pyx_t_2;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_L12_next_or:;
      if (__pyx_v_neg_f) {
      } else {
        __pyx_t_1 = __pyx_v_neg_f;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_2 = (__pyx_v_n < 0);
      __pyx_t_1 = __pyx_t_2;
      __pyx_L11_bool_binop_done:;
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":3174
 *             if abs_r * 2 >= abs_f:
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):
 *                     q += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     q -= 1
 */
        __pyx_v_q = (__pyx_v_q + 1);

        /* "cytimes/utils.pxd":3173
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):             # <<<<<<<<<<<<<<
 *                     q += 1
 *                 else:
 */
        goto __pyx_L10;
      }

      /* "cytimes/utils.pxd":3176
 *                     q += 1
 *                 else:
 *                     q -= 1             # <<<<<<<<<<<<<<
 *             res_ptr[i] = q + offset
 *     return res
 */
      /*else*/ {
        __pyx_v_q = (__pyx_v_q - 1);
      }
      __pyx_L10:;

      /* "cytimes/utils.pxd":3172
 *             r = n % factor
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:             # <<<<<<<<<<<<<<
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):
 *                     q += 1
 */
    }

    /* "cytimes/utils.pxd":3177
 *                 else:
 *                     q -= 1
 *             res_ptr[i] = q + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_v_q + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3178
 *                     q -= 1
 *             res_ptr[i] = q + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_ceil_div(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_ceil_div(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_arr_ceil_div *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  int __pyx_v_neg_f;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_n;
  npy_int64 __pyx_v_q;
  npy_int64 __pyx_v_r;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_ceil_div", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3192
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  __pyx_t_2 = (__pyx_v_factor == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_offset == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3193
 *     # Fast-path
 *     if factor == 1 and offset == 0:
 *         return arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":3192
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  }

  /* "cytimes/utils.pxd":3196
 * 
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.arr_ceil_div()'.")
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":3197
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.arr_ceil_div()'.")
 * 
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":3198
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.arr_ceil_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 3198, __pyx_L1_error)

    /* "cytimes/utils.pxd":3197
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.arr_ceil_div()'.")
 * 
 */
  }

  /* "cytimes/utils.pxd":3202
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3203
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_4[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3203, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":3204
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3205
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         bint neg_f = factor < 0
 *         np.npy_int64 i, n, q, r
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3206
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, n, q, r
 * 
 */
  __pyx_v_neg_f = (__pyx_v_factor < 0);

  /* "cytimes/utils.pxd":3210
 * 
 *     with cython.cdivision(True):
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             n = arr_ptr[i]
 *             q = n // factor
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "cytimes/utils.pxd":3211
 *     with cython.cdivision(True):
 *         for i in range(size):
 *             n = arr_ptr[i]             # <<<<<<<<<<<<<<
 *             q = n // factor
 *             r = n % factor
 */
    __pyx_v_n = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "cytimes/utils.pxd":3212
 *         for i in range(size):
 *             n = arr_ptr[i]
 *             q = n // factor             # <<<<<<<<<<<<<<
 *             r = n % factor
 *             if r != 0:
 */
    __pyx_v_q = (__pyx_v_n / __pyx_v_factor);

    /* "cytimes/utils.pxd":3213
 *             n = arr_ptr[i]
 *             q = n // factor
 *             r = n % factor             # <<<<<<<<<<<<<<
 *             if r != 0:
 *                 if not neg_f:
 */
    __pyx_v_r = (__pyx_v_n % __pyx_v_factor);

    /* "cytimes/utils.pxd":3214
 *             q = n // factor
 *             r = n % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if n > 0:
 */
    __pyx_t_1 = (__pyx_v_r != 0);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":3215
 *             r = n % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if n > 0:
 *                         q += 1
 */
      __pyx_t_1 = (!__pyx_v_neg_f);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":3216
 *             if r != 0:
 *                 if not neg_f:
 *                     if n > 0:             # <<<<<<<<<<<<<<
 *                         q += 1
 *                 else:
 */
        __pyx_t_1 = (__pyx_v_n > 0);
        if (__pyx_t_1) {

          /* "cytimes/utils.pxd":3217
 *                 if not neg_f:
 *                     if n > 0:
 *                         q += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     if n < 0:
 */
          __pyx_v_q = (__pyx_v_q + 1);

          /* "cytimes/utils.pxd":3216
 *             if r != 0:
 *                 if not neg_f:
 *                     if n > 0:             # <<<<<<<<<<<<<<
 *                         q += 1
 *                 else:
 */
        }

        /* "cytimes/utils.pxd":3215
 *             r = n % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if n > 0:
 *                         q += 1
 */
        goto __pyx_L10;
      }

      /* "cytimes/utils.pxd":3219
 *                         q += 1
 *                 else:
 *                     if n < 0:             # <<<<<<<<<<<<<<
 *                         q += 1
 *             res_ptr[i] = q + offset
 */
      /*else*/ {
        __pyx_t_1 = (__pyx_v_n < 0);
        if (__pyx_t_1) {

          /* "cytimes/utils.pxd":3220
 *                 else:
 *                     if n < 0:
 *                         q += 1             # <<<<<<<<<<<<<<
 *             res_ptr[i] = q + offset
 *     return res
 */
          __pyx_v_q = (__pyx_v_q + 1);

          /* "cytimes/utils.pxd":3219
 *                         q += 1
 *                 else:
 *                     if n < 0:             # <<<<<<<<<<<<<<
 *                         q += 1
 *             res_ptr[i] = q + offset
 */
        }
      }
      __pyx_L10:;

      /* "cytimes/utils.pxd":3214
 *             q = n // factor
 *             r = n % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if n > 0:
 */
    }

    /* "cytimes/utils.pxd":3221
 *                     if n < 0:
 *                         q += 1
 *             res_ptr[i] = q + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_v_q + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3222
 *                         q += 1
 *             res_ptr[i] = q + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_floor_div(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_floor_div(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_arr_floor_div *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  int __pyx_v_neg_f;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_n;
  npy_int64 __pyx_v_q;
  npy_int64 __pyx_v_r;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_floor_div", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3236
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  __pyx_t_2 = (__pyx_v_factor == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_offset == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3237
 *     # Fast-path
 *     if factor == 1 and offset == 0:
 *         return arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":3236
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  }

  /* "cytimes/utils.pxd":3240
 * 
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.arr_floor_div()'.")
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":3241
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.arr_floor_div()'.")
 * 
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":3242
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.arr_floor_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 3242, __pyx_L1_error)

    /* "cytimes/utils.pxd":3241
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.arr_floor_div()'.")
 * 
 */
  }

  /* "cytimes/utils.pxd":3246
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3247
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_4[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3247, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":3248
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3249
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         bint neg_f = factor < 0
 *         np.npy_int64 i, n, q, r
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3250
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, n, q, r
 * 
 */
  __pyx_v_neg_f = (__pyx_v_factor < 0);

  /* "cytimes/utils.pxd":3254
 * 
 *     with cython.cdivision(True):
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             n = arr_ptr[i]
 *             q = n // factor
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "cytimes/utils.pxd":3255
 *     with cython.cdivision(True):
 *         for i in range(size):
 *             n = arr_ptr[i]             # <<<<<<<<<<<<<<
 *             q = n // factor
 *             r = n % factor
 */
    __pyx_v_n = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "cytimes/utils.pxd":3256
 *         for i in range(size):
 *             n = arr_ptr[i]
 *             q = n // factor             # <<<<<<<<<<<<<<
 *             r = n % factor
 *             if r != 0:
 */
    __pyx_v_q = (__pyx_v_n / __pyx_v_factor);

    /* "cytimes/utils.pxd":3257
 *             n = arr_ptr[i]
 *             q = n // factor
 *             r = n % factor             # <<<<<<<<<<<<<<
 *             if r != 0:
 *                 if not neg_f:
 */
    __pyx_v_r = (__pyx_v_n % __pyx_v_factor);

    /* "cytimes/utils.pxd":3258
 *             q = n // factor
 *             r = n % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if n < 0:
 */
    __pyx_t_1 = (__pyx_v_r != 0);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":3259
 *             r = n % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if n < 0:
 *                         q -= 1
 */
      __pyx_t_1 = (!__pyx_v_neg_f);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":3260
 *             if r != 0:
 *                 if not neg_f:
 *                     if n < 0:             # <<<<<<<<<<<<<<
 *                         q -= 1
 *                 else:
 */
        __pyx_t_1 = (__pyx_v_n < 0);
        if (__pyx_t_1) {

          /* "cytimes/utils.pxd":3261
 *                 if not neg_f:
 *                     if n < 0:
 *                         q -= 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     if n > 0:
 */
          __pyx_v_q = (__pyx_v_q - 1);

          /* "cytimes/utils.pxd":3260
 *             if r != 0:
 *                 if not neg_f:
 *                     if n < 0:             # <<<<<<<<<<<<<<
 *                         q -= 1
 *                 else:
 */
        }

        /* "cytimes/utils.pxd":3259
 *             r = n % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if n < 0:
 *                         q -= 1
 */
        goto __pyx_L10;
      }

      /* "cytimes/utils.pxd":3263
 *                         q -= 1
 *                 else:
 *                     if n > 0:             # <<<<<<<<<<<<<<
 *                         q -= 1
 *             res_ptr[i] = q + offset
 */
      /*else*/ {
        __pyx_t_1 = (__pyx_v_n > 0);
        if (__pyx_t_1) {

          /* "cytimes/utils.pxd":3264
 *                 else:
 *                     if n > 0:
 *                         q -= 1             # <<<<<<<<<<<<<<
 *             res_ptr[i] = q + offset
 *     return res
 */
          __pyx_v_q = (__pyx_v_q - 1);

          /* "cytimes/utils.pxd":3263
 *                         q -= 1
 *                 else:
 *                     if n > 0:             # <<<<<<<<<<<<<<
 *                         q -= 1
 *             res_ptr[i] = q + offset
 */
        }
      }
      __pyx_L10:;

      /* "cytimes/utils.pxd":3258
 *             q = n // factor
 *             r = n % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if n < 0:
 */
    }

    /* "cytimes/utils.pxd":3265
 *                     if n > 0:
 *                         q -= 1
 *             res_ptr[i] = q + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_v_q + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3266
 *                         q -= 1
 *             res_ptr[i] = q + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_round_to_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 multiple = 0, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_round_to_mul(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_arr_round_to_mul *__pyx_optional_args) {
  npy_int64 __pyx_v_multiple = ((npy_int64)0);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  int __pyx_v_neg_f;
  npy_int64 __pyx_v_abs_f;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_n;
  npy_int64 __pyx_v_q;
  npy_int64 __pyx_v_r;
  npy_int64 __pyx_v_abs_r;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_round_to_mul", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_multiple = __pyx_optional_args->multiple;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3282
 *     """
 *     # Fast-path
 *     if factor == 1 and multiple == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  __pyx_t_2 = (__pyx_v_factor == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_multiple == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_offset == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3283
 *     # Fast-path
 *     if factor == 1 and multiple == 1 and offset == 0:
 *         return arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":3282
 *     """
 *     # Fast-path
 *     if factor == 1 and multiple == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  }

  /* "cytimes/utils.pxd":3286
 * 
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot round to multiple 0.")
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":3287
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("cannot round to multiple 0.")
 *     if multiple == 0:
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":3288
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot round to multiple 0.")             # <<<<<<<<<<<<<<
 *     if multiple == 0:
 *         multiple = factor
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 3288, __pyx_L1_error)

    /* "cytimes/utils.pxd":3287
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("cannot round to multiple 0.")
 *     if multiple == 0:
 */
  }

  /* "cytimes/utils.pxd":3289
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot round to multiple 0.")
 *     if multiple == 0:             # <<<<<<<<<<<<<<
 *         multiple = factor
 * 
 */
  __pyx_t_1 = (__pyx_v_multiple == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3290
 *         raise ZeroDivisionError("cannot round to multiple 0.")
 *     if multiple == 0:
 *         multiple = factor             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
    __pyx_v_multiple = __pyx_v_factor;

    /* "cytimes/utils.pxd":3289
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot round to multiple 0.")
 *     if multiple == 0:             # <<<<<<<<<<<<<<
 *         multiple = factor
 * 
 */
  }

  /* "cytimes/utils.pxd":3294
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3295
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_4[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3295, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":3296
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3297
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         bint neg_f = factor < 0
 *         np.npy_int64 abs_f = -factor if neg_f else factor
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3298
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0             # <<<<<<<<<<<<<<
 *         np.npy_int64 abs_f = -factor if neg_f else factor
 *         np.npy_int64 i, n, q, r, abs_r
 */
  __pyx_v_neg_f = (__pyx_v_factor < 0);

  /* "cytimes/utils.pxd":3299
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0
 *         np.npy_int64 abs_f = -factor if neg_f else factor             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, n, q, r, abs_r
 * 
 */
  if (__pyx_v_neg_f) {
    __pyx_t_5 = (-__pyx_v_factor);
  } else {
    __pyx_t_5 = __pyx_v_factor;
  }
  __pyx_v_abs_f = __pyx_t_5;

  /* "cytimes/utils.pxd":3303
 * 
 *     with cython.cdivision(True):
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             n = arr_ptr[i]
 *             q = n // factor
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "cytimes/utils.pxd":3304
 *     with cython.cdivision(True):
 *         for i in range(size):
 *             n = arr_ptr[i]             # <<<<<<<<<<<<<<
 *             q = n // factor
 *             r = n % factor
 */
    __pyx_v_n = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "cytimes/utils.pxd":3305
 *         for i in range(size):
 *             n = arr_ptr[i]
 *             q = n // factor             # <<<<<<<<<<<<<<
 *             r = n % factor
 *             abs_r = -r if r < 0 else r
 */
    __pyx_v_q = (__pyx_v_n / __pyx_v_factor);

    /* "cytimes/utils.pxd":3306
 *             n = arr_ptr[i]
 *             q = n // factor
 *             r = n % factor             # <<<<<<<<<<<<<<
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:
 */
    __pyx_v_r = (__pyx_v_n % __pyx_v_factor);

    /* "cytimes/utils.pxd":3307
 *             q = n // factor
 *             r = n % factor
 *             abs_r = -r if r < 0 else r             # <<<<<<<<<<<<<<
 *             if abs_r * 2 >= abs_f:
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):
 */
    __pyx_t_1 = (__pyx_v_r < 0);
    if (__pyx_t_1) {
      __pyx_t_8 = (-__pyx_v_r);
    } else {
      __pyx_t_8 = __pyx_v_r;
    }
    __pyx_v_abs_r = __pyx_t_8;

    /* "cytimes/utils.pxd":3308
 *             r = n % factor
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:             # <<<<<<<<<<<<<<
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):
 *                     q += 1
 */
    __pyx_t_1 = ((__pyx_v_abs_r * 2) >= __pyx_v_abs_f);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":3309
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):             # <<<<<<<<<<<<<<
 *                     q += 1
 *                 else:
 */
      __pyx_t_2 = (!__pyx_v_neg_f);
      if (!__pyx_t_2) {
        goto __pyx_L14_next_or;
      } else {
      }
      __pyx_t_2 = (__pyx_v_n >= 0);
      if (!__pyx_t_2) {
      } else {
        __pyx_t_1 = __pyx_t_2;
        goto __pyx_L13_bool_binop_done;
      }
      __pyx_L14_next_or:;
      if (__pyx_v_neg_f) {
      } else {
        __pyx_t_1 = __pyx_v_neg_f;
        goto __pyx_L13_bool_binop_done;
      }
      __pyx_t_2 = (__pyx_v_n < 0);
      __pyx_t_1 = __pyx_t_2;
      __pyx_L13_bool_binop_done:;
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":3310
 *             if abs_r * 2 >= abs_f:
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):
 *                     q += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     q -= 1
 */
        __pyx_v_q = (__pyx_v_q + 1);

        /* "cytimes/utils.pxd":3309
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):             # <<<<<<<<<<<<<<
 *                     q += 1
 *                 else:
 */
        goto __pyx_L12;
      }

      /* "cytimes/utils.pxd":3312
 *                     q += 1
 *                 else:
 *                     q -= 1             # <<<<<<<<<<<<<<
 *             res_ptr[i] = q * multiple + offset
 *     return res
 */
      /*else*/ {
        __pyx_v_q = (__pyx_v_q - 1);
      }
      __pyx_L12:;

      /* "cytimes/utils.pxd":3308
 *             r = n % factor
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:             # <<<<<<<<<<<<<<
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):
 *                     q += 1
 */
    }

    /* "cytimes/utils.pxd":3313
 *                 else:
 *                     q -= 1
 *             res_ptr[i] = q * multiple + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__pyx_v_q * __pyx_v_multiple) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3314
 *                     q -= 1
 *             res_ptr[i] = q * multiple + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_ceil_to_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 multiple = 0, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_ceil_to_mul(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_arr_ceil_to_mul *__pyx_optional_args) {
  npy_int64 __pyx_v_multiple = ((npy_int64)0);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  int __pyx_v_neg_f;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_n;
  npy_int64 __pyx_v_q;
  npy_int64 __pyx_v_r;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_ceil_to_mul", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_multiple = __pyx_optional_args->multiple;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3330
 *     """
 *     # Fast-path
 *     if factor == 1 and multiple == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  __pyx_t_2 = (__pyx_v_factor == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_multiple == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_offset == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3331
 *     # Fast-path
 *     if factor == 1 and multiple == 1 and offset == 0:
 *         return arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":3330
 *     """
 *     # Fast-path
 *     if factor == 1 and multiple == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  }

  /* "cytimes/utils.pxd":3334
 * 
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot ceil to multiple 0.")
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":3335
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("cannot ceil to multiple 0.")
 *     if multiple == 0:
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":3336
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot ceil to multiple 0.")             # <<<<<<<<<<<<<<
 *     if multiple == 0:
 *         multiple = factor
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 3336, __pyx_L1_error)

    /* "cytimes/utils.pxd":3335
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("cannot ceil to multiple 0.")
 *     if multiple == 0:
 */
  }

  /* "cytimes/utils.pxd":3337
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot ceil to multiple 0.")
 *     if multiple == 0:             # <<<<<<<<<<<<<<
 *         multiple = factor
 * 
 */
  __pyx_t_1 = (__pyx_v_multiple == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3338
 *         raise ZeroDivisionError("cannot ceil to multiple 0.")
 *     if multiple == 0:
 *         multiple = factor             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
    __pyx_v_multiple = __pyx_v_factor;

    /* "cytimes/utils.pxd":3337
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot ceil to multiple 0.")
 *     if multiple == 0:             # <<<<<<<<<<<<<<
 *         multiple = factor
 * 
 */
  }

  /* "cytimes/utils.pxd":3342
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3343
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_4[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3343, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":3344
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3345
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         bint neg_f = factor < 0
 *         np.npy_int64 i, n, q, r
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3346
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, n, q, r
 * 
 */
  __pyx_v_neg_f = (__pyx_v_factor < 0);

  /* "cytimes/utils.pxd":3350
 * 
 *     with cython.cdivision(True):
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             n = arr_ptr[i]
 *             q = n // factor
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "cytimes/utils.pxd":3351
 *     with cython.cdivision(True):
 *         for i in range(size):
 *             n = arr_ptr[i]             # <<<<<<<<<<<<<<
 *             q = n // factor
 *             r = n % factor
 */
    __pyx_v_n = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "cytimes/utils.pxd":3352
 *         for i in range(size):
 *             n = arr_ptr[i]
 *             q = n // factor             # <<<<<<<<<<<<<<
 *             r = n % factor
 *             if r != 0:
 */
    __pyx_v_q = (__pyx_v_n / __pyx_v_factor);

    /* "cytimes/utils.pxd":3353
 *             n = arr_ptr[i]
 *             q = n // factor
 *             r = n % factor             # <<<<<<<<<<<<<<
 *             if r != 0:
 *                 if not neg_f:
 */
    __pyx_v_r = (__pyx_v_n % __pyx_v_factor);

    /* "cytimes/utils.pxd":3354
 *             q = n // factor
 *             r = n % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if n > 0:
 */
    __pyx_t_1 = (__pyx_v_r != 0);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":3355
 *             r = n % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if n > 0:
 *                         q += 1
 */
      __pyx_t_1 = (!__pyx_v_neg_f);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":3356
 *             if r != 0:
 *                 if not neg_f:
 *                     if n > 0:             # <<<<<<<<<<<<<<
 *                         q += 1
 *                 else:
 */
        __pyx_t_1 = (__pyx_v_n > 0);
        if (__pyx_t_1) {

          /* "cytimes/utils.pxd":3357
 *                 if not neg_f:
 *                     if n > 0:
 *                         q += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     if n < 0:
 */
          __pyx_v_q = (__pyx_v_q + 1);

          /* "cytimes/utils.pxd":3356
 *             if r != 0:
 *                 if not neg_f:
 *                     if n > 0:             # <<<<<<<<<<<<<<
 *                         q += 1
 *                 else:
 */
        }

        /* "cytimes/utils.pxd":3355
 *             r = n % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if n > 0:
 *                         q += 1
 */
        goto __pyx_L12;
      }

      /* "cytimes/utils.pxd":3359
 *                         q += 1
 *                 else:
 *                     if n < 0:             # <<<<<<<<<<<<<<
 *                         q += 1
 *             res_ptr[i] = q * multiple + offset
 */
      /*else*/ {
        __pyx_t_1 = (__pyx_v_n < 0);
        if (__pyx_t_1) {

          /* "cytimes/utils.pxd":3360
 *                 else:
 *                     if n < 0:
 *                         q += 1             # <<<<<<<<<<<<<<
 *             res_ptr[i] = q * multiple + offset
 *     return res
 */
          __pyx_v_q = (__pyx_v_q + 1);

          /* "cytimes/utils.pxd":3359
 *                         q += 1
 *                 else:
 *                     if n < 0:             # <<<<<<<<<<<<<<
 *                         q += 1
 *             res_ptr[i] = q * multiple + offset
 */
        }
      }
      __pyx_L12:;

      /* "cytimes/utils.pxd":3354
 *             q = n // factor
 *             r = n % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if n > 0:
 */
    }

    /* "cytimes/utils.pxd":3361
 *                     if n < 0:
 *                         q += 1
 *             res_ptr[i] = q * multiple + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__pyx_v_q * __pyx_v_multiple) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3362
 *                         q += 1
 *             res_ptr[i] = q * multiple + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_floor_to_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 multiple = 0, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_floor_to_mul(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_arr_floor_to_mul *__pyx_optional_args) {
  npy_int64 __pyx_v_multiple = ((npy_int64)0);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  int __pyx_v_neg_f;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_n;
  npy_int64 __pyx_v_q;
  npy_int64 __pyx_v_r;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_floor_to_mul", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_multiple = __pyx_optional_args->multiple;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3378
 *     """
 *     # Fast-path
 *     if factor == 1 and multiple == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  __pyx_t_2 = (__pyx_v_factor == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_multiple == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_offset == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3379
 *     # Fast-path
 *     if factor == 1 and multiple == 1 and offset == 0:
 *         return arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":3378
 *     """
 *     # Fast-path
 *     if factor == 1 and multiple == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  }

  /* "cytimes/utils.pxd":3382
 * 
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot floor to multiple 0.")
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":3383
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("cannot floor to multiple 0.")
 *     if multiple == 0:
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":3384
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot floor to multiple 0.")             # <<<<<<<<<<<<<<
 *     if multiple == 0:
 *         multiple = factor
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3384, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 3384, __pyx_L1_error)

    /* "cytimes/utils.pxd":3383
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("cannot floor to multiple 0.")
 *     if multiple == 0:
 */
  }

  /* "cytimes/utils.pxd":3385
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot floor to multiple 0.")
 *     if multiple == 0:             # <<<<<<<<<<<<<<
 *         multiple = factor
 * 
 */
  __pyx_t_1 = (__pyx_v_multiple == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3386
 *         raise ZeroDivisionError("cannot floor to multiple 0.")
 *     if multiple == 0:
 *         multiple = factor             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
    __pyx_v_multiple = __pyx_v_factor;

    /* "cytimes/utils.pxd":3385
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot floor to multiple 0.")
 *     if multiple == 0:             # <<<<<<<<<<<<<<
 *         multiple = factor
 * 
 */
  }

  /* "cytimes/utils.pxd":3390
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3391
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_4[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3391, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":3392
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3393
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         bint neg_f = factor < 0
 *         np.npy_int64 i, n, q, r
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3394
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, n, q, r
 * 
 */
  __pyx_v_neg_f = (__pyx_v_factor < 0);

  /* "cytimes/utils.pxd":3398
 * 
 *     with cython.cdivision(True):
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             n = arr_ptr[i]
 *             q = n // factor
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "cytimes/utils.pxd":3399
 *     with cython.cdivision(True):
 *         for i in range(size):
 *             n = arr_ptr[i]             # <<<<<<<<<<<<<<
 *             q = n // factor
 *             r = n % factor
 */
    __pyx_v_n = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "cytimes/utils.pxd":3400
 *         for i in range(size):
 *             n = arr_ptr[i]
 *             q = n // factor             # <<<<<<<<<<<<<<
 *             r = n % factor
 *             if r != 0:
 */
    __pyx_v_q = (__pyx_v_n / __pyx_v_factor);

    /* "cytimes/utils.pxd":3401
 *             n = arr_ptr[i]
 *             q = n // factor
 *             r = n % factor             # <<<<<<<<<<<<<<
 *             if r != 0:
 *                 if not neg_f:
 */
    __pyx_v_r = (__pyx_v_n % __pyx_v_factor);

    /* "cytimes/utils.pxd":3402
 *             q = n // factor
 *             r = n % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if n < 0:
 */
    __pyx_t_1 = (__pyx_v_r != 0);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":3403
 *             r = n % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if n < 0:
 *                         q -= 1
 */
      __pyx_t_1 = (!__pyx_v_neg_f);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":3404
 *             if r != 0:
 *                 if not neg_f:
 *                     if n < 0:             # <<<<<<<<<<<<<<
 *                         q -= 1
 *                 else:
 */
        __pyx_t_1 = (__pyx_v_n < 0);
        if (__pyx_t_1) {

          /* "cytimes/utils.pxd":3405
 *                 if not neg_f:
 *                     if n < 0:
 *                         q -= 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     if n > 0:
 */
          __pyx_v_q = (__pyx_v_q - 1);

          /* "cytimes/utils.pxd":3404
 *             if r != 0:
 *                 if not neg_f:
 *                     if n < 0:             # <<<<<<<<<<<<<<
 *                         q -= 1
 *                 else:
 */
        }

        /* "cytimes/utils.pxd":3403
 *             r = n % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if n < 0:
 *                         q -= 1
 */
        goto __pyx_L12;
      }

      /* "cytimes/utils.pxd":3407
 *                         q -= 1
 *                 else:
 *                     if n > 0:             # <<<<<<<<<<<<<<
 *                         q -= 1
 *             res_ptr[i] = q * multiple + offset
 */
      /*else*/ {
        __pyx_t_1 = (__pyx_v_n > 0);
        if (__pyx_t_1) {

          /* "cytimes/utils.pxd":3408
 *                 else:
 *                     if n > 0:
 *                         q -= 1             # <<<<<<<<<<<<<<
 *             res_ptr[i] = q * multiple + offset
 *     return res
 */
          __pyx_v_q = (__pyx_v_q - 1);

          /* "cytimes/utils.pxd":3407
 *                         q -= 1
 *                 else:
 *                     if n > 0:             # <<<<<<<<<<<<<<
 *                         q -= 1
 *             res_ptr[i] = q * multiple + offset
 */
        }
      }
      __pyx_L12:;

      /* "cytimes/utils.pxd":3402
 *             q = n // factor
 *             r = n % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if n < 0:
 */
    }

    /* "cytimes/utils.pxd":3409
 *                     if n > 0:
 *                         q -= 1
 *             res_ptr[i] = q * multiple + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__pyx_v_q * __pyx_v_multiple) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3410
 *                         q -= 1
 *             res_ptr[i] = q * multiple + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_add_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_add_arr(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2, struct __pyx_opt_args_7cytimes_5utils_arr_add_arr *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr1_ptr;
  npy_int64 *__pyx_v_arr2_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_add_arr", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr1);
  __Pyx_INCREF((PyObject *)__pyx_v_arr2);

  /* "cytimes/utils.pxd":3422
 *     """
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]             # <<<<<<<<<<<<<<
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform addition on ndarrays with different shapes.")
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr1)[0]);

  /* "cytimes/utils.pxd":3423
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot perform addition on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  __pyx_t_1 = (__pyx_v_size != (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr2)[0]));
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":3424
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform addition on ndarrays with different shapes.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 3424, __pyx_L1_error)

    /* "cytimes/utils.pxd":3423
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot perform addition on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  }

  /* "cytimes/utils.pxd":3425
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform addition on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)             # <<<<<<<<<<<<<<
 *     arr2 = arr_assure_int64_like(arr2)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr1, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":3426
 *         raise ValueError("cannot perform addition on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr2, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":3430
 *     # Compute
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3430, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":3431
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3432
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 *         np.npy_int64 i
 */
  __pyx_v_arr1_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr1));

  /* "cytimes/utils.pxd":3433
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr2_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr2));

  /* "cytimes/utils.pxd":3436
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr1_ptr[i] + arr2_ptr[i] + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3437
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr1_ptr[i] + arr2_ptr[i] + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (((__pyx_v_arr1_ptr[__pyx_v_i]) + (__pyx_v_arr2_ptr[__pyx_v_i])) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3438
 *     for i in range(size):
 *         res_ptr[i] = arr1_ptr[i] + arr2_ptr[i] + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_sub_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_sub_arr(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2, struct __pyx_opt_args_7cytimes_5utils_arr_sub_arr *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr1_ptr;
  npy_int64 *__pyx_v_arr2_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_sub_arr", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr1);
  __Pyx_INCREF((PyObject *)__pyx_v_arr2);

  /* "cytimes/utils.pxd":3450
 *     """
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]             # <<<<<<<<<<<<<<
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform subtraction on ndarrays with different shapes.")
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr1)[0]);

  /* "cytimes/utils.pxd":3451
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot perform subtraction on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  __pyx_t_1 = (__pyx_v_size != (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr2)[0]));
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":3452
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform subtraction on ndarrays with different shapes.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 3452, __pyx_L1_error)

    /* "cytimes/utils.pxd":3451
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot perform subtraction on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  }

  /* "cytimes/utils.pxd":3453
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform subtraction on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)             # <<<<<<<<<<<<<<
 *     arr2 = arr_assure_int64_like(arr2)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr1, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":3454
 *         raise ValueError("cannot perform subtraction on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr2, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":3458
 *     # Compute
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3458, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":3459
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3460
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 *         np.npy_int64 i
 */
  __pyx_v_arr1_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr1));

  /* "cytimes/utils.pxd":3461
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr2_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr2));

  /* "cytimes/utils.pxd":3464
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr1_ptr[i] - arr2_ptr[i] + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3465
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr1_ptr[i] - arr2_ptr[i] + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (((__pyx_v_arr1_ptr[__pyx_v_i]) - (__pyx_v_arr2_ptr[__pyx_v_i])) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3466
 *     for i in range(size):
 *         res_ptr[i] = arr1_ptr[i] - arr2_ptr[i] + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * # . comparison
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

/* "cytimes/utils.pxd":3469
 * 
 * # . comparison
 * cdef inline np.ndarray arr_equal_to(np.ndarray arr, np.npy_int64 value):             # <<<<<<<<<<<<<<
 *     """Check if the values of the ndarray are equal to the 'value' `<'ndarray[bool]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_equal_to(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_value) {
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_bool *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2[1];
  npy_int64 __pyx_t_3;
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_equal_to", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3479
 *     """
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3483
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3484
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)             # <<<<<<<<<<<<<<
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_2[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_2, NPY_BOOL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3484, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3485
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_bool *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3486
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3489
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] == value
 *     return res
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "cytimes/utils.pxd":3490
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] == value             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__pyx_v_arr_ptr[__pyx_v_i]) == __pyx_v_value);
  }

  /* "cytimes/utils.pxd":3491
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] == value
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_greater_than(np.ndarray arr, np.npy_int64 value):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":3469
 * 
 * # . comparison
 * cdef inline np.ndarray arr_equal_to(np.ndarray arr, np.npy_int64 value):             # <<<<<<<<<<<<<<
 *     """Check if the values of the ndarray are equal to the 'value' `<'ndarray[bool]'>`.
 * 
 */

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

/* "cytimes/utils.pxd":3493
 *     return res
 * 
 * cdef inline np.ndarray arr_greater_than(np.ndarray arr, np.npy_int64 value):             # <<<<<<<<<<<<<<
 *     """Check if the values of the ndarray are greater than the 'value' `<'ndarray[bool]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_greater_than(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_value) {
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_bool *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2[1];
  npy_int64 __pyx_t_3;
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_greater_than", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3503
 *     """
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3507
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3508
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)             # <<<<<<<<<<<<<<
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_2[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_2, NPY_BOOL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3508, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3509
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_bool *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3510
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3513
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] > value
 *     return res
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "cytimes/utils.pxd":3514
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] > value             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__pyx_v_arr_ptr[__pyx_v_i]) > __pyx_v_value);
  }

  /* "cytimes/utils.pxd":3515
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] > value
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_less_than(np.ndarray arr, np.npy_int64 value):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":3493
 *     return res
 * 
 * cdef inline np.ndarray arr_greater_than(np.ndarray arr, np.npy_int64 value):             # <<<<<<<<<<<<<<
 *     """Check if the values of the ndarray are greater than the 'value' `<'ndarray[bool]'>`.
 * 
 */

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

/* "cytimes/utils.pxd":3517
 *     return res
 * 
 * cdef inline np.ndarray arr_less_than(np.ndarray arr, np.npy_int64 value):             # <<<<<<<<<<<<<<
 *     """Check if the values of the ndarray are less than the 'value' `<'ndarray[bool]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_less_than(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_value) {
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_bool *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2[1];
  npy_int64 __pyx_t_3;
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_less_than", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3527
 *     """
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3531
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3532
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)             # <<<<<<<<<<<<<<
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_2[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_2, NPY_BOOL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3532, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3533
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_bool *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3534
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3537
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] < value
 *     return res
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "cytimes/utils.pxd":3538
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] < value             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__pyx_v_arr_ptr[__pyx_v_i]) < __pyx_v_value);
  }

  /* "cytimes/utils.pxd":3539
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] < value
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_equal_to_arr(np.ndarray arr1, np.ndarray arr2):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":3517
 *     return res
 * 
 * cdef inline np.ndarray arr_less_than(np.ndarray arr, np.npy_int64 value):             # <<<<<<<<<<<<<<
 *     """Check if the values of the ndarray are less than the 'value' `<'ndarray[bool]'>`.
 * 
 */

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

/* "cytimes/utils.pxd":3541
 *     return res
 * 
 * cdef inline np.ndarray arr_equal_to_arr(np.ndarray arr1, np.ndarray arr2):             # <<<<<<<<<<<<<<
 *     """Check if the values of two ndarrays are equal `<'ndarray[bool]'>`
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_equal_to_arr(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2) {
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_bool *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr1_ptr;
  npy_int64 *__pyx_v_arr2_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_equal_to_arr", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr1);
  __Pyx_INCREF((PyObject *)__pyx_v_arr2);

  /* "cytimes/utils.pxd":3548
 *     """
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]             # <<<<<<<<<<<<<<
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform comparison on ndarrays with different shapes.")
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr1)[0]);

  /* "cytimes/utils.pxd":3549
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot perform comparison on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  __pyx_t_1 = (__pyx_v_size != (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr2)[0]));
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":3550
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform comparison on ndarrays with different shapes.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 3550, __pyx_L1_error)

    /* "cytimes/utils.pxd":3549
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot perform comparison on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  }

  /* "cytimes/utils.pxd":3551
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform comparison on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)             # <<<<<<<<<<<<<<
 *     arr2 = arr_assure_int64_like(arr2)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr1, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":3552
 *         raise ValueError("cannot perform comparison on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr2, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":3556
 *     # Compute
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)             # <<<<<<<<<<<<<<
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_t_3, NPY_BOOL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3556, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":3557
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 */
  __pyx_v_res_ptr = ((npy_bool *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3558
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 *         np.npy_int64 i
 */
  __pyx_v_arr1_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr1));

  /* "cytimes/utils.pxd":3559
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr2_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr2));

  /* "cytimes/utils.pxd":3562
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr1_ptr[i] == arr2_ptr[i]
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3563
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr1_ptr[i] == arr2_ptr[i]             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__pyx_v_arr1_ptr[__pyx_v_i]) == (__pyx_v_arr2_ptr[__pyx_v_i]));
  }

  /* "cytimes/utils.pxd":3564
 *     for i in range(size):
 *         res_ptr[i] = arr1_ptr[i] == arr2_ptr[i]
 *     return res             # <<<<<<<<<<<<<<
 * 
 * # NumPy: ndarray[datetime64] ---------------------------------------------------------------------------
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":3541
 *     return res
 * 
 * cdef inline np.ndarray arr_equal_to_arr(np.ndarray arr1, np.ndarray arr2):             # <<<<<<<<<<<<<<
 *     """Check if the values of two ndarrays are equal `<'ndarray[bool]'>`
 * 
 */

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

/* "cytimes/utils.pxd":3568
 * # NumPy: ndarray[datetime64] ---------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_dt64arr(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the given array is dtype of 'datetime64' `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_dt64arr(PyArrayObject *__pyx_v_arr) {
  int __pyx_r;

  /* "cytimes/utils.pxd":3574
 *     >>> isinstance(arr.dtype, np.dtypes.DateTime64DType)
 *     """
 *     return np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_DATETIME             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint validate_dt64arr(np.ndarray arr) except -1:
 */
  __pyx_r = (PyArray_TYPE(__pyx_v_arr) == NPY_DATETIME);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":3568
 * # NumPy: ndarray[datetime64] ---------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_dt64arr(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the given array is dtype of 'datetime64' `<'bool'>`.
 * 
 */

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

/* "cytimes/utils.pxd":3576
 *     return np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_DATETIME
 * 
 * cdef inline bint validate_dt64arr(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Validate if the given array is dtype of 'datetime64',
 *     raises `TypeError` if dtype is incorrect.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_validate_dt64arr(PyArrayObject *__pyx_v_arr) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("validate_dt64arr", 1);

  /* "cytimes/utils.pxd":3580
 *     raises `TypeError` if dtype is incorrect.
 *     """
 *     if not is_dt64arr(arr):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects np.ndarray[datetime64], got '%s'." % arr.dtype)
 *     return True
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr(__pyx_v_arr); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 3580, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "cytimes/utils.pxd":3581
 *     """
 *     if not is_dt64arr(arr):
 *         raise TypeError("expects np.ndarray[datetime64], got '%s'." % arr.dtype)             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_expects_np_ndarray_datetime64_go, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 3581, __pyx_L1_error)

    /* "cytimes/utils.pxd":3580
 *     raises `TypeError` if dtype is incorrect.
 *     """
 *     if not is_dt64arr(arr):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects np.ndarray[datetime64], got '%s'." % arr.dtype)
 *     return True
 */
  }

  /* "cytimes/utils.pxd":3582
 *     if not is_dt64arr(arr):
 *         raise TypeError("expects np.ndarray[datetime64], got '%s'." % arr.dtype)
 *     return True             # <<<<<<<<<<<<<<
 * 
 * # . range check
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":3576
 *     return np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_DATETIME
 * 
 * cdef inline bint validate_dt64arr(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Validate if the given array is dtype of 'datetime64',
 *     raises `TypeError` if dtype is incorrect.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils.validate_dt64arr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  npy_int64 __pyx_v_minimum;
  npy_int64 __pyx_v_maximum;
  npy_int64 __pyx_v_size;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PY_LONG_LONG __pyx_t_5;
  PY_LONG_LONG __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_UCS4 __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  npy_int64 __pyx_t_10;
  npy_int64 __pyx_t_11;
  npy_int64 __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_dt64arr_ns_safe", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3592
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3593
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_arr)); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3593, __pyx_L1_error)
    __pyx_r = __pyx_t_1;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":3592
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "cytimes/utils.pxd":3597
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "cytimes/utils.pxd":3598
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             raise ValueError(
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3599
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "cannot check if <'ndarray[%s]'> is within nanosecond conversion "
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (unlikely(__pyx_t_1)) {

      /* "cytimes/utils.pxd":3602
 *             raise ValueError(
 *                 "cannot check if <'ndarray[%s]'> is within nanosecond conversion "
 *                 "range without specifying the array datetime unit." % arr.dtype             # <<<<<<<<<<<<<<
 *             )
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3602, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_cannot_check_if_ndarray_s_is_wit, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3602, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cytimes/utils.pxd":3600
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "cannot check if <'ndarray[%s]'> is within nanosecond conversion "
 *                 "range without specifying the array datetime unit." % arr.dtype
 */
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3600, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 3600, __pyx_L1_error)

      /* "cytimes/utils.pxd":3599
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "cannot check if <'ndarray[%s]'> is within nanosecond conversion "
 */
    }

    /* "cytimes/utils.pxd":3604
 *                 "range without specifying the array datetime unit." % arr.dtype
 *             )
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_4 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 3604, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_4;

    /* "cytimes/utils.pxd":3605
 *             )
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/utils.pxd":3598
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             raise ValueError(
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":3606
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3607
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_4 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 3607, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_4;

    /* "cytimes/utils.pxd":3606
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":3609
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_4 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 3609, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_4;
  }
  __pyx_L4:;

  /* "cytimes/utils.pxd":3614
 *     # Get min & max range
 *     cdef np.npy_int64 minimum, maximum
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_NS_MIN, DT64_NS_NS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  switch (__pyx_v_unit) {
    case NPY_FR_ns:

    /* "cytimes/utils.pxd":3615
 *     cdef np.npy_int64 minimum, maximum
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         minimum, maximum = DT64_NS_NS_MIN, DT64_NS_NS_MAX             # <<<<<<<<<<<<<<
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         minimum, maximum = DT64_NS_US_MIN, DT64_NS_US_MAX
 */
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_NS_MIN;
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_NS_MAX;
    __pyx_v_minimum = __pyx_t_5;
    __pyx_v_maximum = __pyx_t_6;

    /* "cytimes/utils.pxd":3614
 *     # Get min & max range
 *     cdef np.npy_int64 minimum, maximum
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_NS_MIN, DT64_NS_NS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
    break;
    case NPY_FR_us:

    /* "cytimes/utils.pxd":3617
 *         minimum, maximum = DT64_NS_NS_MIN, DT64_NS_NS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         minimum, maximum = DT64_NS_US_MIN, DT64_NS_US_MAX             # <<<<<<<<<<<<<<
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         minimum, maximum = DT64_NS_MS_MIN, DT64_NS_MS_MAX
 */
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_US_MIN;
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_US_MAX;
    __pyx_v_minimum = __pyx_t_6;
    __pyx_v_maximum = __pyx_t_5;

    /* "cytimes/utils.pxd":3616
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         minimum, maximum = DT64_NS_NS_MIN, DT64_NS_NS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_US_MIN, DT64_NS_US_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
    break;
    case NPY_FR_ms:

    /* "cytimes/utils.pxd":3619
 *         minimum, maximum = DT64_NS_US_MIN, DT64_NS_US_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         minimum, maximum = DT64_NS_MS_MIN, DT64_NS_MS_MAX             # <<<<<<<<<<<<<<
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         minimum, maximum = DT64_NS_SS_MIN, DT64_NS_SS_MAX
 */
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_MS_MIN;
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_MS_MAX;
    __pyx_v_minimum = __pyx_t_5;
    __pyx_v_maximum = __pyx_t_6;

    /* "cytimes/utils.pxd":3618
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         minimum, maximum = DT64_NS_US_MIN, DT64_NS_US_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_MS_MIN, DT64_NS_MS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
    break;
    case NPY_FR_s:

    /* "cytimes/utils.pxd":3621
 *         minimum, maximum = DT64_NS_MS_MIN, DT64_NS_MS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         minimum, maximum = DT64_NS_SS_MIN, DT64_NS_SS_MAX             # <<<<<<<<<<<<<<
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         minimum, maximum = DT64_NS_MI_MIN, DT64_NS_MI_MAX
 */
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_SS_MIN;
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_SS_MAX;
    __pyx_v_minimum = __pyx_t_6;
    __pyx_v_maximum = __pyx_t_5;

    /* "cytimes/utils.pxd":3620
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         minimum, maximum = DT64_NS_MS_MIN, DT64_NS_MS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_SS_MIN, DT64_NS_SS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
    break;
    case NPY_FR_m:

    /* "cytimes/utils.pxd":3623
 *         minimum, maximum = DT64_NS_SS_MIN, DT64_NS_SS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         minimum, maximum = DT64_NS_MI_MIN, DT64_NS_MI_MAX             # <<<<<<<<<<<<<<
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         minimum, maximum = DT64_NS_HH_MIN, DT64_NS_HH_MAX
 */
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_MI_MIN;
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_MI_MAX;
    __pyx_v_minimum = __pyx_t_5;
    __pyx_v_maximum = __pyx_t_6;

    /* "cytimes/utils.pxd":3622
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         minimum, maximum = DT64_NS_SS_MIN, DT64_NS_SS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_MI_MIN, DT64_NS_MI_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
    break;
    case NPY_FR_h:

    /* "cytimes/utils.pxd":3625
 *         minimum, maximum = DT64_NS_MI_MIN, DT64_NS_MI_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         minimum, maximum = DT64_NS_HH_MIN, DT64_NS_HH_MAX             # <<<<<<<<<<<<<<
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         minimum, maximum = DT64_NS_DD_MIN, DT64_NS_DD_MAX
 */
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_HH_MIN;
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_HH_MAX;
    __pyx_v_minimum = __pyx_t_6;
    __pyx_v_maximum = __pyx_t_5;

    /* "cytimes/utils.pxd":3624
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         minimum, maximum = DT64_NS_MI_MIN, DT64_NS_MI_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_HH_MIN, DT64_NS_HH_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
    break;
    case NPY_FR_D:

    /* "cytimes/utils.pxd":3627
 *         minimum, maximum = DT64_NS_HH_MIN, DT64_NS_HH_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         minimum, maximum = DT64_NS_DD_MIN, DT64_NS_DD_MAX             # <<<<<<<<<<<<<<
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         minimum, maximum = DT64_NS_WW_MIN, DT64_NS_WW_MAX
 */
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_DD_MIN;
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_DD_MAX;
    __pyx_v_minimum = __pyx_t_5;
    __pyx_v_maximum = __pyx_t_6;

    /* "cytimes/utils.pxd":3626
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         minimum, maximum = DT64_NS_HH_MIN, DT64_NS_HH_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_DD_MIN, DT64_NS_DD_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
    break;
    case NPY_FR_W:

    /* "cytimes/utils.pxd":3629
 *         minimum, maximum = DT64_NS_DD_MIN, DT64_NS_DD_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         minimum, maximum = DT64_NS_WW_MIN, DT64_NS_WW_MAX             # <<<<<<<<<<<<<<
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         minimum, maximum = DT64_NS_MM_MIN, DT64_NS_MM_MAX
 */
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_WW_MIN;
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_WW_MAX;
    __pyx_v_minimum = __pyx_t_6;
    __pyx_v_maximum = __pyx_t_5;

    /* "cytimes/utils.pxd":3628
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         minimum, maximum = DT64_NS_DD_MIN, DT64_NS_DD_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_WW_MIN, DT64_NS_WW_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
    break;
    case NPY_FR_M:

    /* "cytimes/utils.pxd":3631
 *         minimum, maximum = DT64_NS_WW_MIN, DT64_NS_WW_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         minimum, maximum = DT64_NS_MM_MIN, DT64_NS_MM_MAX             # <<<<<<<<<<<<<<
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         minimum, maximum = DT64_NS_YY_MIN, DT64_NS_YY_MAX
 */
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_MM_MIN;
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_MM_MAX;
    __pyx_v_minimum = __pyx_t_5;
    __pyx_v_maximum = __pyx_t_6;

    /* "cytimes/utils.pxd":3630
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         minimum, maximum = DT64_NS_WW_MIN, DT64_NS_WW_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_MM_MIN, DT64_NS_MM_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
    break;
    case NPY_FR_Y:

    /* "cytimes/utils.pxd":3633
 *         minimum, maximum = DT64_NS_MM_MIN, DT64_NS_MM_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         minimum, maximum = DT64_NS_YY_MIN, DT64_NS_YY_MAX             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_YY_MIN;
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_YY_MAX;
    __pyx_v_minimum = __pyx_t_6;
    __pyx_v_maximum = __pyx_t_5;

    /* "cytimes/utils.pxd":3632
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         minimum, maximum = DT64_NS_MM_MIN, DT64_NS_MM_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_YY_MIN, DT64_NS_YY_MAX
 *     else:
 */
    break;
    default:

    /* "cytimes/utils.pxd":3636
 *     else:
 *         raise ValueError(
 *             "cannot check <'ndarray[%s]'> nanosecond conversion "             # <<<<<<<<<<<<<<
 *             "range, datetime unit '%s' is not supported."
 *             % (arr.dtype, map_nptime_unit_int2str(unit))
 */
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = 0;
    __pyx_t_8 = 127;
    __Pyx_INCREF(__pyx_kp_u_cannot_check_ndarray);
    __pyx_t_7 += 23;
    __Pyx_GIVEREF(__pyx_kp_u_cannot_check_ndarray);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_cannot_check_ndarray);

    /* "cytimes/utils.pxd":3638
 *             "cannot check <'ndarray[%s]'> nanosecond conversion "
 *             "range, datetime unit '%s' is not supported."
 *             % (arr.dtype, map_nptime_unit_int2str(unit))             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_3), __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_8;
    __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_INCREF(__pyx_kp_u_nanosecond_conversion_range_dat);
    __pyx_t_7 += 48;
    __Pyx_GIVEREF(__pyx_kp_u_nanosecond_conversion_range_dat);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_nanosecond_conversion_range_dat);
    __pyx_t_9 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_unit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_8;
    __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u_is_not_supported);
    __pyx_t_7 += 19;
    __Pyx_GIVEREF(__pyx_kp_u_is_not_supported);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_is_not_supported);

    /* "cytimes/utils.pxd":3636
 *     else:
 *         raise ValueError(
 *             "cannot check <'ndarray[%s]'> nanosecond conversion "             # <<<<<<<<<<<<<<
 *             "range, datetime unit '%s' is not supported."
 *             % (arr.dtype, map_nptime_unit_int2str(unit))
 */
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cytimes/utils.pxd":3635
 *         minimum, maximum = DT64_NS_YY_MIN, DT64_NS_YY_MAX
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "cannot check <'ndarray[%s]'> nanosecond conversion "
 *             "range, datetime unit '%s' is not supported."
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3635, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 3635, __pyx_L1_error)
    break;
  }

  /* "cytimes/utils.pxd":3643
 *     # Check range
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3644
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3647
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         if not minimum < arr_ptr[i] < maximum:
 *             return False
 */
  __pyx_t_10 = __pyx_v_size;
  __pyx_t_11 = __pyx_t_10;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "cytimes/utils.pxd":3648
 * 
 *     for i in range(size):
 *         if not minimum < arr_ptr[i] < maximum:             # <<<<<<<<<<<<<<
 *             return False
 *     return True
 */
    __pyx_t_1 = (__pyx_v_minimum < (__pyx_v_arr_ptr[__pyx_v_i]));
    if (__pyx_t_1) {
      __pyx_t_1 = ((__pyx_v_arr_ptr[__pyx_v_i]) < __pyx_v_maximum);
    }
    __pyx_t_13 = (!__pyx_t_1);
    if (__pyx_t_13) {

      /* "cytimes/utils.pxd":3649
 *     for i in range(size):
 *         if not minimum < arr_ptr[i] < maximum:
 *             return False             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
      __pyx_r = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":3648
 * 
 *     for i in range(size):
 *         if not minimum < arr_ptr[i] < maximum:             # <<<<<<<<<<<<<<
 *             return False
 *     return True
 */
    }
  }

  /* "cytimes/utils.pxd":3650
 *         if not minimum < arr_ptr[i] < maximum:
 *             return False
 *     return True             # <<<<<<<<<<<<<<
 * 
 * # . access
 */
  __pyx_r = 1;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cytimes.utils.is_dt64arr_ns_safe", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_year(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_year *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_year", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3656
 *     """Get the year values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[Y]
 *     arr = dt64arr_as_int64_Y(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Add back epoch
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3660
 *     # Add back epoch
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3661
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3661, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3662
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3663
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3666
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] + EPOCH_YEAR + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3667
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] + EPOCH_YEAR + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_YEAR) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3668
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] + EPOCH_YEAR + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_quarter(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_quarter(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_quarter *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_quarter", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3673
 *     """Get the quarter values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_M(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3677
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3678
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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(0, 3678, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3679
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3680
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3683
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = quarter_of_month(arr_ptr[i] % 12 + 1) + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3684
 * 
 *     for i in range(size):
 *         res_ptr[i] = quarter_of_month(arr_ptr[i] % 12 + 1) + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_quarter_of_month((__Pyx_mod_npy_int64((__pyx_v_arr_ptr[__pyx_v_i]), 12) + 1)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 3684, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_t_7 + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3685
 *     for i in range(size):
 *         res_ptr[i] = quarter_of_month(arr_ptr[i] % 12 + 1) + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_month(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_month(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_month *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_month", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3690
 *     """Get the month values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_M(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3694
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3695
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3695, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3696
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3697
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3700
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] % 12 + 1 + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3701
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 12 + 1 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__Pyx_mod_npy_int64((__pyx_v_arr_ptr[__pyx_v_i]), 12) + 1) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3702
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 12 + 1 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_weekday(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_weekday(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_weekday *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_weekday", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3707
 *     """Get the weekday values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3711
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3712
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3712, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3713
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3714
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3717
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = (arr_ptr[i] + EPOCH_DAY + 6) % 7 + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3718
 * 
 *     for i in range(size):
 *         res_ptr[i] = (arr_ptr[i] + EPOCH_DAY + 6) % 7 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_mod_npy_int64((((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_DAY) + 6), 7) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3719
 *     for i in range(size):
 *         res_ptr[i] = (arr_ptr[i] + EPOCH_DAY + 6) % 7 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_day(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_day(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_day *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_n;
  npy_int64 __pyx_v_n400;
  npy_int64 __pyx_v_n100;
  npy_int64 __pyx_v_n4;
  npy_int64 __pyx_v_n1;
  npy_int64 __pyx_v_year;
  npy_int64 __pyx_v_month;
  npy_int64 __pyx_v_day;
  npy_int64 __pyx_v_days_bf;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_day", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3724
 *     """Get the day values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3728
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3729
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3729, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3730
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i, n, n400, n100, n4, n1, year, month, day, days_bf
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3731
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, n, n400, n100, n4, n1, year, month, day, days_bf
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3734
 *         np.npy_int64 i, n, n400, n100, n4, n1, year, month, day, days_bf
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         # Convert to ordinal
 *         n = arr_ptr[i] + EPOCH_DAY - 1
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3736
 *     for i in range(size):
 *         # Convert to ordinal
 *         n = arr_ptr[i] + EPOCH_DAY - 1             # <<<<<<<<<<<<<<
 *         # Number of complete 400-year cycles
 *         n400 = n // 146_097
 */
    __pyx_v_n = (((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_DAY) - 1);

    /* "cytimes/utils.pxd":3738
 *         n = arr_ptr[i] + EPOCH_DAY - 1
 *         # Number of complete 400-year cycles
 *         n400 = n // 146_097             # <<<<<<<<<<<<<<
 *         n -= n400 * 146_097
 *         # Number of complete 100-year cycles within the 400-year cycle
 */
    __pyx_v_n400 = __Pyx_div_npy_int64(__pyx_v_n, 0x23AB1);

    /* "cytimes/utils.pxd":3739
 *         # Number of complete 400-year cycles
 *         n400 = n // 146_097
 *         n -= n400 * 146_097             # <<<<<<<<<<<<<<
 *         # Number of complete 100-year cycles within the 400-year cycle
 *         n100 = n // 36_524
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n400 * 0x23AB1));

    /* "cytimes/utils.pxd":3741
 *         n -= n400 * 146_097
 *         # Number of complete 100-year cycles within the 400-year cycle
 *         n100 = n // 36_524             # <<<<<<<<<<<<<<
 *         n -= n100 * 36_524
 *         # Number of complete 4-year cycles within the 100-year cycle
 */
    __pyx_v_n100 = __Pyx_div_npy_int64(__pyx_v_n, 0x8EAC);

    /* "cytimes/utils.pxd":3742
 *         # Number of complete 100-year cycles within the 400-year cycle
 *         n100 = n // 36_524
 *         n -= n100 * 36_524             # <<<<<<<<<<<<<<
 *         # Number of complete 4-year cycles within the 100-year cycle
 *         n4 = n // 1_461
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n100 * 0x8EAC));

    /* "cytimes/utils.pxd":3744
 *         n -= n100 * 36_524
 *         # Number of complete 4-year cycles within the 100-year cycle
 *         n4 = n // 1_461             # <<<<<<<<<<<<<<
 *         n -= n4 * 1_461
 *         # Number of complete years within the 4-year cycle
 */
    __pyx_v_n4 = __Pyx_div_npy_int64(__pyx_v_n, 0x5B5);

    /* "cytimes/utils.pxd":3745
 *         # Number of complete 4-year cycles within the 100-year cycle
 *         n4 = n // 1_461
 *         n -= n4 * 1_461             # <<<<<<<<<<<<<<
 *         # Number of complete years within the 4-year cycle
 *         n1 = n // 365
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n4 * 0x5B5));

    /* "cytimes/utils.pxd":3747
 *         n -= n4 * 1_461
 *         # Number of complete years within the 4-year cycle
 *         n1 = n // 365             # <<<<<<<<<<<<<<
 *         n -= n1 * 365
 *         # Compute the year
 */
    __pyx_v_n1 = __Pyx_div_npy_int64(__pyx_v_n, 0x16D);

    /* "cytimes/utils.pxd":3748
 *         # Number of complete years within the 4-year cycle
 *         n1 = n // 365
 *         n -= n1 * 365             # <<<<<<<<<<<<<<
 *         # Compute the year
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1 + 1
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n1 * 0x16D));

    /* "cytimes/utils.pxd":3750
 *         n -= n1 * 365
 *         # Compute the year
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1 + 1             # <<<<<<<<<<<<<<
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:
 */
    __pyx_v_year = (((((__pyx_v_n400 * 0x190) + (__pyx_v_n100 * 0x64)) + (__pyx_v_n4 * 4)) + __pyx_v_n1) + 1);

    /* "cytimes/utils.pxd":3752
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1 + 1
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:             # <<<<<<<<<<<<<<
 *             day = 31
 *         else:
 */
    __pyx_t_8 = (__pyx_v_n100 == 4);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_8 = (__pyx_v_n1 == 4);
    __pyx_t_7 = __pyx_t_8;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_7) {

      /* "cytimes/utils.pxd":3753
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:
 *             day = 31             # <<<<<<<<<<<<<<
 *         else:
 *             month = (n + 50) >> 5
 */
      __pyx_v_day = 31;

      /* "cytimes/utils.pxd":3752
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1 + 1
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:             # <<<<<<<<<<<<<<
 *             day = 31
 *         else:
 */
      goto __pyx_L5;
    }

    /* "cytimes/utils.pxd":3755
 *             day = 31
 *         else:
 *             month = (n + 50) >> 5             # <<<<<<<<<<<<<<
 *             days_bf = days_bf_month(year, month)
 *             if days_bf > n:
 */
    /*else*/ {
      __pyx_v_month = ((__pyx_v_n + 50) >> 5);

      /* "cytimes/utils.pxd":3756
 *         else:
 *             month = (n + 50) >> 5
 *             days_bf = days_bf_month(year, month)             # <<<<<<<<<<<<<<
 *             if days_bf > n:
 *                 days_bf = days_bf_month(year, month - 1)
 */
      __pyx_t_9 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 3756, __pyx_L1_error)
      __pyx_v_days_bf = __pyx_t_9;

      /* "cytimes/utils.pxd":3757
 *             month = (n + 50) >> 5
 *             days_bf = days_bf_month(year, month)
 *             if days_bf > n:             # <<<<<<<<<<<<<<
 *                 days_bf = days_bf_month(year, month - 1)
 *             day = n - days_bf + 1
 */
      __pyx_t_7 = (__pyx_v_days_bf > __pyx_v_n);
      if (__pyx_t_7) {

        /* "cytimes/utils.pxd":3758
 *             days_bf = days_bf_month(year, month)
 *             if days_bf > n:
 *                 days_bf = days_bf_month(year, month - 1)             # <<<<<<<<<<<<<<
 *             day = n - days_bf + 1
 *         # Compute total months
 */
        __pyx_t_9 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_year, (__pyx_v_month - 1)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 3758, __pyx_L1_error)
        __pyx_v_days_bf = __pyx_t_9;

        /* "cytimes/utils.pxd":3757
 *             month = (n + 50) >> 5
 *             days_bf = days_bf_month(year, month)
 *             if days_bf > n:             # <<<<<<<<<<<<<<
 *                 days_bf = days_bf_month(year, month - 1)
 *             day = n - days_bf + 1
 */
      }

      /* "cytimes/utils.pxd":3759
 *             if days_bf > n:
 *                 days_bf = days_bf_month(year, month - 1)
 *             day = n - days_bf + 1             # <<<<<<<<<<<<<<
 *         # Compute total months
 *         res_ptr[i] = day + offset
 */
      __pyx_v_day = ((__pyx_v_n - __pyx_v_days_bf) + 1);
    }
    __pyx_L5:;

    /* "cytimes/utils.pxd":3761
 *             day = n - days_bf + 1
 *         # Compute total months
 *         res_ptr[i] = day + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_v_day + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3762
 *         # Compute total months
 *         res_ptr[i] = day + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_hour(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_hour(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_hour *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_h __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_hour", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3767
 *     """Get the hour values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_h(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_h(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3771
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3772
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3772, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3773
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3774
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3777
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = (arr_ptr[i] + EPOCH_HOUR) % 24 + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3778
 * 
 *     for i in range(size):
 *         res_ptr[i] = (arr_ptr[i] + EPOCH_HOUR) % 24 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_mod_npy_int64(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_HOUR), 24) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3779
 *     for i in range(size):
 *         res_ptr[i] = (arr_ptr[i] + EPOCH_HOUR) % 24 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_minute(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_minute(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_minute *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_m __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_minute", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3784
 *     """Get the minute values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_m(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_m(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3788
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3789
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3789, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3790
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3791
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3794
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = (arr_ptr[i] + EPOCH_MINUTE) % 60 + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3795
 * 
 *     for i in range(size):
 *         res_ptr[i] = (arr_ptr[i] + EPOCH_MINUTE) % 60 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_mod_npy_int64(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_MINUTE), 60) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3796
 *     for i in range(size):
 *         res_ptr[i] = (arr_ptr[i] + EPOCH_MINUTE) % 60 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_second(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_second(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_second *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_s __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_second", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3801
 *     """Get the second values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_s(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_s(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3801, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3805
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3806
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3806, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3807
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3808
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3811
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] % 60 + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3812
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 60 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_mod_npy_int64((__pyx_v_arr_ptr[__pyx_v_i]), 60) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3813
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 60 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_millisecond(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_millisecond(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_millisecond *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ms __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_millisecond", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3818
 *     """Get the millisecond values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_ms(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_ms(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3822
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3823
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3823, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3824
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3825
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3828
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] % 1_000 + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3829
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 1_000 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_mod_npy_int64((__pyx_v_arr_ptr[__pyx_v_i]), 0x3E8) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3830
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 1_000 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_microsecond(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_microsecond(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_microsecond *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_us __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_microsecond", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3835
 *     """Get the microsecond values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_us(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_us(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3839
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3840
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3840, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3841
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3842
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3845
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] % 1_000_000 + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3846
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 1_000_000 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_mod_npy_int64((__pyx_v_arr_ptr[__pyx_v_i]), 0xF4240) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3847
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 1_000_000 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_nanosecond(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

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

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_nanosecond(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_nanosecond *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ns __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_nanosecond", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3852
 *     """Get the nanosecond values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_ns(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_ns(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3856
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3857
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3857, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3858
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3859
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3862
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] % 1_000 + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3863
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 1_000 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_mod_npy_int64((__pyx_v_arr_ptr[__pyx_v_i]), 0x3E8) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":3864
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 1_000 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_times(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

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

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

/* "cytimes/utils.pxd":3866
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_times(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the times values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Empty array
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_times(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_times *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  PyObject *__pyx_v_unit_str = NULL;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mod __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_times", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3869
 *     """Get the times values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3870
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":3869
 *     """Get the times values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "cytimes/utils.pxd":3874
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "cytimes/utils.pxd":3875
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3876
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":3877
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_Y_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 3877, __pyx_L1_error)

      /* "cytimes/utils.pxd":3876
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "cytimes/utils.pxd":3878
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 3878, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":3879
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3879, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.pxd":3875
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":3880
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3881
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 3881, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":3880
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":3883
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 3883, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "cytimes/utils.pxd":3888
 *     # Get factor
 *     cdef np.npy_int64 factor
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3889
 *     cdef np.npy_int64 factor
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_mod(arr, NS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_mod(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mod(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":3888
 *     # Get factor
 *     cdef np.npy_int64 factor
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/utils.pxd":3890
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_mod(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3891
 *         return arr_mod(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_mod(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mod(arr, MS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mod(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_DAY, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3891, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":3890
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_mod(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/utils.pxd":3892
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_mod(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3893
 *         return arr_mod(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mod(arr, MS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mod(arr, SS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mod(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_DAY, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":3892
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_mod(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/utils.pxd":3894
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mod(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3895
 *         return arr_mod(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mod(arr, SS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mod(arr, 1440, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mod(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_DAY, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":3894
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mod(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/utils.pxd":3896
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mod(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3897
 *         return arr_mod(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mod(arr, 1440, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mod(arr, 24, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mod(__pyx_v_arr, 0x5A0, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":3896
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mod(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/utils.pxd":3898
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mod(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, 24, offset)
 *     if unit in (
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":3899
 *         return arr_mod(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mod(arr, 24, offset)             # <<<<<<<<<<<<<<
 *     if unit in (
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,  # day
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mod(__pyx_v_arr, 24, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":3898
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mod(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, 24, offset)
 *     if unit in (
 */
  }

  /* "cytimes/utils.pxd":3900
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mod(arr, 24, offset)
 *     if unit in (             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,  # day
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,  # week
 */
  switch (__pyx_v_unit) {
    case NPY_FR_D:

    /* "cytimes/utils.pxd":3901
 *         return arr_mod(arr, 24, offset)
 *     if unit in (
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,  # day             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,  # week
 *         np.NPY_DATETIMEUNIT.NPY_FR_M,  # month
 */
    case NPY_FR_W:

    /* "cytimes/utils.pxd":3902
 *     if unit in (
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,  # day
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,  # week             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_M,  # month
 *         np.NPY_DATETIMEUNIT.NPY_FR_Y,  # year
 */
    case NPY_FR_M:

    /* "cytimes/utils.pxd":3903
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,  # day
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,  # week
 *         np.NPY_DATETIMEUNIT.NPY_FR_M,  # month             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_Y,  # year
 *     ):
 */
    case NPY_FR_Y:

    /* "cytimes/utils.pxd":3906
 *         np.NPY_DATETIMEUNIT.NPY_FR_Y,  # year
 *     ):
 *         if offset == 0:             # <<<<<<<<<<<<<<
 *             return arr_zero_int64(arr.shape[0])
 *         else:
 */
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":3907
 *     ):
 *         if offset == 0:
 *             return arr_zero_int64(arr.shape[0])             # <<<<<<<<<<<<<<
 *         else:
 *             return arr_full_int64(offset, arr.shape[0])
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_zero_int64((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":3906
 *         np.NPY_DATETIMEUNIT.NPY_FR_Y,  # year
 *     ):
 *         if offset == 0:             # <<<<<<<<<<<<<<
 *             return arr_zero_int64(arr.shape[0])
 *         else:
 */
    }

    /* "cytimes/utils.pxd":3909
 *             return arr_zero_int64(arr.shape[0])
 *         else:
 *             return arr_full_int64(offset, arr.shape[0])             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     unit_str = map_nptime_unit_int2str(unit)
 */
    /*else*/ {
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_full_int64(__pyx_v_offset, (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3909, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "cytimes/utils.pxd":3900
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mod(arr, 24, offset)
 *     if unit in (             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,  # day
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,  # week
 */
    break;
    default: break;
  }

  /* "cytimes/utils.pxd":3911
 *             return arr_full_int64(offset, arr.shape[0])
 *     # . unsupported
 *     unit_str = map_nptime_unit_int2str(unit)             # <<<<<<<<<<<<<<
 *     raise ValueError(
 *         "cannot access the time value from ndarray[datetime64[%s]].\n"
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_unit_str = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":3913
 *     unit_str = map_nptime_unit_int2str(unit)
 *     raise ValueError(
 *         "cannot access the time value from ndarray[datetime64[%s]].\n"             # <<<<<<<<<<<<<<
 *         "Array with dtype of 'datetime64[%s]' is not supported" % (unit_str, unit_str)
 *     )
 */
  __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 0;
  __pyx_t_6 = 127;
  __Pyx_INCREF(__pyx_kp_u_cannot_access_the_time_value_fro);
  __pyx_t_5 += 53;
  __Pyx_GIVEREF(__pyx_kp_u_cannot_access_the_time_value_fro);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_cannot_access_the_time_value_fro);

  /* "cytimes/utils.pxd":3914
 *     raise ValueError(
 *         "cannot access the time value from ndarray[datetime64[%s]].\n"
 *         "Array with dtype of 'datetime64[%s]' is not supported" % (unit_str, unit_str)             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_unit_str); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u_Array_with_dtype_of_datetime64);
  __pyx_t_5 += 36;
  __Pyx_GIVEREF(__pyx_kp_u_Array_with_dtype_of_datetime64);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_Array_with_dtype_of_datetime64);
  __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_unit_str); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u_is_not_supported_2);
  __pyx_t_5 += 19;
  __Pyx_GIVEREF(__pyx_kp_u_is_not_supported_2);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_is_not_supported_2);

  /* "cytimes/utils.pxd":3913
 *     unit_str = map_nptime_unit_int2str(unit)
 *     raise ValueError(
 *         "cannot access the time value from ndarray[datetime64[%s]].\n"             # <<<<<<<<<<<<<<
 *         "Array with dtype of 'datetime64[%s]' is not supported" % (unit_str, unit_str)
 *     )
 */
  __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":3912
 *     # . unsupported
 *     unit_str = map_nptime_unit_int2str(unit)
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "cannot access the time value from ndarray[datetime64[%s]].\n"
 *         "Array with dtype of 'datetime64[%s]' is not supported" % (unit_str, unit_str)
 */
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_ERR(0, 3912, __pyx_L1_error)

  /* "cytimes/utils.pxd":3866
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_times(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the times values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Empty array
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_times", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unit_str);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":3918
 * 
 * # . calendar
 * cdef inline np.ndarray dt64arr_isocalendar(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the ISO calendar values of the ndarray[datetime64] `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_isocalendar(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_isocalendar *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  __pyx_t_7cytimes_5utils_iso __pyx_v__iso;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  npy_intp __pyx_t_3[2];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_7;
  __pyx_t_7cytimes_5utils_iso __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_isocalendar", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3934
 *     """
 *     # Cast to int64[D]
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute days in month
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3938
 *     # Compute days in month
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(2, [size, 3], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3939
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(2, [size, 3], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_3[1] = 3;
  __pyx_t_1 = PyArray_EMPTY(2, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3939, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3939, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3940
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(2, [size, 3], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3941
 *         np.ndarray res = np.PyArray_EMPTY(2, [size, 3], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3944
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         _iso = ymd_isocalendar(_ymd.year, _ymd.month, _ymd.day)
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3945
 * 
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)             # <<<<<<<<<<<<<<
 *         _iso = ymd_isocalendar(_ymd.year, _ymd.month, _ymd.day)
 *         res_ptr[i * 3] = _iso.year
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_DAY)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3945, __pyx_L1_error)
    __pyx_v__ymd = __pyx_t_7;

    /* "cytimes/utils.pxd":3946
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         _iso = ymd_isocalendar(_ymd.year, _ymd.month, _ymd.day)             # <<<<<<<<<<<<<<
 *         res_ptr[i * 3] = _iso.year
 *         res_ptr[i * 3 + 1] = _iso.week
 */
    __pyx_t_8 = __pyx_f_7cytimes_5utils_ymd_isocalendar(__pyx_v__ymd.year, __pyx_v__ymd.month, __pyx_v__ymd.day); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3946, __pyx_L1_error)
    __pyx_v__iso = __pyx_t_8;

    /* "cytimes/utils.pxd":3947
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         _iso = ymd_isocalendar(_ymd.year, _ymd.month, _ymd.day)
 *         res_ptr[i * 3] = _iso.year             # <<<<<<<<<<<<<<
 *         res_ptr[i * 3 + 1] = _iso.week
 *         res_ptr[i * 3 + 2] = _iso.weekday
 */
    __pyx_t_9 = __pyx_v__iso.year;
    (__pyx_v_res_ptr[(__pyx_v_i * 3)]) = __pyx_t_9;

    /* "cytimes/utils.pxd":3948
 *         _iso = ymd_isocalendar(_ymd.year, _ymd.month, _ymd.day)
 *         res_ptr[i * 3] = _iso.year
 *         res_ptr[i * 3 + 1] = _iso.week             # <<<<<<<<<<<<<<
 *         res_ptr[i * 3 + 2] = _iso.weekday
 *     return res
 */
    __pyx_t_9 = __pyx_v__iso.week;
    (__pyx_v_res_ptr[((__pyx_v_i * 3) + 1)]) = __pyx_t_9;

    /* "cytimes/utils.pxd":3949
 *         res_ptr[i * 3] = _iso.year
 *         res_ptr[i * 3 + 1] = _iso.week
 *         res_ptr[i * 3 + 2] = _iso.weekday             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_9 = __pyx_v__iso.weekday;
    (__pyx_v_res_ptr[((__pyx_v_i * 3) + 2)]) = __pyx_t_9;
  }

  /* "cytimes/utils.pxd":3950
 *         res_ptr[i * 3 + 1] = _iso.week
 *         res_ptr[i * 3 + 2] = _iso.weekday
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_is_leap_year(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":3918
 * 
 * # . calendar
 * cdef inline np.ndarray dt64arr_isocalendar(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the ISO calendar values of the ndarray[datetime64] `<'ndarray[int64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_isocalendar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":3952
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_is_leap_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Check if the ndarray[datetime64] are leap years `<'ndarray[bool]'>`."""
 *     # Cast to int64[Y]
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_is_leap_year(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_is_leap_year *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_bool *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_is_leap_year", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3955
 *     """Check if the ndarray[datetime64] are leap years `<'ndarray[bool]'>`."""
 *     # Cast to int64[Y]
 *     arr = dt64arr_as_int64_Y(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Check leap year
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3959
 *     # Check leap year
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3960
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)             # <<<<<<<<<<<<<<
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_BOOL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3960, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3961
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_bool *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3962
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3965
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = is_leap_year(arr_ptr[i] + EPOCH_YEAR)
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3966
 * 
 *     for i in range(size):
 *         res_ptr[i] = is_leap_year(arr_ptr[i] + EPOCH_YEAR)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_is_leap_year(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_YEAR)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 3966, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_t_7;
  }

  /* "cytimes/utils.pxd":3967
 *     for i in range(size):
 *         res_ptr[i] = is_leap_year(arr_ptr[i] + EPOCH_YEAR)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_is_long_year(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":3952
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_is_leap_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Check if the ndarray[datetime64] are leap years `<'ndarray[bool]'>`."""
 *     # Cast to int64[Y]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_is_leap_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":3969
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_is_long_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Check if the ndarray[datetime64] are long years
 *     (maximum ISO week number equal 53) `<'ndarray[bool]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_is_long_year(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_is_long_year *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_bool *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_is_long_year", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3974
 *     """
 *     # Cast to int64[Y]
 *     arr = dt64arr_as_int64_Y(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Check long year
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3978
 *     # Check long year
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3979
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)             # <<<<<<<<<<<<<<
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_BOOL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3979, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3980
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_bool *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3981
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":3984
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = is_long_year(arr_ptr[i] + EPOCH_YEAR)
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":3985
 * 
 *     for i in range(size):
 *         res_ptr[i] = is_long_year(arr_ptr[i] + EPOCH_YEAR)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_is_long_year(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_YEAR)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 3985, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_t_7;
  }

  /* "cytimes/utils.pxd":3986
 *     for i in range(size):
 *         res_ptr[i] = is_long_year(arr_ptr[i] + EPOCH_YEAR)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_leap_bt_year(np.ndarray arr, np.npy_int64 year, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":3969
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_is_long_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Check if the ndarray[datetime64] are long years
 *     (maximum ISO week number equal 53) `<'ndarray[bool]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_is_long_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":3988
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_leap_bt_year(np.ndarray arr, np.npy_int64 year, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Calcuate the number of leap years between the ndarray[datetime64]
 *     and the passed in 'year' value `<'ndarray[int64]'>`."""
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_leap_bt_year(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_year, struct __pyx_opt_args_7cytimes_5utils_dt64arr_leap_bt_year *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_leap_bt_year", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":3992
 *     and the passed in 'year' value `<'ndarray[int64]'>`."""
 *     # Cast to int64[Y]
 *     arr = dt64arr_as_int64_Y(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute leap years
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3996
 *     # Compute leap years
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":3997
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3997, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":3998
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":3999
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":4002
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = leap_bt_year(arr_ptr[i] + EPOCH_YEAR, year)
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":4003
 * 
 *     for i in range(size):
 *         res_ptr[i] = leap_bt_year(arr_ptr[i] + EPOCH_YEAR, year)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_leap_bt_year(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_YEAR), __pyx_v_year); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 4003, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_t_7;
  }

  /* "cytimes/utils.pxd":4004
 *     for i in range(size):
 *         res_ptr[i] = leap_bt_year(arr_ptr[i] + EPOCH_YEAR, year)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_days_in_year(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":3988
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_leap_bt_year(np.ndarray arr, np.npy_int64 year, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Calcuate the number of leap years between the ndarray[datetime64]
 *     and the passed in 'year' value `<'ndarray[int64]'>`."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_leap_bt_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4006
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_in_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the maximum days (365, 366) in the year
 *     of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_in_year(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_year *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_days_in_year", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4010
 *     of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[Y]
 *     arr = dt64arr_as_int64_Y(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute days in year
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4014
 *     # Compute days in year
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":4015
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4015, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4016
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":4017
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":4020
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = days_in_year(arr_ptr[i] + EPOCH_YEAR)
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":4021
 * 
 *     for i in range(size):
 *         res_ptr[i] = days_in_year(arr_ptr[i] + EPOCH_YEAR)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_days_in_year(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_YEAR)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 4021, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_t_7;
  }

  /* "cytimes/utils.pxd":4022
 *     for i in range(size):
 *         res_ptr[i] = days_in_year(arr_ptr[i] + EPOCH_YEAR)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_days_bf_year(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4006
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_in_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the maximum days (365, 366) in the year
 *     of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_days_in_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4024
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_bf_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the np.ndarray[datetime64]
 *     and the 1st day of the 1AD `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_bf_year(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_bf_year *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_days_bf_year", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4029
 *     """
 *     # Cast to int64[Y]
 *     arr = dt64arr_as_int64_Y(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute days before year
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4033
 *     # Compute days before year
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":4034
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4034, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4035
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":4036
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":4039
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = days_bf_year(arr_ptr[i] + EPOCH_YEAR)
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":4040
 * 
 *     for i in range(size):
 *         res_ptr[i] = days_bf_year(arr_ptr[i] + EPOCH_YEAR)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_days_bf_year(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_YEAR)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 4040, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_t_7;
  }

  /* "cytimes/utils.pxd":4041
 *     for i in range(size):
 *         res_ptr[i] = days_bf_year(arr_ptr[i] + EPOCH_YEAR)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_days_of_year(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4024
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_bf_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the np.ndarray[datetime64]
 *     and the 1st day of the 1AD `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_days_bf_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4043
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_of_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the np.ndarray[datetime64]
 *     and the 1st day of the array years `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_of_year(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_of_year *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_days_of_year", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4048
 *     """
 *     # Cast to int64[D]
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute days of year
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4052
 *     # Compute days of year
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":4053
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 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(0, 4053, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4054
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":4055
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":4058
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_of_year(_ymd.year, _ymd.month, _ymd.day)
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":4059
 * 
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)             # <<<<<<<<<<<<<<
 *         res_ptr[i] = days_of_year(_ymd.year, _ymd.month, _ymd.day)
 *     return res
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_DAY)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4059, __pyx_L1_error)
    __pyx_v__ymd = __pyx_t_7;

    /* "cytimes/utils.pxd":4060
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_of_year(_ymd.year, _ymd.month, _ymd.day)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_8 = __pyx_f_7cytimes_5utils_days_of_year(__pyx_v__ymd.year, __pyx_v__ymd.month, __pyx_v__ymd.day); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 4060, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_t_8;
  }

  /* "cytimes/utils.pxd":4061
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_of_year(_ymd.year, _ymd.month, _ymd.day)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_days_in_quarter(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4043
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_of_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the np.ndarray[datetime64]
 *     and the 1st day of the array years `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_days_of_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4063
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_in_quarter(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the maximum days in the quarter of the np.npdarray[datetime64] `<'int'>`."""
 *     # Cast to int64[D]
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_in_quarter(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_quarter *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_days_in_quarter", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4066
 *     """Get the maximum days in the quarter of the np.npdarray[datetime64] `<'int'>`."""
 *     # Cast to int64[D]
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute days in quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4070
 *     # Compute days in quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":4071
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4071, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4072
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":4073
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":4076
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_in_quarter(_ymd.year, _ymd.month)
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":4077
 * 
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)             # <<<<<<<<<<<<<<
 *         res_ptr[i] = days_in_quarter(_ymd.year, _ymd.month)
 *     return res
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_DAY)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4077, __pyx_L1_error)
    __pyx_v__ymd = __pyx_t_7;

    /* "cytimes/utils.pxd":4078
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_in_quarter(_ymd.year, _ymd.month)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_8 = __pyx_f_7cytimes_5utils_days_in_quarter(__pyx_v__ymd.year, __pyx_v__ymd.month); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 4078, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_t_8;
  }

  /* "cytimes/utils.pxd":4079
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_in_quarter(_ymd.year, _ymd.month)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_days_bf_quarter(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4063
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_in_quarter(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the maximum days in the quarter of the np.npdarray[datetime64] `<'int'>`."""
 *     # Cast to int64[D]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_days_in_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4081
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_bf_quarter(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the 1st day of the year
 *     of the np.ndarray[datetime64] and the 1st day of its quarter `<'int'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_bf_quarter(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_bf_quarter *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_days_bf_quarter", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4086
 *     """
 *     # Cast to int64[D]
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute days in quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4090
 *     # Compute days in quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":4091
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4091, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4092
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":4093
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":4096
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_bf_quarter(_ymd.year, _ymd.month)
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":4097
 * 
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)             # <<<<<<<<<<<<<<
 *         res_ptr[i] = days_bf_quarter(_ymd.year, _ymd.month)
 *     return res
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_DAY)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4097, __pyx_L1_error)
    __pyx_v__ymd = __pyx_t_7;

    /* "cytimes/utils.pxd":4098
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_bf_quarter(_ymd.year, _ymd.month)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_8 = __pyx_f_7cytimes_5utils_days_bf_quarter(__pyx_v__ymd.year, __pyx_v__ymd.month); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 4098, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_t_8;
  }

  /* "cytimes/utils.pxd":4099
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_bf_quarter(_ymd.year, _ymd.month)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_days_of_quarter(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4081
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_bf_quarter(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the 1st day of the year
 *     of the np.ndarray[datetime64] and the 1st day of its quarter `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_days_bf_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4101
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_of_quarter(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the 1st day of the quarter
 *     of the np.ndarray[datetime64] and the its date `<'int'>`."""
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_of_quarter(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_of_quarter *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_days_of_quarter", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4105
 *     of the np.ndarray[datetime64] and the its date `<'int'>`."""
 *     # Cast to int64[D]
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute days in quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4109
 *     # Compute days in quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":4110
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4110, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4111
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":4112
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":4115
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_of_quarter(_ymd.year, _ymd.month, _ymd.day)
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":4116
 * 
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)             # <<<<<<<<<<<<<<
 *         res_ptr[i] = days_of_quarter(_ymd.year, _ymd.month, _ymd.day)
 *     return res
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_DAY)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4116, __pyx_L1_error)
    __pyx_v__ymd = __pyx_t_7;

    /* "cytimes/utils.pxd":4117
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_of_quarter(_ymd.year, _ymd.month, _ymd.day)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_8 = __pyx_f_7cytimes_5utils_days_of_quarter(__pyx_v__ymd.year, __pyx_v__ymd.month, __pyx_v__ymd.day); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 4117, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_t_8;
  }

  /* "cytimes/utils.pxd":4118
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_of_quarter(_ymd.year, _ymd.month, _ymd.day)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_days_in_month(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4101
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_of_quarter(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the 1st day of the quarter
 *     of the np.ndarray[datetime64] and the its date `<'int'>`."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_days_of_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4120
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_in_month(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the maximum days in the month of the ndarray[datetime64] <'ndarray[int64]'>."""
 *     # Cast to int64[M]
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_in_month(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_month *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_v;
  npy_int64 __pyx_v_mm;
  npy_int64 __pyx_v_dd;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_days_in_month", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4123
 *     """Get the maximum days in the month of the ndarray[datetime64] <'ndarray[int64]'>."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_M(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute days in month
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4127
 *     # Compute days in month
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":4128
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4128, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4129
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i, v, yy, mm, dd
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":4130
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, v, yy, mm, dd
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":4133
 *         np.npy_int64 i, v, yy, mm, dd
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         v = arr_ptr[i]
 *         mm = v % 12 + 1  # 1-based index
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":4134
 * 
 *     for i in range(size):
 *         v = arr_ptr[i]             # <<<<<<<<<<<<<<
 *         mm = v % 12 + 1  # 1-based index
 *         if not 1 < mm < 12:
 */
    __pyx_v_v = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "cytimes/utils.pxd":4135
 *     for i in range(size):
 *         v = arr_ptr[i]
 *         mm = v % 12 + 1  # 1-based index             # <<<<<<<<<<<<<<
 *         if not 1 < mm < 12:
 *             dd = 31
 */
    __pyx_v_mm = (__Pyx_mod_npy_int64(__pyx_v_v, 12) + 1);

    /* "cytimes/utils.pxd":4136
 *         v = arr_ptr[i]
 *         mm = v % 12 + 1  # 1-based index
 *         if not 1 < mm < 12:             # <<<<<<<<<<<<<<
 *             dd = 31
 *         else:
 */
    __pyx_t_7 = (1 < __pyx_v_mm);
    if (__pyx_t_7) {
      __pyx_t_7 = (__pyx_v_mm < 12);
    }
    __pyx_t_8 = (!__pyx_t_7);
    if (__pyx_t_8) {

      /* "cytimes/utils.pxd":4137
 *         mm = v % 12 + 1  # 1-based index
 *         if not 1 < mm < 12:
 *             dd = 31             # <<<<<<<<<<<<<<
 *         else:
 *             dd = DAYS_IN_MONTH[mm]
 */
      __pyx_v_dd = 31;

      /* "cytimes/utils.pxd":4136
 *         v = arr_ptr[i]
 *         mm = v % 12 + 1  # 1-based index
 *         if not 1 < mm < 12:             # <<<<<<<<<<<<<<
 *             dd = 31
 *         else:
 */
      goto __pyx_L5;
    }

    /* "cytimes/utils.pxd":4139
 *             dd = 31
 *         else:
 *             dd = DAYS_IN_MONTH[mm]             # <<<<<<<<<<<<<<
 *             if mm == 2 and is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch
 *                 dd += 1
 */
    /*else*/ {
      __pyx_v_dd = (__pyx_v_7cytimes_5utils_DAYS_IN_MONTH[__pyx_v_mm]);

      /* "cytimes/utils.pxd":4140
 *         else:
 *             dd = DAYS_IN_MONTH[mm]
 *             if mm == 2 and is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch             # <<<<<<<<<<<<<<
 *                 dd += 1
 *         res_ptr[i] = dd
 */
      __pyx_t_7 = (__pyx_v_mm == 2);
      if (__pyx_t_7) {
      } else {
        __pyx_t_8 = __pyx_t_7;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_7 = __pyx_f_7cytimes_5utils_is_leap_year((__Pyx_div_npy_int64(__pyx_v_v, 12) + __pyx_v_7cytimes_5utils_EPOCH_YEAR)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 4140, __pyx_L1_error)
      __pyx_t_8 = __pyx_t_7;
      __pyx_L7_bool_binop_done:;
      if (__pyx_t_8) {

        /* "cytimes/utils.pxd":4141
 *             dd = DAYS_IN_MONTH[mm]
 *             if mm == 2 and is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch
 *                 dd += 1             # <<<<<<<<<<<<<<
 *         res_ptr[i] = dd
 *     return res
 */
        __pyx_v_dd = (__pyx_v_dd + 1);

        /* "cytimes/utils.pxd":4140
 *         else:
 *             dd = DAYS_IN_MONTH[mm]
 *             if mm == 2 and is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch             # <<<<<<<<<<<<<<
 *                 dd += 1
 *         res_ptr[i] = dd
 */
      }
    }
    __pyx_L5:;

    /* "cytimes/utils.pxd":4142
 *             if mm == 2 and is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch
 *                 dd += 1
 *         res_ptr[i] = dd             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_v_dd;
  }

  /* "cytimes/utils.pxd":4143
 *                 dd += 1
 *         res_ptr[i] = dd
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_days_bf_month(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4120
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_in_month(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the maximum days in the month of the ndarray[datetime64] <'ndarray[int64]'>."""
 *     # Cast to int64[M]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_days_in_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4145
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_bf_month(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the 1st day of the
 *     np.ndarray[datetime64] and the 1st day of its month `<'int'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_bf_month(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_bf_month *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_v;
  npy_int64 __pyx_v_mm;
  npy_int64 __pyx_v_dd;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_days_bf_month", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4150
 *     """
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_M(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute days before month
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4154
 *     # Compute days before month
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":4155
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4155, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4156
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i, v, yy, mm, dd
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":4157
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, v, yy, mm, dd
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":4160
 *         np.npy_int64 i, v, yy, mm, dd
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         v = arr_ptr[i]
 *         mm = v % 12 + 1  # 1-based index
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":4161
 * 
 *     for i in range(size):
 *         v = arr_ptr[i]             # <<<<<<<<<<<<<<
 *         mm = v % 12 + 1  # 1-based index
 *         if mm <= 0:
 */
    __pyx_v_v = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "cytimes/utils.pxd":4162
 *     for i in range(size):
 *         v = arr_ptr[i]
 *         mm = v % 12 + 1  # 1-based index             # <<<<<<<<<<<<<<
 *         if mm <= 0:
 *             dd = 0
 */
    __pyx_v_mm = (__Pyx_mod_npy_int64(__pyx_v_v, 12) + 1);

    /* "cytimes/utils.pxd":4163
 *         v = arr_ptr[i]
 *         mm = v % 12 + 1  # 1-based index
 *         if mm <= 0:             # <<<<<<<<<<<<<<
 *             dd = 0
 *         elif mm == 2:
 */
    __pyx_t_7 = (__pyx_v_mm <= 0);
    if (__pyx_t_7) {

      /* "cytimes/utils.pxd":4164
 *         mm = v % 12 + 1  # 1-based index
 *         if mm <= 0:
 *             dd = 0             # <<<<<<<<<<<<<<
 *         elif mm == 2:
 *             dd = 31
 */
      __pyx_v_dd = 0;

      /* "cytimes/utils.pxd":4163
 *         v = arr_ptr[i]
 *         mm = v % 12 + 1  # 1-based index
 *         if mm <= 0:             # <<<<<<<<<<<<<<
 *             dd = 0
 *         elif mm == 2:
 */
      goto __pyx_L5;
    }

    /* "cytimes/utils.pxd":4165
 *         if mm <= 0:
 *             dd = 0
 *         elif mm == 2:             # <<<<<<<<<<<<<<
 *             dd = 31
 *         else:
 */
    __pyx_t_7 = (__pyx_v_mm == 2);
    if (__pyx_t_7) {

      /* "cytimes/utils.pxd":4166
 *             dd = 0
 *         elif mm == 2:
 *             dd = 31             # <<<<<<<<<<<<<<
 *         else:
 *             dd = DAYS_BR_MONTH[mm - 1]
 */
      __pyx_v_dd = 31;

      /* "cytimes/utils.pxd":4165
 *         if mm <= 0:
 *             dd = 0
 *         elif mm == 2:             # <<<<<<<<<<<<<<
 *             dd = 31
 *         else:
 */
      goto __pyx_L5;
    }

    /* "cytimes/utils.pxd":4168
 *             dd = 31
 *         else:
 *             dd = DAYS_BR_MONTH[mm - 1]             # <<<<<<<<<<<<<<
 *             if is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch
 *                 dd += 1
 */
    /*else*/ {
      __pyx_v_dd = (__pyx_v_7cytimes_5utils_DAYS_BR_MONTH[(__pyx_v_mm - 1)]);

      /* "cytimes/utils.pxd":4169
 *         else:
 *             dd = DAYS_BR_MONTH[mm - 1]
 *             if is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch             # <<<<<<<<<<<<<<
 *                 dd += 1
 *         res_ptr[i] = dd
 */
      __pyx_t_7 = __pyx_f_7cytimes_5utils_is_leap_year((__Pyx_div_npy_int64(__pyx_v_v, 12) + __pyx_v_7cytimes_5utils_EPOCH_YEAR)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 4169, __pyx_L1_error)
      if (__pyx_t_7) {

        /* "cytimes/utils.pxd":4170
 *             dd = DAYS_BR_MONTH[mm - 1]
 *             if is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch
 *                 dd += 1             # <<<<<<<<<<<<<<
 *         res_ptr[i] = dd
 *     return res
 */
        __pyx_v_dd = (__pyx_v_dd + 1);

        /* "cytimes/utils.pxd":4169
 *         else:
 *             dd = DAYS_BR_MONTH[mm - 1]
 *             if is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch             # <<<<<<<<<<<<<<
 *                 dd += 1
 *         res_ptr[i] = dd
 */
      }
    }
    __pyx_L5:;

    /* "cytimes/utils.pxd":4171
 *             if is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch
 *                 dd += 1
 *         res_ptr[i] = dd             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_v_dd;
  }

  /* "cytimes/utils.pxd":4172
 *                 dd += 1
 *         res_ptr[i] = dd
 *     return res             # <<<<<<<<<<<<<<
 * 
 * # . conversion: int64
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4145
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_bf_month(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the 1st day of the
 *     np.ndarray[datetime64] and the 1st day of its month `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_days_bf_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4175
 * 
 * # . conversion: int64
 * cdef inline np.ndarray dt64arr_fr_int64(np.npy_int64 val, str unit, np.npy_int64 size):             # <<<<<<<<<<<<<<
 *     """Create an ndarray[datetime64] from the passed in
 *     integer and array size `<'ndarray[datetime64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_fr_int64(npy_int64 __pyx_v_val, PyObject *__pyx_v_unit, npy_int64 __pyx_v_size) {
  PyArrayObject *__pyx_v_arr = 0;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  unsigned int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_fr_int64", 0);
  __Pyx_INCREF(__pyx_v_unit);

  /* "cytimes/utils.pxd":4183
 *     """
 *     # Validate
 *     if size < 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("array size must be greater than 0.")
 *     unit = map_nptime_unit_int2str(map_nptime_unit_str2int(unit))
 */
  __pyx_t_1 = (__pyx_v_size < 1);
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":4184
 *     # Validate
 *     if size < 1:
 *         raise ValueError("array size must be greater than 0.")             # <<<<<<<<<<<<<<
 *     unit = map_nptime_unit_int2str(map_nptime_unit_str2int(unit))
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 4184, __pyx_L1_error)

    /* "cytimes/utils.pxd":4183
 *     """
 *     # Validate
 *     if size < 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("array size must be greater than 0.")
 *     unit = map_nptime_unit_int2str(map_nptime_unit_str2int(unit))
 */
  }

  /* "cytimes/utils.pxd":4185
 *     if size < 1:
 *         raise ValueError("array size must be greater than 0.")
 *     unit = map_nptime_unit_int2str(map_nptime_unit_str2int(unit))             # <<<<<<<<<<<<<<
 * 
 *     # New array
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_unit); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 4185, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_unit, ((PyObject*)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":4189
 *     # New array
 *     cdef:
 *         np.ndarray arr = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_t_4[0] = __pyx_v_size;
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4189, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":4190
 *     cdef:
 *         np.ndarray arr = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":4193
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         arr_ptr[i] = val
 *     return arr.astype("datetime64[%s]" % unit)
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "cytimes/utils.pxd":4194
 * 
 *     for i in range(size):
 *         arr_ptr[i] = val             # <<<<<<<<<<<<<<
 *     return arr.astype("datetime64[%s]" % unit)
 * 
 */
    (__pyx_v_arr_ptr[__pyx_v_i]) = __pyx_v_val;
  }

  /* "cytimes/utils.pxd":4195
 *     for i in range(size):
 *         arr_ptr[i] = val
 *     return arr.astype("datetime64[%s]" % unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64(np.ndarray arr, str unit, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_unit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_9};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4195, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4175
 * 
 * # . conversion: int64
 * cdef inline np.ndarray dt64arr_fr_int64(np.npy_int64 val, str unit, np.npy_int64 size):             # <<<<<<<<<<<<<<
 *     """Create an ndarray[datetime64] from the passed in
 *     integer and array size `<'ndarray[datetime64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_fr_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_unit);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4197
 *     return arr.astype("datetime64[%s]" % unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64(np.ndarray arr, str unit, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 according to the given
 *     'unit' resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_unit, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  Py_ssize_t __pyx_v_size;
  Py_UCS4 __pyx_v_ch;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_UCS4 __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_s __pyx_t_4;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_m __pyx_t_5;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_h __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_W __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Q __pyx_t_10;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_11;
  int __pyx_t_12;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ns __pyx_t_13;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_us __pyx_t_14;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ms __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "cytimes/utils.pxd":4207
 *     """
 *     cdef:
 *         Py_ssize_t size = str_len(unit)             # <<<<<<<<<<<<<<
 *         Py_UCS4 ch
 * 
 */
  __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_unit);

  /* "cytimes/utils.pxd":4211
 * 
 *     # Unit: 's', 'm', 'h', 'D'/'d', 'M', 'Y'
 *     if size == 1:             # <<<<<<<<<<<<<<
 *         ch = str_read(unit, 0)
 *         if ch == "s":
 */
  __pyx_t_1 = (__pyx_v_size == 1);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4212
 *     # Unit: 's', 'm', 'h', 'D'/'d', 'M', 'Y'
 *     if size == 1:
 *         ch = str_read(unit, 0)             # <<<<<<<<<<<<<<
 *         if ch == "s":
 *             return dt64arr_as_int64_s(arr, arr_unit, offset)
 */
    __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_unit, 0); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(0, 4212, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_2;

    /* "cytimes/utils.pxd":4213
 *     if size == 1:
 *         ch = str_read(unit, 0)
 *         if ch == "s":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_s(arr, arr_unit, offset)
 *         if ch == "m":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x73);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4214
 *         ch = str_read(unit, 0)
 *         if ch == "s":
 *             return dt64arr_as_int64_s(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 *         if ch == "m":
 *             return dt64arr_as_int64_m(arr, arr_unit, offset)
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_4.__pyx_n = 2;
      __pyx_t_4.arr_unit = __pyx_v_arr_unit;
      __pyx_t_4.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_s(__pyx_v_arr, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":4213
 *     if size == 1:
 *         ch = str_read(unit, 0)
 *         if ch == "s":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_s(arr, arr_unit, offset)
 *         if ch == "m":
 */
    }

    /* "cytimes/utils.pxd":4215
 *         if ch == "s":
 *             return dt64arr_as_int64_s(arr, arr_unit, offset)
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_m(arr, arr_unit, offset)
 *         if ch == "h":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x6D);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4216
 *             return dt64arr_as_int64_s(arr, arr_unit, offset)
 *         if ch == "m":
 *             return dt64arr_as_int64_m(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 *         if ch == "h":
 *             return dt64arr_as_int64_h(arr, arr_unit, offset)
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_5.__pyx_n = 2;
      __pyx_t_5.arr_unit = __pyx_v_arr_unit;
      __pyx_t_5.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_m(__pyx_v_arr, &__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":4215
 *         if ch == "s":
 *             return dt64arr_as_int64_s(arr, arr_unit, offset)
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_m(arr, arr_unit, offset)
 *         if ch == "h":
 */
    }

    /* "cytimes/utils.pxd":4217
 *         if ch == "m":
 *             return dt64arr_as_int64_m(arr, arr_unit, offset)
 *         if ch == "h":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_h(arr, arr_unit, offset)
 *         if ch in ("D", "d"):
 */
    __pyx_t_1 = (__pyx_v_ch == 0x68);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4218
 *             return dt64arr_as_int64_m(arr, arr_unit, offset)
 *         if ch == "h":
 *             return dt64arr_as_int64_h(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 *         if ch in ("D", "d"):
 *             return dt64arr_as_int64_D(arr, arr_unit, offset)
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_6.__pyx_n = 2;
      __pyx_t_6.arr_unit = __pyx_v_arr_unit;
      __pyx_t_6.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_h(__pyx_v_arr, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":4217
 *         if ch == "m":
 *             return dt64arr_as_int64_m(arr, arr_unit, offset)
 *         if ch == "h":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_h(arr, arr_unit, offset)
 *         if ch in ("D", "d"):
 */
    }

    /* "cytimes/utils.pxd":4219
 *         if ch == "h":
 *             return dt64arr_as_int64_h(arr, arr_unit, offset)
 *         if ch in ("D", "d"):             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_D(arr, arr_unit, offset)
 *         if ch == "W":
 */
    switch (__pyx_v_ch) {
      case 68:
      case 0x64:

      /* "cytimes/utils.pxd":4220
 *             return dt64arr_as_int64_h(arr, arr_unit, offset)
 *         if ch in ("D", "d"):
 *             return dt64arr_as_int64_D(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 *         if ch == "W":
 *             return dt64arr_as_int64_W(arr, arr_unit, offset)
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_7.__pyx_n = 2;
      __pyx_t_7.arr_unit = __pyx_v_arr_unit;
      __pyx_t_7.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4220, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":4219
 *         if ch == "h":
 *             return dt64arr_as_int64_h(arr, arr_unit, offset)
 *         if ch in ("D", "d"):             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_D(arr, arr_unit, offset)
 *         if ch == "W":
 */
      break;
      default: break;
    }

    /* "cytimes/utils.pxd":4221
 *         if ch in ("D", "d"):
 *             return dt64arr_as_int64_D(arr, arr_unit, offset)
 *         if ch == "W":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_W(arr, arr_unit, offset)
 *         if ch == "M":
 */
    __pyx_t_1 = (__pyx_v_ch == 87);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4222
 *             return dt64arr_as_int64_D(arr, arr_unit, offset)
 *         if ch == "W":
 *             return dt64arr_as_int64_W(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 *         if ch == "M":
 *             return dt64arr_as_int64_M(arr, arr_unit, offset)
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_8.__pyx_n = 2;
      __pyx_t_8.arr_unit = __pyx_v_arr_unit;
      __pyx_t_8.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_W(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":4221
 *         if ch in ("D", "d"):
 *             return dt64arr_as_int64_D(arr, arr_unit, offset)
 *         if ch == "W":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_W(arr, arr_unit, offset)
 *         if ch == "M":
 */
    }

    /* "cytimes/utils.pxd":4223
 *         if ch == "W":
 *             return dt64arr_as_int64_W(arr, arr_unit, offset)
 *         if ch == "M":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_M(arr, arr_unit, offset)
 *         if ch == "Q":
 */
    __pyx_t_1 = (__pyx_v_ch == 77);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4224
 *             return dt64arr_as_int64_W(arr, arr_unit, offset)
 *         if ch == "M":
 *             return dt64arr_as_int64_M(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 *         if ch == "Q":
 *             return dt64arr_as_int64_Q(arr, arr_unit, offset)
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_9.__pyx_n = 2;
      __pyx_t_9.arr_unit = __pyx_v_arr_unit;
      __pyx_t_9.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":4223
 *         if ch == "W":
 *             return dt64arr_as_int64_W(arr, arr_unit, offset)
 *         if ch == "M":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_M(arr, arr_unit, offset)
 *         if ch == "Q":
 */
    }

    /* "cytimes/utils.pxd":4225
 *         if ch == "M":
 *             return dt64arr_as_int64_M(arr, arr_unit, offset)
 *         if ch == "Q":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_Q(arr, arr_unit, offset)
 *         if ch == "Y":
 */
    __pyx_t_1 = (__pyx_v_ch == 81);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4226
 *             return dt64arr_as_int64_M(arr, arr_unit, offset)
 *         if ch == "Q":
 *             return dt64arr_as_int64_Q(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 *         if ch == "Y":
 *             return dt64arr_as_int64_Y(arr, arr_unit, offset)
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_10.__pyx_n = 2;
      __pyx_t_10.arr_unit = __pyx_v_arr_unit;
      __pyx_t_10.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Q(__pyx_v_arr, &__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":4225
 *         if ch == "M":
 *             return dt64arr_as_int64_M(arr, arr_unit, offset)
 *         if ch == "Q":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_Q(arr, arr_unit, offset)
 *         if ch == "Y":
 */
    }

    /* "cytimes/utils.pxd":4227
 *         if ch == "Q":
 *             return dt64arr_as_int64_Q(arr, arr_unit, offset)
 *         if ch == "Y":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_Y(arr, arr_unit, offset)
 * 
 */
    __pyx_t_1 = (__pyx_v_ch == 89);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4228
 *             return dt64arr_as_int64_Q(arr, arr_unit, offset)
 *         if ch == "Y":
 *             return dt64arr_as_int64_Y(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 * 
 *     # Unit: 'ns', 'us', 'ms'
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_11.__pyx_n = 2;
      __pyx_t_11.arr_unit = __pyx_v_arr_unit;
      __pyx_t_11.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":4227
 *         if ch == "Q":
 *             return dt64arr_as_int64_Q(arr, arr_unit, offset)
 *         if ch == "Y":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_Y(arr, arr_unit, offset)
 * 
 */
    }

    /* "cytimes/utils.pxd":4211
 * 
 *     # Unit: 's', 'm', 'h', 'D'/'d', 'M', 'Y'
 *     if size == 1:             # <<<<<<<<<<<<<<
 *         ch = str_read(unit, 0)
 *         if ch == "s":
 */
    goto __pyx_L3;
  }

  /* "cytimes/utils.pxd":4231
 * 
 *     # Unit: 'ns', 'us', 'ms'
 *     elif size == 2 and str_read(unit, 1) == "s":             # <<<<<<<<<<<<<<
 *         ch = str_read(unit, 0)
 *         if ch == "n":
 */
  __pyx_t_12 = (__pyx_v_size == 2);
  if (__pyx_t_12) {
  } else {
    __pyx_t_1 = __pyx_t_12;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_unit, 1); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(0, 4231, __pyx_L1_error)
  __pyx_t_12 = (__pyx_t_2 == 0x73);
  __pyx_t_1 = __pyx_t_12;
  __pyx_L11_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4232
 *     # Unit: 'ns', 'us', 'ms'
 *     elif size == 2 and str_read(unit, 1) == "s":
 *         ch = str_read(unit, 0)             # <<<<<<<<<<<<<<
 *         if ch == "n":
 *             return dt64arr_as_int64_ns(arr, arr_unit, offset)
 */
    __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_unit, 0); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(0, 4232, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_2;

    /* "cytimes/utils.pxd":4233
 *     elif size == 2 and str_read(unit, 1) == "s":
 *         ch = str_read(unit, 0)
 *         if ch == "n":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_ns(arr, arr_unit, offset)
 *         if ch == "u":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x6E);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4234
 *         ch = str_read(unit, 0)
 *         if ch == "n":
 *             return dt64arr_as_int64_ns(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 *         if ch == "u":
 *             return dt64arr_as_int64_us(arr, arr_unit, offset)
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_13.__pyx_n = 2;
      __pyx_t_13.arr_unit = __pyx_v_arr_unit;
      __pyx_t_13.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_ns(__pyx_v_arr, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":4233
 *     elif size == 2 and str_read(unit, 1) == "s":
 *         ch = str_read(unit, 0)
 *         if ch == "n":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_ns(arr, arr_unit, offset)
 *         if ch == "u":
 */
    }

    /* "cytimes/utils.pxd":4235
 *         if ch == "n":
 *             return dt64arr_as_int64_ns(arr, arr_unit, offset)
 *         if ch == "u":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_us(arr, arr_unit, offset)
 *         if ch == "m":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x75);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4236
 *             return dt64arr_as_int64_ns(arr, arr_unit, offset)
 *         if ch == "u":
 *             return dt64arr_as_int64_us(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 *         if ch == "m":
 *             return dt64arr_as_int64_ms(arr, arr_unit, offset)
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_14.__pyx_n = 2;
      __pyx_t_14.arr_unit = __pyx_v_arr_unit;
      __pyx_t_14.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_us(__pyx_v_arr, &__pyx_t_14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":4235
 *         if ch == "n":
 *             return dt64arr_as_int64_ns(arr, arr_unit, offset)
 *         if ch == "u":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_us(arr, arr_unit, offset)
 *         if ch == "m":
 */
    }

    /* "cytimes/utils.pxd":4237
 *         if ch == "u":
 *             return dt64arr_as_int64_us(arr, arr_unit, offset)
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_ms(arr, arr_unit, offset)
 * 
 */
    __pyx_t_1 = (__pyx_v_ch == 0x6D);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4238
 *             return dt64arr_as_int64_us(arr, arr_unit, offset)
 *         if ch == "m":
 *             return dt64arr_as_int64_ms(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 * 
 *     # Unit: 'min' for pandas compatibility
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_15.__pyx_n = 2;
      __pyx_t_15.arr_unit = __pyx_v_arr_unit;
      __pyx_t_15.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_ms(__pyx_v_arr, &__pyx_t_15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4238, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":4237
 *         if ch == "u":
 *             return dt64arr_as_int64_us(arr, arr_unit, offset)
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_ms(arr, arr_unit, offset)
 * 
 */
    }

    /* "cytimes/utils.pxd":4231
 * 
 *     # Unit: 'ns', 'us', 'ms'
 *     elif size == 2 and str_read(unit, 1) == "s":             # <<<<<<<<<<<<<<
 *         ch = str_read(unit, 0)
 *         if ch == "n":
 */
    goto __pyx_L3;
  }

  /* "cytimes/utils.pxd":4241
 * 
 *     # Unit: 'min' for pandas compatibility
 *     elif size == 3 and unit == "min":             # <<<<<<<<<<<<<<
 *         return dt64arr_as_int64_m(arr, arr_unit, offset)
 * 
 */
  __pyx_t_12 = (__pyx_v_size == 3);
  if (__pyx_t_12) {
  } else {
    __pyx_t_1 = __pyx_t_12;
    goto __pyx_L16_bool_binop_done;
  }
  __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_min, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 4241, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_12;
  __pyx_L16_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4242
 *     # Unit: 'min' for pandas compatibility
 *     elif size == 3 and unit == "min":
 *         return dt64arr_as_int64_m(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 * 
 *     # Unsupported unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5.__pyx_n = 2;
    __pyx_t_5.arr_unit = __pyx_v_arr_unit;
    __pyx_t_5.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_m(__pyx_v_arr, &__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4241
 * 
 *     # Unit: 'min' for pandas compatibility
 *     elif size == 3 and unit == "min":             # <<<<<<<<<<<<<<
 *         return dt64arr_as_int64_m(arr, arr_unit, offset)
 * 
 */
  }
  __pyx_L3:;

  /* "cytimes/utils.pxd":4246
 *     # Unsupported unit
 *     raise ValueError(
 *         "cannot cast <'ndarray[%s]'> to int64 under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *         "Supported resolutions: ['Y', 'M', 'D', 'h', 'm', 's', 'ms', 'us', 'ns']." % (arr.dtype, unit)
 *     )
 */
  __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_16 = 0;
  __pyx_t_2 = 127;
  __Pyx_INCREF(__pyx_kp_u_cannot_cast_ndarray);
  __pyx_t_16 += 22;
  __Pyx_GIVEREF(__pyx_kp_u_cannot_cast_ndarray);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_cannot_cast_ndarray);

  /* "cytimes/utils.pxd":4247
 *     raise ValueError(
 *         "cannot cast <'ndarray[%s]'> to int64 under '%s' resolution.\n"
 *         "Supported resolutions: ['Y', 'M', 'D', 'h', 'm', 's', 'ms', 'us', 'ns']." % (arr.dtype, unit)             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 4247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_17), __pyx_empty_unicode); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_2 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_18) > __pyx_t_2) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_18) : __pyx_t_2;
  __pyx_t_16 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_18);
  __Pyx_GIVEREF(__pyx_t_18);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_18);
  __pyx_t_18 = 0;
  __Pyx_INCREF(__pyx_kp_u_to_int64_under);
  __pyx_t_16 += 20;
  __Pyx_GIVEREF(__pyx_kp_u_to_int64_under);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_to_int64_under);
  __pyx_t_18 = __Pyx_PyUnicode_Unicode(__pyx_v_unit); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_2 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_18) > __pyx_t_2) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_18) : __pyx_t_2;
  __pyx_t_16 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_18);
  __Pyx_GIVEREF(__pyx_t_18);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_18);
  __pyx_t_18 = 0;
  __Pyx_INCREF(__pyx_kp_u_resolution_Supported_resolution);
  __pyx_t_16 += 86;
  __Pyx_GIVEREF(__pyx_kp_u_resolution_Supported_resolution);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_resolution_Supported_resolution);

  /* "cytimes/utils.pxd":4246
 *     # Unsupported unit
 *     raise ValueError(
 *         "cannot cast <'ndarray[%s]'> to int64 under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *         "Supported resolutions: ['Y', 'M', 'D', 'h', 'm', 's', 'ms', 'us', 'ns']." % (arr.dtype, unit)
 *     )
 */
  __pyx_t_18 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_16, __pyx_t_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 4246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":4245
 * 
 *     # Unsupported unit
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "cannot cast <'ndarray[%s]'> to int64 under '%s' resolution.\n"
 *         "Supported resolutions: ['Y', 'M', 'D', 'h', 'm', 's', 'ms', 'us', 'ns']." % (arr.dtype, unit)
 */
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_18); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_ERR(0, 4245, __pyx_L1_error)

  /* "cytimes/utils.pxd":4197
 *     return arr.astype("datetime64[%s]" % unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64(np.ndarray arr, str unit, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 according to the given
 *     'unit' resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4250
 *     )
 * 
 * cdef inline np.ndarray dt64arr_as_int64_Y(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'Y' (year)
 *     resolution `<'ndarray[int64]>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_n;
  npy_int64 __pyx_v_n400;
  npy_int64 __pyx_v_n100;
  npy_int64 __pyx_v_n4;
  npy_int64 __pyx_v_n1;
  npy_int64 __pyx_v_year;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  npy_intp __pyx_t_5[1];
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  int __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_Y", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4258
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4259
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4258
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "cytimes/utils.pxd":4263
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "cytimes/utils.pxd":4264
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4265
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4266
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_Y_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4266, __pyx_L1_error)

      /* "cytimes/utils.pxd":4265
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "cytimes/utils.pxd":4267
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4267, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4268
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.pxd":4264
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4269
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4270
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4270, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4269
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4272
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4272, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "cytimes/utils.pxd":4276
 * 
 *     # Fast-path: datetime64[Y]
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4277
 *     # Fast-path: datetime64[Y]
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *         return arr if offset == 0 else arr_add(arr, offset)
 */
    __pyx_t_1 = (__pyx_v_dtype == NPY_DATETIME);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4278
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 *         return arr if offset == 0 else arr_add(arr, offset)
 * 
 */
      __pyx_t_3 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4278, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/utils.pxd":4277
 *     # Fast-path: datetime64[Y]
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *         return arr if offset == 0 else arr_add(arr, offset)
 */
    }

    /* "cytimes/utils.pxd":4279
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *         return arr if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 * 
 *     # Fast-path: datetime64[M]
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_t_3 = ((PyObject *)__pyx_v_arr);
    } else {
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __pyx_t_4 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4276
 * 
 *     # Fast-path: datetime64[Y]
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 */
  }

  /* "cytimes/utils.pxd":4282
 * 
 *     # Fast-path: datetime64[M]
 *     cdef np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *     cdef np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *     cdef np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":4283
 *     # Fast-path: datetime64[M]
 *     cdef np.npy_int64 size = arr.shape[0]
 *     cdef np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *     cdef np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *     cdef np.npy_int64* arr_ptr
 */
  __pyx_t_5[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_5, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4283, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":4284
 *     cdef np.npy_int64 size = arr.shape[0]
 *     cdef np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *     cdef np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *     cdef np.npy_int64* arr_ptr
 *     cdef np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":4287
 *     cdef np.npy_int64* arr_ptr
 *     cdef np.npy_int64 i
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:             # <<<<<<<<<<<<<<
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         for i in range(size):
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4288
 *     cdef np.npy_int64 i
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         for i in range(size):
 *             res_ptr[i] = arr_ptr[i] // 12 + offset
 */
    __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

    /* "cytimes/utils.pxd":4289
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             res_ptr[i] = arr_ptr[i] // 12 + offset
 *         return res
 */
    __pyx_t_6 = __pyx_v_size;
    __pyx_t_7 = __pyx_t_6;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "cytimes/utils.pxd":4290
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         for i in range(size):
 *             res_ptr[i] = arr_ptr[i] // 12 + offset             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
      (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_div_npy_int64((__pyx_v_arr_ptr[__pyx_v_i]), 12) + __pyx_v_offset);
    }

    /* "cytimes/utils.pxd":4291
 *         for i in range(size):
 *             res_ptr[i] = arr_ptr[i] // 12 + offset
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     # All the rest resolutions
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_res);
    __pyx_r = __pyx_v_res;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4287
 *     cdef np.npy_int64* arr_ptr
 *     cdef np.npy_int64 i
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:             # <<<<<<<<<<<<<<
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         for i in range(size):
 */
  }

  /* "cytimes/utils.pxd":4295
 *     # All the rest resolutions
 *     cdef np.npy_int64 n, n400, n100, n4, n1, year
 *     if unit not in (             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
  switch (__pyx_v_unit) {
    case NPY_FR_ns:

    /* "cytimes/utils.pxd":4296
 *     cdef np.npy_int64 n, n400, n100, n4, n1, year
 *     if unit not in (
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,
 */
    case NPY_FR_us:

    /* "cytimes/utils.pxd":4297
 *     if unit not in (
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,
 */
    case NPY_FR_ms:

    /* "cytimes/utils.pxd":4298
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,
 */
    case NPY_FR_s:

    /* "cytimes/utils.pxd":4299
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,
 *         np.NPY_DATETIMEUNIT.NPY_FR_h,
 */
    case NPY_FR_m:

    /* "cytimes/utils.pxd":4300
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_h,
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,
 */
    case NPY_FR_h:

    /* "cytimes/utils.pxd":4301
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,
 *         np.NPY_DATETIMEUNIT.NPY_FR_h,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,
 */
    case NPY_FR_D:

    /* "cytimes/utils.pxd":4302
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,
 *         np.NPY_DATETIMEUNIT.NPY_FR_h,
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,
 *     ):
 */
    case NPY_FR_W:

    /* "cytimes/utils.pxd":4295
 *     # All the rest resolutions
 *     cdef np.npy_int64 n, n400, n100, n4, n1, year
 *     if unit not in (             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
    __pyx_t_1 = 0;
    break;
    default:
    __pyx_t_1 = 1;
    break;
  }
  __pyx_t_9 = __pyx_t_1;
  if (__pyx_t_9) {

    /* "cytimes/utils.pxd":4305
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,
 *     ):
 *         _raise_dt64arr_as_int64_unit_error("Y", unit)             # <<<<<<<<<<<<<<
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)
 *     arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
    __pyx_t_9 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_Y, __pyx_v_unit, NULL); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 4305, __pyx_L1_error)

    /* "cytimes/utils.pxd":4295
 *     # All the rest resolutions
 *     cdef np.npy_int64 n, n400, n100, n4, n1, year
 *     if unit not in (             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
  }

  /* "cytimes/utils.pxd":4306
 *     ):
 *         _raise_dt64arr_as_int64_unit_error("Y", unit)
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *     arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *     for i in range(size):
 */
  __pyx_t_10.__pyx_n = 2;
  __pyx_t_10.arr_unit = __pyx_v_arr_unit;
  __pyx_t_10.offset = 0;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":4307
 *         _raise_dt64arr_as_int64_unit_error("Y", unit)
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)
 *     arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *     for i in range(size):
 *         # Convert to ordinal
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":4308
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)
 *     arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         # Convert to ordinal
 *         n = arr_ptr[i] + EPOCH_DAY - 1
 */
  __pyx_t_6 = __pyx_v_size;
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "cytimes/utils.pxd":4310
 *     for i in range(size):
 *         # Convert to ordinal
 *         n = arr_ptr[i] + EPOCH_DAY - 1             # <<<<<<<<<<<<<<
 *         # Number of complete 400-year cycles
 *         n400 = n // 146_097
 */
    __pyx_v_n = (((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_DAY) - 1);

    /* "cytimes/utils.pxd":4312
 *         n = arr_ptr[i] + EPOCH_DAY - 1
 *         # Number of complete 400-year cycles
 *         n400 = n // 146_097             # <<<<<<<<<<<<<<
 *         n -= n400 * 146_097
 *         # Number of complete 100-year cycles within the 400-year cycle
 */
    __pyx_v_n400 = __Pyx_div_npy_int64(__pyx_v_n, 0x23AB1);

    /* "cytimes/utils.pxd":4313
 *         # Number of complete 400-year cycles
 *         n400 = n // 146_097
 *         n -= n400 * 146_097             # <<<<<<<<<<<<<<
 *         # Number of complete 100-year cycles within the 400-year cycle
 *         n100 = n // 36_524
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n400 * 0x23AB1));

    /* "cytimes/utils.pxd":4315
 *         n -= n400 * 146_097
 *         # Number of complete 100-year cycles within the 400-year cycle
 *         n100 = n // 36_524             # <<<<<<<<<<<<<<
 *         n -= n100 * 36_524
 *         # Number of complete 4-year cycles within the 100-year cycle
 */
    __pyx_v_n100 = __Pyx_div_npy_int64(__pyx_v_n, 0x8EAC);

    /* "cytimes/utils.pxd":4316
 *         # Number of complete 100-year cycles within the 400-year cycle
 *         n100 = n // 36_524
 *         n -= n100 * 36_524             # <<<<<<<<<<<<<<
 *         # Number of complete 4-year cycles within the 100-year cycle
 *         n4 = n // 1_461
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n100 * 0x8EAC));

    /* "cytimes/utils.pxd":4318
 *         n -= n100 * 36_524
 *         # Number of complete 4-year cycles within the 100-year cycle
 *         n4 = n // 1_461             # <<<<<<<<<<<<<<
 *         n -= n4 * 1_461
 *         # Number of complete years within the 4-year cycle
 */
    __pyx_v_n4 = __Pyx_div_npy_int64(__pyx_v_n, 0x5B5);

    /* "cytimes/utils.pxd":4319
 *         # Number of complete 4-year cycles within the 100-year cycle
 *         n4 = n // 1_461
 *         n -= n4 * 1_461             # <<<<<<<<<<<<<<
 *         # Number of complete years within the 4-year cycle
 *         n1 = n // 365
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n4 * 0x5B5));

    /* "cytimes/utils.pxd":4321
 *         n -= n4 * 1_461
 *         # Number of complete years within the 4-year cycle
 *         n1 = n // 365             # <<<<<<<<<<<<<<
 *         n -= n1 * 365
 *         # Compute the year
 */
    __pyx_v_n1 = __Pyx_div_npy_int64(__pyx_v_n, 0x16D);

    /* "cytimes/utils.pxd":4322
 *         # Number of complete years within the 4-year cycle
 *         n1 = n // 365
 *         n -= n1 * 365             # <<<<<<<<<<<<<<
 *         # Compute the year
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1 + 1
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n1 * 0x16D));

    /* "cytimes/utils.pxd":4324
 *         n -= n1 * 365
 *         # Compute the year
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1 + 1             # <<<<<<<<<<<<<<
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:
 */
    __pyx_v_year = (((((__pyx_v_n400 * 0x190) + (__pyx_v_n100 * 0x64)) + (__pyx_v_n4 * 4)) + __pyx_v_n1) + 1);

    /* "cytimes/utils.pxd":4326
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1 + 1
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:             # <<<<<<<<<<<<<<
 *             year -= 1
 *         res_ptr[i] = year - EPOCH_YEAR + offset
 */
    __pyx_t_1 = (__pyx_v_n100 == 4);
    if (!__pyx_t_1) {
    } else {
      __pyx_t_9 = __pyx_t_1;
      goto __pyx_L15_bool_binop_done;
    }
    __pyx_t_1 = (__pyx_v_n1 == 4);
    __pyx_t_9 = __pyx_t_1;
    __pyx_L15_bool_binop_done:;
    if (__pyx_t_9) {

      /* "cytimes/utils.pxd":4327
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:
 *             year -= 1             # <<<<<<<<<<<<<<
 *         res_ptr[i] = year - EPOCH_YEAR + offset
 *     return res
 */
      __pyx_v_year = (__pyx_v_year - 1);

      /* "cytimes/utils.pxd":4326
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1 + 1
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:             # <<<<<<<<<<<<<<
 *             year -= 1
 *         res_ptr[i] = year - EPOCH_YEAR + offset
 */
    }

    /* "cytimes/utils.pxd":4328
 *         if n100 == 4 or n1 == 4:
 *             year -= 1
 *         res_ptr[i] = year - EPOCH_YEAR + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__pyx_v_year - __pyx_v_7cytimes_5utils_EPOCH_YEAR) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":4329
 *             year -= 1
 *         res_ptr[i] = year - EPOCH_YEAR + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_Q(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4250
 *     )
 * 
 * cdef inline np.ndarray dt64arr_as_int64_Y(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'Y' (year)
 *     resolution `<'ndarray[int64]>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_Y", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4331
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_Q(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'Q' (quarter)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_Q(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Q *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_v;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_Q", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4336
 *     """
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_M(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4340
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":4341
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4341, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4342
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i, v
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":4343
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, v
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":4346
 *         np.npy_int64 i, v
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         v = arr_ptr[i]
 *         res_ptr[i] = (v // 12 * 4) + (v % 12) // 3 + offset
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":4347
 * 
 *     for i in range(size):
 *         v = arr_ptr[i]             # <<<<<<<<<<<<<<
 *         res_ptr[i] = (v // 12 * 4) + (v % 12) // 3 + offset
 *     return res
 */
    __pyx_v_v = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "cytimes/utils.pxd":4348
 *     for i in range(size):
 *         v = arr_ptr[i]
 *         res_ptr[i] = (v // 12 * 4) + (v % 12) // 3 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (((__Pyx_div_npy_int64(__pyx_v_v, 12) * 4) + __Pyx_div_npy_int64(__Pyx_mod_npy_int64(__pyx_v_v, 12), 3)) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":4349
 *         v = arr_ptr[i]
 *         res_ptr[i] = (v // 12 * 4) + (v % 12) // 3 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_M(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4331
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_Q(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'Q' (quarter)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_Q", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4351
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_M(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'M' (month)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_n;
  npy_int64 __pyx_v_n400;
  npy_int64 __pyx_v_n100;
  npy_int64 __pyx_v_n4;
  npy_int64 __pyx_v_n1;
  npy_int64 __pyx_v_year;
  npy_int64 __pyx_v_month;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  npy_intp __pyx_t_5[1];
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  int __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_10;
  npy_int64 __pyx_t_11;
  npy_int64 __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_M", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4359
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4360
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4359
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "cytimes/utils.pxd":4364
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "cytimes/utils.pxd":4365
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'M' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4366
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'M' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4367
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'M' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_M_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4367, __pyx_L1_error)

      /* "cytimes/utils.pxd":4366
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'M' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "cytimes/utils.pxd":4368
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'M' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4368, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4369
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'M' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.pxd":4365
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'M' resolution")
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4370
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4371
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4371, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4370
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4373
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4373, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "cytimes/utils.pxd":4377
 * 
 *     # Fast-path: datetime64[M]
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4378
 *     # Fast-path: datetime64[M]
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *         return arr if offset == 0 else arr_add(arr, offset)
 */
    __pyx_t_1 = (__pyx_v_dtype == NPY_DATETIME);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4379
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 *         return arr if offset == 0 else arr_add(arr, offset)
 * 
 */
      __pyx_t_3 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4379, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4379, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/utils.pxd":4378
 *     # Fast-path: datetime64[M]
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *         return arr if offset == 0 else arr_add(arr, offset)
 */
    }

    /* "cytimes/utils.pxd":4380
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *         return arr if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 * 
 *     # Fast-path: datetime64[Y]
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_t_3 = ((PyObject *)__pyx_v_arr);
    } else {
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __pyx_t_4 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4377
 * 
 *     # Fast-path: datetime64[M]
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 */
  }

  /* "cytimes/utils.pxd":4383
 * 
 *     # Fast-path: datetime64[Y]
 *     cdef np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *     cdef np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *     cdef np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":4384
 *     # Fast-path: datetime64[Y]
 *     cdef np.npy_int64 size = arr.shape[0]
 *     cdef np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *     cdef np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *     cdef np.npy_int64* arr_ptr
 */
  __pyx_t_5[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_5, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4384, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":4385
 *     cdef np.npy_int64 size = arr.shape[0]
 *     cdef np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *     cdef np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *     cdef np.npy_int64* arr_ptr
 *     cdef np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":4388
 *     cdef np.npy_int64* arr_ptr
 *     cdef np.npy_int64 i
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         for i in range(size):
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4389
 *     cdef np.npy_int64 i
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         for i in range(size):
 *             res_ptr[i] = arr_ptr[i] * 12 + offset
 */
    __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

    /* "cytimes/utils.pxd":4390
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             res_ptr[i] = arr_ptr[i] * 12 + offset
 *         return res
 */
    __pyx_t_6 = __pyx_v_size;
    __pyx_t_7 = __pyx_t_6;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "cytimes/utils.pxd":4391
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         for i in range(size):
 *             res_ptr[i] = arr_ptr[i] * 12 + offset             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
      (__pyx_v_res_ptr[__pyx_v_i]) = (((__pyx_v_arr_ptr[__pyx_v_i]) * 12) + __pyx_v_offset);
    }

    /* "cytimes/utils.pxd":4392
 *         for i in range(size):
 *             res_ptr[i] = arr_ptr[i] * 12 + offset
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     # All the rest resolutions
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_res);
    __pyx_r = __pyx_v_res;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4388
 *     cdef np.npy_int64* arr_ptr
 *     cdef np.npy_int64 i
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         for i in range(size):
 */
  }

  /* "cytimes/utils.pxd":4396
 *     # All the rest resolutions
 *     cdef np.npy_int64 n, n400, n100, n4, n1, year, month
 *     if unit not in (             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
  switch (__pyx_v_unit) {
    case NPY_FR_ns:

    /* "cytimes/utils.pxd":4397
 *     cdef np.npy_int64 n, n400, n100, n4, n1, year, month
 *     if unit not in (
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,
 */
    case NPY_FR_us:

    /* "cytimes/utils.pxd":4398
 *     if unit not in (
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,
 */
    case NPY_FR_ms:

    /* "cytimes/utils.pxd":4399
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,
 */
    case NPY_FR_s:

    /* "cytimes/utils.pxd":4400
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,
 *         np.NPY_DATETIMEUNIT.NPY_FR_h,
 */
    case NPY_FR_m:

    /* "cytimes/utils.pxd":4401
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_h,
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,
 */
    case NPY_FR_h:

    /* "cytimes/utils.pxd":4402
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,
 *         np.NPY_DATETIMEUNIT.NPY_FR_h,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,
 */
    case NPY_FR_D:

    /* "cytimes/utils.pxd":4403
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,
 *         np.NPY_DATETIMEUNIT.NPY_FR_h,
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,
 *     ):
 */
    case NPY_FR_W:

    /* "cytimes/utils.pxd":4396
 *     # All the rest resolutions
 *     cdef np.npy_int64 n, n400, n100, n4, n1, year, month
 *     if unit not in (             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
    __pyx_t_1 = 0;
    break;
    default:
    __pyx_t_1 = 1;
    break;
  }
  __pyx_t_9 = __pyx_t_1;
  if (__pyx_t_9) {

    /* "cytimes/utils.pxd":4406
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,
 *     ):
 *         _raise_dt64arr_as_int64_unit_error("M", unit)             # <<<<<<<<<<<<<<
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)
 *     arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
    __pyx_t_9 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_M, __pyx_v_unit, NULL); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 4406, __pyx_L1_error)

    /* "cytimes/utils.pxd":4396
 *     # All the rest resolutions
 *     cdef np.npy_int64 n, n400, n100, n4, n1, year, month
 *     if unit not in (             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
  }

  /* "cytimes/utils.pxd":4407
 *     ):
 *         _raise_dt64arr_as_int64_unit_error("M", unit)
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *     arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *     for i in range(size):
 */
  __pyx_t_10.__pyx_n = 2;
  __pyx_t_10.arr_unit = __pyx_v_arr_unit;
  __pyx_t_10.offset = 0;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":4408
 *         _raise_dt64arr_as_int64_unit_error("M", unit)
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)
 *     arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *     for i in range(size):
 *         # Convert to ordinal
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":4409
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)
 *     arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         # Convert to ordinal
 *         n = arr_ptr[i] + EPOCH_DAY - 1
 */
  __pyx_t_6 = __pyx_v_size;
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "cytimes/utils.pxd":4411
 *     for i in range(size):
 *         # Convert to ordinal
 *         n = arr_ptr[i] + EPOCH_DAY - 1             # <<<<<<<<<<<<<<
 *         # Number of complete 400-year cycles
 *         n400 = n // 146_097
 */
    __pyx_v_n = (((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_DAY) - 1);

    /* "cytimes/utils.pxd":4413
 *         n = arr_ptr[i] + EPOCH_DAY - 1
 *         # Number of complete 400-year cycles
 *         n400 = n // 146_097             # <<<<<<<<<<<<<<
 *         n -= n400 * 146_097
 *         # Number of complete 100-year cycles within the 400-year cycle
 */
    __pyx_v_n400 = __Pyx_div_npy_int64(__pyx_v_n, 0x23AB1);

    /* "cytimes/utils.pxd":4414
 *         # Number of complete 400-year cycles
 *         n400 = n // 146_097
 *         n -= n400 * 146_097             # <<<<<<<<<<<<<<
 *         # Number of complete 100-year cycles within the 400-year cycle
 *         n100 = n // 36_524
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n400 * 0x23AB1));

    /* "cytimes/utils.pxd":4416
 *         n -= n400 * 146_097
 *         # Number of complete 100-year cycles within the 400-year cycle
 *         n100 = n // 36_524             # <<<<<<<<<<<<<<
 *         n -= n100 * 36_524
 *         # Number of complete 4-year cycles within the 100-year cycle
 */
    __pyx_v_n100 = __Pyx_div_npy_int64(__pyx_v_n, 0x8EAC);

    /* "cytimes/utils.pxd":4417
 *         # Number of complete 100-year cycles within the 400-year cycle
 *         n100 = n // 36_524
 *         n -= n100 * 36_524             # <<<<<<<<<<<<<<
 *         # Number of complete 4-year cycles within the 100-year cycle
 *         n4 = n // 1_461
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n100 * 0x8EAC));

    /* "cytimes/utils.pxd":4419
 *         n -= n100 * 36_524
 *         # Number of complete 4-year cycles within the 100-year cycle
 *         n4 = n // 1_461             # <<<<<<<<<<<<<<
 *         n -= n4 * 1_461
 *         # Number of complete years within the 4-year cycle
 */
    __pyx_v_n4 = __Pyx_div_npy_int64(__pyx_v_n, 0x5B5);

    /* "cytimes/utils.pxd":4420
 *         # Number of complete 4-year cycles within the 100-year cycle
 *         n4 = n // 1_461
 *         n -= n4 * 1_461             # <<<<<<<<<<<<<<
 *         # Number of complete years within the 4-year cycle
 *         n1 = n // 365
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n4 * 0x5B5));

    /* "cytimes/utils.pxd":4422
 *         n -= n4 * 1_461
 *         # Number of complete years within the 4-year cycle
 *         n1 = n // 365             # <<<<<<<<<<<<<<
 *         n -= n1 * 365
 *         # Compute the year
 */
    __pyx_v_n1 = __Pyx_div_npy_int64(__pyx_v_n, 0x16D);

    /* "cytimes/utils.pxd":4423
 *         # Number of complete years within the 4-year cycle
 *         n1 = n // 365
 *         n -= n1 * 365             # <<<<<<<<<<<<<<
 *         # Compute the year
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n1 * 0x16D));

    /* "cytimes/utils.pxd":4425
 *         n -= n1 * 365
 *         # Compute the year
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1             # <<<<<<<<<<<<<<
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:
 */
    __pyx_v_year = ((((__pyx_v_n400 * 0x190) + (__pyx_v_n100 * 0x64)) + (__pyx_v_n4 * 4)) + __pyx_v_n1);

    /* "cytimes/utils.pxd":4427
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:             # <<<<<<<<<<<<<<
 *             month = 12
 *         else:
 */
    __pyx_t_1 = (__pyx_v_n100 == 4);
    if (!__pyx_t_1) {
    } else {
      __pyx_t_9 = __pyx_t_1;
      goto __pyx_L15_bool_binop_done;
    }
    __pyx_t_1 = (__pyx_v_n1 == 4);
    __pyx_t_9 = __pyx_t_1;
    __pyx_L15_bool_binop_done:;
    if (__pyx_t_9) {

      /* "cytimes/utils.pxd":4428
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:
 *             month = 12             # <<<<<<<<<<<<<<
 *         else:
 *             year, month = year + 1, (n + 50) >> 5
 */
      __pyx_v_month = 12;

      /* "cytimes/utils.pxd":4427
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:             # <<<<<<<<<<<<<<
 *             month = 12
 *         else:
 */
      goto __pyx_L14;
    }

    /* "cytimes/utils.pxd":4430
 *             month = 12
 *         else:
 *             year, month = year + 1, (n + 50) >> 5             # <<<<<<<<<<<<<<
 *             if days_bf_month(year, month) > n:
 *                 month -= 1
 */
    /*else*/ {
      __pyx_t_11 = (__pyx_v_year + 1);
      __pyx_t_12 = ((__pyx_v_n + 50) >> 5);
      __pyx_v_year = __pyx_t_11;
      __pyx_v_month = __pyx_t_12;

      /* "cytimes/utils.pxd":4431
 *         else:
 *             year, month = year + 1, (n + 50) >> 5
 *             if days_bf_month(year, month) > n:             # <<<<<<<<<<<<<<
 *                 month -= 1
 *         # Compute total months
 */
      __pyx_t_2 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4431, __pyx_L1_error)
      __pyx_t_9 = (__pyx_t_2 > __pyx_v_n);
      if (__pyx_t_9) {

        /* "cytimes/utils.pxd":4432
 *             year, month = year + 1, (n + 50) >> 5
 *             if days_bf_month(year, month) > n:
 *                 month -= 1             # <<<<<<<<<<<<<<
 *         # Compute total months
 *         res_ptr[i] = (year - EPOCH_YEAR) * 12 + (month - 1) + offset
 */
        __pyx_v_month = (__pyx_v_month - 1);

        /* "cytimes/utils.pxd":4431
 *         else:
 *             year, month = year + 1, (n + 50) >> 5
 *             if days_bf_month(year, month) > n:             # <<<<<<<<<<<<<<
 *                 month -= 1
 *         # Compute total months
 */
      }
    }
    __pyx_L14:;

    /* "cytimes/utils.pxd":4434
 *                 month -= 1
 *         # Compute total months
 *         res_ptr[i] = (year - EPOCH_YEAR) * 12 + (month - 1) + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((((__pyx_v_year - __pyx_v_7cytimes_5utils_EPOCH_YEAR) * 12) + (__pyx_v_month - 1)) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":4435
 *         # Compute total months
 *         res_ptr[i] = (year - EPOCH_YEAR) * 12 + (month - 1) + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_W(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4351
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_M(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'M' (month)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_M", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4437
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_W(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'W' (week)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_W(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_W *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_v;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_W", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4445
 *     """
 *     # Cast to int64[D]
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute week
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4449
 *     # Compute week
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":4450
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4450, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4451
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i, v
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":4452
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, v
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":4455
 *         np.npy_int64 i, v
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         v = arr_ptr[i]
 *         res_ptr[i] = v // 7 + offset
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":4456
 * 
 *     for i in range(size):
 *         v = arr_ptr[i]             # <<<<<<<<<<<<<<
 *         res_ptr[i] = v // 7 + offset
 *     return res
 */
    __pyx_v_v = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "cytimes/utils.pxd":4457
 *     for i in range(size):
 *         v = arr_ptr[i]
 *         res_ptr[i] = v // 7 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_div_npy_int64(__pyx_v_v, 7) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":4458
 *         v = arr_ptr[i]
 *         res_ptr[i] = v // 7 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_D(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4437
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_W(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'W' (week)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_W", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4460
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_D(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'D' (day)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_div __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_D", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4468
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4469
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4468
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "cytimes/utils.pxd":4473
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "cytimes/utils.pxd":4474
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'D' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4475
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'D' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4476
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'D' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_D_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4476, __pyx_L1_error)

      /* "cytimes/utils.pxd":4475
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'D' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "cytimes/utils.pxd":4477
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'D' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4477, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4478
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'D' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4478, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.pxd":4474
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'D' resolution")
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4479
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4480
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4480, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4479
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4482
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4482, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "cytimes/utils.pxd":4486
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4487
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4486
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/utils.pxd":4488
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4489
 *         return arr_floor_div(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_DAY, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4488
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/utils.pxd":4490
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4491
 *         return arr_floor_div(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_DAY, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4490
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/utils.pxd":4492
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4493
 *         return arr_floor_div(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_floor_div(arr, 1440, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_DAY, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4492
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/utils.pxd":4494
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4495
 *         return arr_floor_div(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_floor_div(arr, 1440, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_floor_div(arr, 24, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, 0x5A0, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4494
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/utils.pxd":4496
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_floor_div(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4497
 *         return arr_floor_div(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_floor_div(arr, 24, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, 24, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4496
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_floor_div(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/utils.pxd":4498
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_floor_div(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4499
 *         return arr_floor_div(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 1, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4498
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_floor_div(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "cytimes/utils.pxd":4500
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4501
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 1, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 1, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 2;
    __pyx_t_6.factor = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_W_as_int64_D(__pyx_v_arr, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4500
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "cytimes/utils.pxd":4502
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4503
 *         return _dt64arr_W_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 1, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, 1, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_7.__pyx_n = 2;
    __pyx_t_7.factor = 1;
    __pyx_t_7.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_M_as_int64_D(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4502
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "cytimes/utils.pxd":4504
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, 1, offset)
 *     # . unsupported
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4505
 *         return _dt64arr_M_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, 1, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("D", unit)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.factor = 1;
    __pyx_t_8.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_Y_as_int64_D(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4504
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, 1, offset)
 *     # . unsupported
 */
  }

  /* "cytimes/utils.pxd":4507
 *         return _dt64arr_Y_as_int64_D(arr, 1, offset)
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("D", unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_h(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_D, __pyx_v_unit, NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4507, __pyx_L1_error)

  /* "cytimes/utils.pxd":4460
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_D(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'D' (day)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4509
 *     _raise_dt64arr_as_int64_unit_error("D", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_h(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'h' (hour)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_h(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_h *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_div __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_h", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4517
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4518
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4517
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "cytimes/utils.pxd":4522
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "cytimes/utils.pxd":4523
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'h' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4524
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'h' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4525
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'h' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_h_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4525, __pyx_L1_error)

      /* "cytimes/utils.pxd":4524
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'h' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "cytimes/utils.pxd":4526
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'h' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4526, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4527
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'h' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.pxd":4523
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'h' resolution")
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4528
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4529
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4529, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4528
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4531
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4531, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "cytimes/utils.pxd":4535
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4536
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_HOUR, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_HOUR, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_HOUR, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4535
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/utils.pxd":4537
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4538
 *         return arr_floor_div(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_HOUR, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_HOUR, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_HOUR, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4537
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/utils.pxd":4539
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4540
 *         return arr_floor_div(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_HOUR, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_HOUR, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_HOUR, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4540, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4539
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/utils.pxd":4541
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4542
 *         return arr_floor_div(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_HOUR, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_floor_div(arr, 60, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_HOUR, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4541
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/utils.pxd":4543
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4544
 *         return arr_floor_div(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_floor_div(arr, 60, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, 60, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4543
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/utils.pxd":4545
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_floor_div(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4546
 *         return arr_floor_div(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, 24, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4546, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4546, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4545
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_floor_div(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/utils.pxd":4547
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4548
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, 24, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 24, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, 24, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4547
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "cytimes/utils.pxd":4549
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4550
 *         return arr_mul(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 24, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 24, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_7.__pyx_n = 2;
    __pyx_t_7.factor = 24;
    __pyx_t_7.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_W_as_int64_D(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4549
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "cytimes/utils.pxd":4551
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4552
 *         return _dt64arr_W_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 24, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, 24, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.factor = 24;
    __pyx_t_8.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_M_as_int64_D(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4552, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4551
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "cytimes/utils.pxd":4553
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, 24, offset)
 *     # . unsupported
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4554
 *         return _dt64arr_M_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, 24, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("h", unit)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_9.__pyx_n = 2;
    __pyx_t_9.factor = 24;
    __pyx_t_9.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_Y_as_int64_D(__pyx_v_arr, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4553
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, 24, offset)
 *     # . unsupported
 */
  }

  /* "cytimes/utils.pxd":4556
 *         return _dt64arr_Y_as_int64_D(arr, 24, offset)
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("h", unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_m(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_h, __pyx_v_unit, NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4556, __pyx_L1_error)

  /* "cytimes/utils.pxd":4509
 *     _raise_dt64arr_as_int64_unit_error("D", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_h(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'h' (hour)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_h", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4558
 *     _raise_dt64arr_as_int64_unit_error("h", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_m(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'm' (minute)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_m(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_m *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_div __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_m", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4566
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4567
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4566
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "cytimes/utils.pxd":4571
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "cytimes/utils.pxd":4572
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'm' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4573
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'm' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4574
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'm' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_m_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4574, __pyx_L1_error)

      /* "cytimes/utils.pxd":4573
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'm' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "cytimes/utils.pxd":4575
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'm' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4575, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4576
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'm' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.pxd":4572
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'm' resolution")
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4577
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4578
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4578, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4577
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4580
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4580, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "cytimes/utils.pxd":4584
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4585
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MINUTE, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_MINUTE, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MINUTE, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4584
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/utils.pxd":4586
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4587
 *         return arr_floor_div(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_MINUTE, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_MINUTE, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MINUTE, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4586
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/utils.pxd":4588
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4589
 *         return arr_floor_div(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_MINUTE, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_MINUTE, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_MINUTE, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4588
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/utils.pxd":4590
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4591
 *         return arr_floor_div(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_MINUTE, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_MINUTE, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4590
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/utils.pxd":4592
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4593
 *         return arr_floor_div(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, 60, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4593, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4593, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4592
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/utils.pxd":4594
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4595
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, 60, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, 1_440, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, 60, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4594
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/utils.pxd":4596
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4597
 *         return arr_mul(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, 1_440, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 1_440, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, 0x5A0, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4596
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "cytimes/utils.pxd":4598
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4599
 *         return arr_mul(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 1_440, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 1_440, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_7.__pyx_n = 2;
    __pyx_t_7.factor = 0x5A0;
    __pyx_t_7.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_W_as_int64_D(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4598
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "cytimes/utils.pxd":4600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4601
 *         return _dt64arr_W_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 1_440, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, 1_440, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.factor = 0x5A0;
    __pyx_t_8.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_M_as_int64_D(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4601, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "cytimes/utils.pxd":4602
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, 1_440, offset)
 *     # . unsupported
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4603
 *         return _dt64arr_M_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, 1_440, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("m", unit)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_9.__pyx_n = 2;
    __pyx_t_9.factor = 0x5A0;
    __pyx_t_9.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_Y_as_int64_D(__pyx_v_arr, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4603, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4602
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, 1_440, offset)
 *     # . unsupported
 */
  }

  /* "cytimes/utils.pxd":4605
 *         return _dt64arr_Y_as_int64_D(arr, 1_440, offset)
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("m", unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_s(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_m, __pyx_v_unit, NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4605, __pyx_L1_error)

  /* "cytimes/utils.pxd":4558
 *     _raise_dt64arr_as_int64_unit_error("h", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_m(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'm' (minute)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_m", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4607
 *     _raise_dt64arr_as_int64_unit_error("m", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_s(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 's' (second)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_s(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_s *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_div __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_s", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4615
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4616
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4615
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "cytimes/utils.pxd":4620
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "cytimes/utils.pxd":4621
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 's' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4622
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 's' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4623
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 's' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_s_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4623, __pyx_L1_error)

      /* "cytimes/utils.pxd":4622
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 's' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "cytimes/utils.pxd":4624
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 's' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4624, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4625
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 's' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4625, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.pxd":4621
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 's' resolution")
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4626
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4627
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4627, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4626
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4629
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4629, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "cytimes/utils.pxd":4633
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4634
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_SECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_SECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_SECOND, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4633
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/utils.pxd":4635
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4636
 *         return arr_floor_div(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_SECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_SECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_SECOND, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4635
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/utils.pxd":4637
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4638
 *         return arr_floor_div(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_SECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_SECOND, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4637
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/utils.pxd":4639
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4640
 *         return arr_floor_div(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, SS_MINUTE, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4640, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4640, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4639
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/utils.pxd":4641
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4642
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, SS_MINUTE, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, SS_HOUR, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_MINUTE, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4641
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/utils.pxd":4643
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4644
 *         return arr_mul(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, SS_HOUR, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, SS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_HOUR, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4643
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/utils.pxd":4645
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4646
 *         return arr_mul(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, SS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, SS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_DAY, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4645
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "cytimes/utils.pxd":4647
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4648
 *         return arr_mul(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, SS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, SS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_7.__pyx_n = 2;
    __pyx_t_7.factor = __pyx_v_7cytimes_5utils_SS_DAY;
    __pyx_t_7.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_W_as_int64_D(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4647
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "cytimes/utils.pxd":4649
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4650
 *         return _dt64arr_W_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, SS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, SS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.factor = __pyx_v_7cytimes_5utils_SS_DAY;
    __pyx_t_8.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_M_as_int64_D(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4649
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "cytimes/utils.pxd":4651
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, SS_DAY, offset)
 *     # . unsupported
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4652
 *         return _dt64arr_M_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, SS_DAY, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("s", unit)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_9.__pyx_n = 2;
    __pyx_t_9.factor = __pyx_v_7cytimes_5utils_SS_DAY;
    __pyx_t_9.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_Y_as_int64_D(__pyx_v_arr, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4651
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, SS_DAY, offset)
 *     # . unsupported
 */
  }

  /* "cytimes/utils.pxd":4654
 *         return _dt64arr_Y_as_int64_D(arr, SS_DAY, offset)
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("s", unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_ms(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_s, __pyx_v_unit, NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4654, __pyx_L1_error)

  /* "cytimes/utils.pxd":4607
 *     _raise_dt64arr_as_int64_unit_error("m", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_s(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 's' (second)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_s", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4656
 *     _raise_dt64arr_as_int64_unit_error("s", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_ms(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'ms' (millisecond)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_ms(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ms *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_div __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_ms", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4664
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4665
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4664
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "cytimes/utils.pxd":4669
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "cytimes/utils.pxd":4670
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ms' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4671
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ms' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4672
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ms' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_ms_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4672, __pyx_L1_error)

      /* "cytimes/utils.pxd":4671
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ms' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "cytimes/utils.pxd":4673
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ms' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4673, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4674
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ms' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.pxd":4670
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ms' resolution")
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4675
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4676
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4676, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4675
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4678
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4678, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "cytimes/utils.pxd":4682
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4683
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MILLISECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_MILLISECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MILLISECOND, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4683, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4682
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/utils.pxd":4684
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4685
 *         return arr_floor_div(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_MILLISECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MILLISECOND, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4685, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4684
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/utils.pxd":4686
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4687
 *         return arr_floor_div(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, MS_SECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4686
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/utils.pxd":4688
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4689
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, MS_SECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, MS_MINUTE, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_SECOND, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4688
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/utils.pxd":4690
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4691
 *         return arr_mul(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, MS_MINUTE, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, MS_HOUR, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_MINUTE, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4690
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/utils.pxd":4692
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4693
 *         return arr_mul(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, MS_HOUR, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, MS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_HOUR, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4692
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/utils.pxd":4694
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4695
 *         return arr_mul(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, MS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, MS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_DAY, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4694
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "cytimes/utils.pxd":4696
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4697
 *         return arr_mul(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, MS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, MS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_7.__pyx_n = 2;
    __pyx_t_7.factor = __pyx_v_7cytimes_5utils_MS_DAY;
    __pyx_t_7.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_W_as_int64_D(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4696
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "cytimes/utils.pxd":4698
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4699
 *         return _dt64arr_W_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, MS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, MS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.factor = __pyx_v_7cytimes_5utils_MS_DAY;
    __pyx_t_8.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_M_as_int64_D(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4698
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "cytimes/utils.pxd":4700
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, MS_DAY, offset)
 *     # . unsupported
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4701
 *         return _dt64arr_M_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, MS_DAY, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("ms", unit)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_9.__pyx_n = 2;
    __pyx_t_9.factor = __pyx_v_7cytimes_5utils_MS_DAY;
    __pyx_t_9.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_Y_as_int64_D(__pyx_v_arr, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4700
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, MS_DAY, offset)
 *     # . unsupported
 */
  }

  /* "cytimes/utils.pxd":4703
 *         return _dt64arr_Y_as_int64_D(arr, MS_DAY, offset)
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("ms", unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_us(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_ms, __pyx_v_unit, NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4703, __pyx_L1_error)

  /* "cytimes/utils.pxd":4656
 *     _raise_dt64arr_as_int64_unit_error("s", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_ms(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'ms' (millisecond)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_ms", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4705
 *     _raise_dt64arr_as_int64_unit_error("ms", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_us(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'us' (microsecond)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_us(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_us *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_div __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_us", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4713
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4714
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4713
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "cytimes/utils.pxd":4718
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "cytimes/utils.pxd":4719
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4720
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4721
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_us_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4721, __pyx_L1_error)

      /* "cytimes/utils.pxd":4720
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "cytimes/utils.pxd":4722
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4722, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4723
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.pxd":4719
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4724
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4725
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4725, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4724
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4727
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4727, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "cytimes/utils.pxd":4731
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4732
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4731
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/utils.pxd":4733
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4734
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, US_MILLISECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4734, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4734, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4733
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/utils.pxd":4735
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4736
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, US_MILLISECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, US_SECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MILLISECOND, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4735
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/utils.pxd":4737
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4738
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, US_SECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, US_MINUTE, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_SECOND, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4737
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/utils.pxd":4739
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4740
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, US_MINUTE, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, US_HOUR, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MINUTE, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4739
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/utils.pxd":4741
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4742
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, US_HOUR, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_HOUR, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4742, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4741
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/utils.pxd":4743
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4744
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_DAY, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4743
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "cytimes/utils.pxd":4745
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4746
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_7.__pyx_n = 2;
    __pyx_t_7.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_7.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_W_as_int64_D(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4745
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "cytimes/utils.pxd":4747
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4748
 *         return _dt64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_8.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_M_as_int64_D(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4747
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "cytimes/utils.pxd":4749
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, US_DAY, offset)
 *     # . unsupported
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4750
 *         return _dt64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("us", unit)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_9.__pyx_n = 2;
    __pyx_t_9.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_9.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_Y_as_int64_D(__pyx_v_arr, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4749
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, US_DAY, offset)
 *     # . unsupported
 */
  }

  /* "cytimes/utils.pxd":4752
 *         return _dt64arr_Y_as_int64_D(arr, US_DAY, offset)
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("us", unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_ns(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_us, __pyx_v_unit, NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4752, __pyx_L1_error)

  /* "cytimes/utils.pxd":4705
 *     _raise_dt64arr_as_int64_unit_error("ms", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_us(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'us' (microsecond)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4754
 *     _raise_dt64arr_as_int64_unit_error("us", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_ns(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'ns' (nanosecond)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_ns(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ns *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_5;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_ns", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4762
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4763
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4762
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "cytimes/utils.pxd":4767
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "cytimes/utils.pxd":4768
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ns' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4769
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ns' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4770
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ns' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_ns_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4770, __pyx_L1_error)

      /* "cytimes/utils.pxd":4769
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ns' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "cytimes/utils.pxd":4771
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ns' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4771, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4772
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ns' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4772, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.pxd":4768
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ns' resolution")
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4773
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4774
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4774, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4773
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4776
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4776, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "cytimes/utils.pxd":4780
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4781
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_mul(arr, NS_MICROSECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4781, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __pyx_t_4 = 0;
    } else {
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4781, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __pyx_t_4 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4780
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/utils.pxd":4782
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4783
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_mul(arr, NS_MICROSECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, NS_MILLISECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, &__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4782
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/utils.pxd":4784
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_mul(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4785
 *         return arr_mul(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, NS_MILLISECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, NS_SECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MILLISECOND, &__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4784
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_mul(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/utils.pxd":4786
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4787
 *         return arr_mul(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, NS_SECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, NS_MINUTE, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_SECOND, &__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4787, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4786
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/utils.pxd":4788
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4789
 *         return arr_mul(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, NS_MINUTE, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, NS_HOUR, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MINUTE, &__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4788
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/utils.pxd":4790
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4791
 *         return arr_mul(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, NS_HOUR, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, NS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_HOUR, &__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4790
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/utils.pxd":4792
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4793
 *         return arr_mul(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, NS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, NS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, &__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4792
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "cytimes/utils.pxd":4794
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4795
 *         return arr_mul(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, NS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, NS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 2;
    __pyx_t_6.factor = __pyx_v_7cytimes_5utils_NS_DAY;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_W_as_int64_D(__pyx_v_arr, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4795, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4794
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "cytimes/utils.pxd":4796
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4797
 *         return _dt64arr_W_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, NS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, NS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_7.__pyx_n = 2;
    __pyx_t_7.factor = __pyx_v_7cytimes_5utils_NS_DAY;
    __pyx_t_7.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_M_as_int64_D(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4796
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "cytimes/utils.pxd":4798
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, NS_DAY, offset)
 *     # . unsupported
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4799
 *         return _dt64arr_M_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, NS_DAY, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("ns", unit)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.factor = __pyx_v_7cytimes_5utils_NS_DAY;
    __pyx_t_8.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_Y_as_int64_D(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4798
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, NS_DAY, offset)
 *     # . unsupported
 */
  }

  /* "cytimes/utils.pxd":4801
 *         return _dt64arr_Y_as_int64_D(arr, NS_DAY, offset)
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("ns", unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray _dt64arr_Y_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_ns, __pyx_v_unit, NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4801, __pyx_L1_error)

  /* "cytimes/utils.pxd":4754
 *     _raise_dt64arr_as_int64_unit_error("us", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_ns(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'ns' (nanosecond)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_ns", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4803
 *     _raise_dt64arr_as_int64_unit_error("ns", unit)
 * 
 * cdef inline np.ndarray _dt64arr_Y_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[datetime64[Y]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__dt64arr_Y_as_int64_D(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_year;
  npy_int64 __pyx_v_y_1;
  npy_int64 __pyx_v_year_since_epoch;
  npy_int64 __pyx_v_leaps;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2[1];
  npy_int64 __pyx_t_3;
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_dt64arr_Y_as_int64_D", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4807
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 *     """
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4809
 *     arr = arr_assure_int64_like(arr)
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":4810
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_2[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_2, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4810, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4811
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i, year, y_1, year_since_epoch, leaps
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":4812
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, year, y_1, year_since_epoch, leaps
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":4815
 *         np.npy_int64 i, year, y_1, year_since_epoch, leaps
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         year_since_epoch = arr_ptr[i]
 *         year = year_since_epoch + EPOCH_YEAR
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "cytimes/utils.pxd":4816
 * 
 *     for i in range(size):
 *         year_since_epoch = arr_ptr[i]             # <<<<<<<<<<<<<<
 *         year = year_since_epoch + EPOCH_YEAR
 *         # Compute leap years
 */
    __pyx_v_year_since_epoch = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "cytimes/utils.pxd":4817
 *     for i in range(size):
 *         year_since_epoch = arr_ptr[i]
 *         year = year_since_epoch + EPOCH_YEAR             # <<<<<<<<<<<<<<
 *         # Compute leap years
 *         y_1 = year - 1
 */
    __pyx_v_year = (__pyx_v_year_since_epoch + __pyx_v_7cytimes_5utils_EPOCH_YEAR);

    /* "cytimes/utils.pxd":4819
 *         year = year_since_epoch + EPOCH_YEAR
 *         # Compute leap years
 *         y_1 = year - 1             # <<<<<<<<<<<<<<
 *         leaps = (
 *             (y_1 // 4 - 1970 // 4)
 */
    __pyx_v_y_1 = (__pyx_v_year - 1);

    /* "cytimes/utils.pxd":4823
 *             (y_1 // 4 - 1970 // 4)
 *             - (y_1 // 100 - 1970 // 100)
 *             + (y_1 // 400 - 1970 // 400)             # <<<<<<<<<<<<<<
 *         )
 *         # Compute total days
 */
    __pyx_v_leaps = (((__Pyx_div_npy_int64(__pyx_v_y_1, 4) - 0x1ec) - (__Pyx_div_npy_int64(__pyx_v_y_1, 0x64) - 0x13)) + (__Pyx_div_npy_int64(__pyx_v_y_1, 0x190) - 0x4));

    /* "cytimes/utils.pxd":4826
 *         )
 *         # Compute total days
 *         res_ptr[i] = (year_since_epoch * 365 + leaps) * factor + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((((__pyx_v_year_since_epoch * 0x16D) + __pyx_v_leaps) * __pyx_v_factor) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":4827
 *         # Compute total days
 *         res_ptr[i] = (year_since_epoch * 365 + leaps) * factor + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray _dt64arr_M_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4803
 *     _raise_dt64arr_as_int64_unit_error("ns", unit)
 * 
 * cdef inline np.ndarray _dt64arr_Y_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[datetime64[Y]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils._dt64arr_Y_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4829
 *     return res
 * 
 * cdef inline np.ndarray _dt64arr_M_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[datetime64[M]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__dt64arr_M_as_int64_D(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_v;
  npy_int64 __pyx_v_year;
  npy_int64 __pyx_v_y_1;
  npy_int64 __pyx_v_year_ep;
  npy_int64 __pyx_v_leaps;
  npy_int64 __pyx_v_month;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2[1];
  npy_int64 __pyx_t_3;
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_dt64arr_M_as_int64_D", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4833
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 *     """
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4835
 *     arr = arr_assure_int64_like(arr)
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":4836
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_2[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_2, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4836, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4837
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i, v
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":4838
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, v
 *         np.npy_int64 year, y_1, year_ep, leaps
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":4843
 *         np.npy_int64 month, days_bf_mm
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         v = arr_ptr[i]
 *         year_ep = v // 12
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "cytimes/utils.pxd":4844
 * 
 *     for i in range(size):
 *         v = arr_ptr[i]             # <<<<<<<<<<<<<<
 *         year_ep = v // 12
 *         year = year_ep + EPOCH_YEAR
 */
    __pyx_v_v = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "cytimes/utils.pxd":4845
 *     for i in range(size):
 *         v = arr_ptr[i]
 *         year_ep = v // 12             # <<<<<<<<<<<<<<
 *         year = year_ep + EPOCH_YEAR
 *         month = v % 12 + 1
 */
    __pyx_v_year_ep = __Pyx_div_npy_int64(__pyx_v_v, 12);

    /* "cytimes/utils.pxd":4846
 *         v = arr_ptr[i]
 *         year_ep = v // 12
 *         year = year_ep + EPOCH_YEAR             # <<<<<<<<<<<<<<
 *         month = v % 12 + 1
 *         # Compute leap years
 */
    __pyx_v_year = (__pyx_v_year_ep + __pyx_v_7cytimes_5utils_EPOCH_YEAR);

    /* "cytimes/utils.pxd":4847
 *         year_ep = v // 12
 *         year = year_ep + EPOCH_YEAR
 *         month = v % 12 + 1             # <<<<<<<<<<<<<<
 *         # Compute leap years
 *         y_1 = year - 1
 */
    __pyx_v_month = (__Pyx_mod_npy_int64(__pyx_v_v, 12) + 1);

    /* "cytimes/utils.pxd":4849
 *         month = v % 12 + 1
 *         # Compute leap years
 *         y_1 = year - 1             # <<<<<<<<<<<<<<
 *         leaps = (
 *             (y_1 // 4 - 1970 // 4)
 */
    __pyx_v_y_1 = (__pyx_v_year - 1);

    /* "cytimes/utils.pxd":4853
 *             (y_1 // 4 - 1970 // 4)
 *             - (y_1 // 100 - 1970 // 100)
 *             + (y_1 // 400 - 1970 // 400)             # <<<<<<<<<<<<<<
 *         )
 *         # Compute total days
 */
    __pyx_v_leaps = (((__Pyx_div_npy_int64(__pyx_v_y_1, 4) - 0x1ec) - (__Pyx_div_npy_int64(__pyx_v_y_1, 0x64) - 0x13)) + (__Pyx_div_npy_int64(__pyx_v_y_1, 0x190) - 0x4));

    /* "cytimes/utils.pxd":4856
 *         )
 *         # Compute total days
 *         res_ptr[i] = (year_ep * 365 + leaps + days_bf_month(year, month)) * factor + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_6 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 4856, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = (((((__pyx_v_year_ep * 0x16D) + __pyx_v_leaps) + __pyx_t_6) * __pyx_v_factor) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":4857
 *         # Compute total days
 *         res_ptr[i] = (year_ep * 365 + leaps + days_bf_month(year, month)) * factor + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray _dt64arr_W_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4829
 *     return res
 * 
 * cdef inline np.ndarray _dt64arr_M_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[datetime64[M]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils._dt64arr_M_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4859
 *     return res
 * 
 * cdef inline np.ndarray _dt64arr_W_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[datetime64[W]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__dt64arr_W_as_int64_D(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_dt64arr_W_as_int64_D", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "cytimes/utils.pxd":4863
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 *     """
 *     return arr_mul(arr, 7 * factor, offset)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_iso_W(np.ndarray arr, int weekday, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.offset = __pyx_v_offset;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, (7 * __pyx_v_factor), &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4859
 *     return res
 * 
 * cdef inline np.ndarray _dt64arr_W_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[datetime64[W]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils._dt64arr_W_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4865
 *     return arr_mul(arr, 7 * factor, offset)
 * 
 * cdef inline np.ndarray dt64arr_as_iso_W(np.ndarray arr, int weekday, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 with 'W' (week)
 *     resolution, aligned to the specified ISO 'weekday' `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_iso_W(PyArrayObject *__pyx_v_arr, int __pyx_v_weekday, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_iso_W *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_wkd_off;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  npy_intp __pyx_t_3[1];
  long __pyx_t_4;
  long __pyx_t_5;
  int __pyx_t_6;
  long __pyx_t_7;
  int __pyx_t_8;
  npy_int64 __pyx_t_9;
  npy_int64 __pyx_t_10;
  npy_int64 __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_iso_W", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4877
 *     """
 *     # Cast to int64[D]
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute week
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4881
 *     # Compute week
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "cytimes/utils.pxd":4882
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4882, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":4883
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 wkd_off = 4 - min(max(weekday, 1), 7)
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":4884
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 wkd_off = 4 - min(max(weekday, 1), 7)
 *         np.npy_int64 i
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "cytimes/utils.pxd":4885
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 wkd_off = 4 - min(max(weekday, 1), 7)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_t_4 = 7;
  __pyx_t_5 = 1;
  __pyx_t_6 = __pyx_v_weekday;
  __pyx_t_8 = (__pyx_t_5 > __pyx_t_6);
  if (__pyx_t_8) {
    __pyx_t_7 = __pyx_t_5;
  } else {
    __pyx_t_7 = __pyx_t_6;
  }
  __pyx_t_5 = __pyx_t_7;
  __pyx_t_8 = (__pyx_t_4 < __pyx_t_5);
  if (__pyx_t_8) {
    __pyx_t_7 = __pyx_t_4;
  } else {
    __pyx_t_7 = __pyx_t_5;
  }
  __pyx_v_wkd_off = (4 - __pyx_t_7);

  /* "cytimes/utils.pxd":4888
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = (arr_ptr[i] + wkd_off) // 7 + offset
 *     return res
 */
  __pyx_t_9 = __pyx_v_size;
  __pyx_t_10 = __pyx_t_9;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "cytimes/utils.pxd":4889
 * 
 *     for i in range(size):
 *         res_ptr[i] = (arr_ptr[i] + wkd_off) // 7 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_div_npy_int64(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_wkd_off), 7) + __pyx_v_offset);
  }

  /* "cytimes/utils.pxd":4890
 *     for i in range(size):
 *         res_ptr[i] = (arr_ptr[i] + wkd_off) // 7 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_to_ordinal(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4865
 *     return arr_mul(arr, 7 * factor, offset)
 * 
 * cdef inline np.ndarray dt64arr_as_iso_W(np.ndarray arr, int weekday, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 with 'W' (week)
 *     resolution, aligned to the specified ISO 'weekday' `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_iso_W", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4892
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_to_ordinal(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Convert np.ndarray[datetime64] to proleptic Gregorian
 *     ordinals `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_to_ordinal(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_to_ordinal *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_to_ordinal", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }

  /* "cytimes/utils.pxd":4898
 *     '0001-01-01' is day 1 (ordinal=1).
 *     """
 *     return dt64arr_as_int64_D(arr, arr_unit, EPOCH_DAY)             # <<<<<<<<<<<<<<
 * 
 * # . conversion: float64
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = __pyx_v_7cytimes_5utils_EPOCH_DAY;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4892
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_to_ordinal(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Convert np.ndarray[datetime64] to proleptic Gregorian
 *     ordinals `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_to_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4901
 * 
 * # . conversion: float64
 * cdef inline np.ndarray dt64arr_to_ts(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Convert np.ndarray[datetime64] to timestamps `<'ndarray[float64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_to_ts(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_to_ts *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_us __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_to_ts", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":4907
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4908
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Convert to seconds[float64]
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4907
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "cytimes/utils.pxd":4911
 * 
 *     # Convert to seconds[float64]
 *     arr = dt64arr_as_int64_us(arr, arr_unit, 0)  # int64[us]             # <<<<<<<<<<<<<<
 *     return arr_div(arr, US_SECOND)  # float64[s]
 * 
 */
  __pyx_t_3.__pyx_n = 2;
  __pyx_t_3.arr_unit = __pyx_v_arr_unit;
  __pyx_t_3.offset = 0;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_us(__pyx_v_arr, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "cytimes/utils.pxd":4912
 *     # Convert to seconds[float64]
 *     arr = dt64arr_as_int64_us(arr, arr_unit, 0)  # int64[us]
 *     return arr_div(arr, US_SECOND)  # float64[s]             # <<<<<<<<<<<<<<
 * 
 * # . conversion: unit
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_SECOND, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4901
 * 
 * # . conversion: float64
 * cdef inline np.ndarray dt64arr_to_ts(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Convert np.ndarray[datetime64] to timestamps `<'ndarray[float64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_to_ts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":4915
 * 
 * # . conversion: unit
 * cdef inline np.ndarray dt64arr_as_unit(np.ndarray arr, str unit, str arr_unit=None, bint limit=False):             # <<<<<<<<<<<<<<
 *     """Convert np.ndarray[datetime64] to the specified unit `<'ndarray[datetime64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_unit(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_unit, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_unit *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  int __pyx_v_limit = ((int)0);
  int __pyx_v_my_unit;
  int __pyx_v_to_unit;
  int __pyx_v_dtype;
  int __pyx_v_ns_safe;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_UCS4 __pyx_t_11;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_12;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_us __pyx_t_13;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ns __pyx_t_14;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ms __pyx_t_15;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_s __pyx_t_16;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_m __pyx_t_17;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_h __pyx_t_18;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_19;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_W __pyx_t_20;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_21;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_unit", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_limit = __pyx_optional_args->limit;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_INCREF(__pyx_v_arr_unit);

  /* "cytimes/utils.pxd":4925
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4926
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4925
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "cytimes/utils.pxd":4930
 *     # Get time unit
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "cytimes/utils.pxd":4931
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4932
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4933
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *         arr_unit = map_nptime_unit_int2str(my_unit)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_n_u_int64); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4933, __pyx_L1_error)

      /* "cytimes/utils.pxd":4932
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "cytimes/utils.pxd":4934
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr_unit = map_nptime_unit_int2str(my_unit)
 *         arr = arr.astype("datetime64[%s]" % arr_unit)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4934, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4935
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *         arr_unit = map_nptime_unit_int2str(my_unit)             # <<<<<<<<<<<<<<
 *         arr = arr.astype("datetime64[%s]" % arr_unit)
 *     elif arr_unit is not None:
 */
    __pyx_t_3 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_my_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4935, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr_unit, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.pxd":4936
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *         arr_unit = map_nptime_unit_int2str(my_unit)
 *         arr = arr.astype("datetime64[%s]" % arr_unit)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_arr_unit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4936, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4936, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.pxd":4931
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4937
 *         arr_unit = map_nptime_unit_int2str(my_unit)
 *         arr = arr.astype("datetime64[%s]" % arr_unit)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4938
 *         arr = arr.astype("datetime64[%s]" % arr_unit)
 *     elif arr_unit is not None:
 *         my_unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4938, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":4937
 *         arr_unit = map_nptime_unit_int2str(my_unit)
 *         arr = arr.astype("datetime64[%s]" % arr_unit)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":4940
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     to_unit = map_nptime_unit_str2int(unit)
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4940, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "cytimes/utils.pxd":4941
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)
 *     to_unit = map_nptime_unit_str2int(unit)             # <<<<<<<<<<<<<<
 * 
 *     # Check limit
 */
  __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4941, __pyx_L1_error)
  __pyx_v_to_unit = __pyx_t_2;

  /* "cytimes/utils.pxd":4944
 * 
 *     # Check limit
 *     if limit:             # <<<<<<<<<<<<<<
 *         if to_unit not in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 */
  if (__pyx_v_limit) {

    /* "cytimes/utils.pxd":4945
 *     # Check limit
 *     if limit:
 *         if to_unit not in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
    switch (__pyx_v_to_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":4946
 *     if limit:
 *         if to_unit not in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 *             np.NPY_DATETIMEUNIT.NPY_FR_ms,
 */
      case NPY_FR_us:

      /* "cytimes/utils.pxd":4947
 *         if to_unit not in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *             np.NPY_DATETIMEUNIT.NPY_FR_s,
 */
      case NPY_FR_ms:

      /* "cytimes/utils.pxd":4948
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 *             np.NPY_DATETIMEUNIT.NPY_FR_ms,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         ) or my_unit not in (
 */
      case NPY_FR_s:

      /* "cytimes/utils.pxd":4945
 *     # Check limit
 *     if limit:
 *         if to_unit not in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
      __pyx_t_8 = 0;
      break;
      default:
      __pyx_t_8 = 1;
      break;
    }
    __pyx_t_9 = __pyx_t_8;
    if (!__pyx_t_9) {
    } else {
      __pyx_t_1 = __pyx_t_9;
      goto __pyx_L8_bool_binop_done;
    }

    /* "cytimes/utils.pxd":4950
 *             np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *             np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         ) or my_unit not in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":4951
 *             np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         ) or my_unit not in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 *             np.NPY_DATETIMEUNIT.NPY_FR_ms,
 */
      case NPY_FR_us:

      /* "cytimes/utils.pxd":4952
 *         ) or my_unit not in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *             np.NPY_DATETIMEUNIT.NPY_FR_s,
 */
      case NPY_FR_ms:

      /* "cytimes/utils.pxd":4953
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 *             np.NPY_DATETIMEUNIT.NPY_FR_ms,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         ):
 */
      case NPY_FR_s:

      /* "cytimes/utils.pxd":4950
 *             np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *             np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         ) or my_unit not in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
      __pyx_t_9 = 0;
      break;
      default:
      __pyx_t_9 = 1;
      break;
    }
    __pyx_t_8 = __pyx_t_9;
    __pyx_t_1 = __pyx_t_8;
    __pyx_L8_bool_binop_done:;

    /* "cytimes/utils.pxd":4945
 *     # Check limit
 *     if limit:
 *         if to_unit not in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
    if (unlikely(__pyx_t_1)) {

      /* "cytimes/utils.pxd":4957
 *         ):
 *             raise ValueError(
 *                 "cannot convert ndarray from datetime64[%s] to datetime64[%s].\n"             # <<<<<<<<<<<<<<
 *                 "Conversion limits to datetime units between ['s', 'ms', 'us', 'ns']."
 *                 % (map_nptime_unit_int2str(my_unit), map_nptime_unit_int2str(to_unit))
 */
      __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = 0;
      __pyx_t_11 = 127;
      __Pyx_INCREF(__pyx_kp_u_cannot_convert_ndarray_from_date);
      __pyx_t_10 += 39;
      __Pyx_GIVEREF(__pyx_kp_u_cannot_convert_ndarray_from_date);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_cannot_convert_ndarray_from_date);

      /* "cytimes/utils.pxd":4959
 *                 "cannot convert ndarray from datetime64[%s] to datetime64[%s].\n"
 *                 "Conversion limits to datetime units between ['s', 'ms', 'us', 'ns']."
 *                 % (map_nptime_unit_int2str(my_unit), map_nptime_unit_int2str(to_unit))             # <<<<<<<<<<<<<<
 *             )
 * 
 */
      __pyx_t_4 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_my_unit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4959, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyUnicode_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4959, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_11;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_kp_u_to_datetime64);
      __pyx_t_10 += 16;
      __Pyx_GIVEREF(__pyx_kp_u_to_datetime64);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_to_datetime64);
      __pyx_t_5 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_to_unit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4959, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4959, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_11;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_kp_u_Conversion_limits_to_datetime_u);
      __pyx_t_10 += 71;
      __Pyx_GIVEREF(__pyx_kp_u_Conversion_limits_to_datetime_u);
      PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_Conversion_limits_to_datetime_u);

      /* "cytimes/utils.pxd":4957
 *         ):
 *             raise ValueError(
 *                 "cannot convert ndarray from datetime64[%s] to datetime64[%s].\n"             # <<<<<<<<<<<<<<
 *                 "Conversion limits to datetime units between ['s', 'ms', 'us', 'ns']."
 *                 % (map_nptime_unit_int2str(my_unit), map_nptime_unit_int2str(to_unit))
 */
      __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cytimes/utils.pxd":4956
 *             np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         ):
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "cannot convert ndarray from datetime64[%s] to datetime64[%s].\n"
 *                 "Conversion limits to datetime units between ['s', 'ms', 'us', 'ns']."
 */
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4956, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 4956, __pyx_L1_error)

      /* "cytimes/utils.pxd":4945
 *     # Check limit
 *     if limit:
 *         if to_unit not in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
    }

    /* "cytimes/utils.pxd":4944
 * 
 *     # Check limit
 *     if limit:             # <<<<<<<<<<<<<<
 *         if to_unit not in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 */
  }

  /* "cytimes/utils.pxd":4963
 * 
 *     # Fast-path: same unit
 *     if my_unit == to_unit:             # <<<<<<<<<<<<<<
 *         return arr
 * 
 */
  __pyx_t_1 = (__pyx_v_my_unit == __pyx_v_to_unit);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4964
 *     # Fast-path: same unit
 *     if my_unit == to_unit:
 *         return arr             # <<<<<<<<<<<<<<
 * 
 *     # To nanosecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4963
 * 
 *     # Fast-path: same unit
 *     if my_unit == to_unit:             # <<<<<<<<<<<<<<
 *         return arr
 * 
 */
  }

  /* "cytimes/utils.pxd":4968
 *     # To nanosecond
 *     cdef bint ns_safe
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         # check 'ns' overflow
 *         ns_safe = is_dt64arr_ns_safe(arr, arr_unit)
 */
  __pyx_t_1 = (__pyx_v_to_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4970
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         # check 'ns' overflow
 *         ns_safe = is_dt64arr_ns_safe(arr, arr_unit)             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [ns]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.arr_unit = __pyx_v_arr_unit;
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_12); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4970, __pyx_L1_error)
    __pyx_v_ns_safe = __pyx_t_1;

    /* "cytimes/utils.pxd":4972
 *         ns_safe = is_dt64arr_ns_safe(arr, arr_unit)
 *         # my_unit [us] -> to_unit [ns]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             if not ns_safe:
 *                 return arr
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_us:

      /* "cytimes/utils.pxd":4973
 *         # my_unit [us] -> to_unit [ns]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             if not ns_safe:             # <<<<<<<<<<<<<<
 *                 return arr
 *             return arr.astype("datetime64[ns]")
 */
      __pyx_t_1 = (!__pyx_v_ns_safe);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":4974
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             if not ns_safe:
 *                 return arr             # <<<<<<<<<<<<<<
 *             return arr.astype("datetime64[ns]")
 *         # my_unit [M, Y] -> to_unit [ns]
 */
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __Pyx_INCREF((PyObject *)__pyx_v_arr);
        __pyx_r = __pyx_v_arr;
        goto __pyx_L0;

        /* "cytimes/utils.pxd":4973
 *         # my_unit [us] -> to_unit [ns]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             if not ns_safe:             # <<<<<<<<<<<<<<
 *                 return arr
 *             return arr.astype("datetime64[ns]")
 */
      }

      /* "cytimes/utils.pxd":4975
 *             if not ns_safe:
 *                 return arr
 *             return arr.astype("datetime64[ns]")             # <<<<<<<<<<<<<<
 *         # my_unit [M, Y] -> to_unit [ns]
 *         elif my_unit in (
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4975, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_ns};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4975, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4975, __pyx_L1_error)
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":4972
 *         ns_safe = is_dt64arr_ns_safe(arr, arr_unit)
 *         # my_unit [us] -> to_unit [ns]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             if not ns_safe:
 *                 return arr
 */
      break;
      case NPY_FR_M:

      /* "cytimes/utils.pxd":4978
 *         # my_unit [M, Y] -> to_unit [ns]
 *         elif my_unit in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 */
      case NPY_FR_Y:

      /* "cytimes/utils.pxd":4981
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             if not ns_safe:             # <<<<<<<<<<<<<<
 *                 arr = dt64arr_as_int64_us(arr, arr_unit, 0)
 *                 return arr.astype("datetime64[us]")
 */
      __pyx_t_1 = (!__pyx_v_ns_safe);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":4982
 *         ):
 *             if not ns_safe:
 *                 arr = dt64arr_as_int64_us(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *                 return arr.astype("datetime64[us]")
 *             arr = dt64arr_as_int64_ns(arr, arr_unit, 0)
 */
        __pyx_t_13.__pyx_n = 2;
        __pyx_t_13.arr_unit = __pyx_v_arr_unit;
        __pyx_t_13.offset = 0;
        __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_us(__pyx_v_arr, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4982, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "cytimes/utils.pxd":4983
 *             if not ns_safe:
 *                 arr = dt64arr_as_int64_us(arr, arr_unit, 0)
 *                 return arr.astype("datetime64[us]")             # <<<<<<<<<<<<<<
 *             arr = dt64arr_as_int64_ns(arr, arr_unit, 0)
 *             return arr.astype("datetime64[ns]")
 */
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4983, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        __pyx_t_7 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_7 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_us};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4983, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4983, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_3);
        __pyx_t_3 = 0;
        goto __pyx_L0;

        /* "cytimes/utils.pxd":4981
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             if not ns_safe:             # <<<<<<<<<<<<<<
 *                 arr = dt64arr_as_int64_us(arr, arr_unit, 0)
 *                 return arr.astype("datetime64[us]")
 */
      }

      /* "cytimes/utils.pxd":4984
 *                 arr = dt64arr_as_int64_us(arr, arr_unit, 0)
 *                 return arr.astype("datetime64[us]")
 *             arr = dt64arr_as_int64_ns(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *             return arr.astype("datetime64[ns]")
 *         # my_unit [rest] -> to_unit [ns]
 */
      __pyx_t_14.__pyx_n = 2;
      __pyx_t_14.arr_unit = __pyx_v_arr_unit;
      __pyx_t_14.offset = 0;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_ns(__pyx_v_arr, &__pyx_t_14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4984, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/utils.pxd":4985
 *                 return arr.astype("datetime64[us]")
 *             arr = dt64arr_as_int64_ns(arr, arr_unit, 0)
 *             return arr.astype("datetime64[ns]")             # <<<<<<<<<<<<<<
 *         # my_unit [rest] -> to_unit [ns]
 *         if not ns_safe:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4985, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_ns};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4985, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4985, __pyx_L1_error)
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":4977
 *             return arr.astype("datetime64[ns]")
 *         # my_unit [M, Y] -> to_unit [ns]
 *         elif my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
      break;
      default: break;
    }

    /* "cytimes/utils.pxd":4987
 *             return arr.astype("datetime64[ns]")
 *         # my_unit [rest] -> to_unit [ns]
 *         if not ns_safe:             # <<<<<<<<<<<<<<
 *             return arr.astype("datetime64[us]")
 *         return arr.astype("datetime64[ns]")
 */
    __pyx_t_1 = (!__pyx_v_ns_safe);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":4988
 *         # my_unit [rest] -> to_unit [ns]
 *         if not ns_safe:
 *             return arr.astype("datetime64[us]")             # <<<<<<<<<<<<<<
 *         return arr.astype("datetime64[ns]")
 * 
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4988, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_us};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4988, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4988, __pyx_L1_error)
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":4987
 *             return arr.astype("datetime64[ns]")
 *         # my_unit [rest] -> to_unit [ns]
 *         if not ns_safe:             # <<<<<<<<<<<<<<
 *             return arr.astype("datetime64[us]")
 *         return arr.astype("datetime64[ns]")
 */
    }

    /* "cytimes/utils.pxd":4989
 *         if not ns_safe:
 *             return arr.astype("datetime64[us]")
 *         return arr.astype("datetime64[ns]")             # <<<<<<<<<<<<<<
 * 
 *     # To microsecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_ns};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4989, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4968
 *     # To nanosecond
 *     cdef bint ns_safe
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         # check 'ns' overflow
 *         ns_safe = is_dt64arr_ns_safe(arr, arr_unit)
 */
  }

  /* "cytimes/utils.pxd":4992
 * 
 *     # To microsecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  __pyx_t_1 = (__pyx_v_to_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":4994
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_MICROSECOND)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":4995
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_MICROSECOND)
 *         # my_unit [M, Y] -> to_unit [us]
 */
      __pyx_t_12.__pyx_n = 1;
      __pyx_t_12.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_12); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4995, __pyx_L1_error)
      __pyx_t_8 = (!__pyx_t_1);
      if (__pyx_t_8) {

        /* "cytimes/utils.pxd":4996
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_MICROSECOND)             # <<<<<<<<<<<<<<
 *         # my_unit [M, Y] -> to_unit [us]
 *         elif my_unit in (
 */
        __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4996, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "cytimes/utils.pxd":4995
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_MICROSECOND)
 *         # my_unit [M, Y] -> to_unit [us]
 */
      }

      /* "cytimes/utils.pxd":4994
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_MICROSECOND)
 */
      break;
      case NPY_FR_M:

      /* "cytimes/utils.pxd":4999
 *         # my_unit [M, Y] -> to_unit [us]
 *         elif my_unit in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 */
      case NPY_FR_Y:

      /* "cytimes/utils.pxd":5002
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             arr = dt64arr_as_int64_us(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *         # my_unit [rest] -> to_unit [us]
 *         return arr.astype("datetime64[us]")
 */
      __pyx_t_13.__pyx_n = 2;
      __pyx_t_13.arr_unit = __pyx_v_arr_unit;
      __pyx_t_13.offset = 0;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_us(__pyx_v_arr, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5002, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/utils.pxd":4998
 *                 arr = arr_floor_div(arr, NS_MICROSECOND)
 *         # my_unit [M, Y] -> to_unit [us]
 *         elif my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
      break;
      default: break;
    }

    /* "cytimes/utils.pxd":5004
 *             arr = dt64arr_as_int64_us(arr, arr_unit, 0)
 *         # my_unit [rest] -> to_unit [us]
 *         return arr.astype("datetime64[us]")             # <<<<<<<<<<<<<<
 * 
 *     # To millisecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5004, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_us};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5004, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5004, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":4992
 * 
 *     # To microsecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  }

  /* "cytimes/utils.pxd":5007
 * 
 *     # To millisecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  __pyx_t_8 = (__pyx_v_to_unit == NPY_FR_ms);
  if (__pyx_t_8) {

    /* "cytimes/utils.pxd":5009
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_MILLISECOND)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5010
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_MILLISECOND)
 *         # my_unit [M, Y] -> to_unit [ms]
 */
      __pyx_t_12.__pyx_n = 1;
      __pyx_t_12.arr_unit = __pyx_n_u_ns;
      __pyx_t_8 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_12); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 5010, __pyx_L1_error)
      __pyx_t_1 = (!__pyx_t_8);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5011
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_MILLISECOND)             # <<<<<<<<<<<<<<
 *         # my_unit [M, Y] -> to_unit [ms]
 *         elif my_unit in (
 */
        __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MILLISECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5011, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "cytimes/utils.pxd":5010
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_MILLISECOND)
 *         # my_unit [M, Y] -> to_unit [ms]
 */
      }

      /* "cytimes/utils.pxd":5009
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_MILLISECOND)
 */
      break;
      case NPY_FR_M:

      /* "cytimes/utils.pxd":5014
 *         # my_unit [M, Y] -> to_unit [ms]
 *         elif my_unit in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 */
      case NPY_FR_Y:

      /* "cytimes/utils.pxd":5017
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             arr = dt64arr_as_int64_ms(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *         # my_unit [rest] -> to_unit [ms]
 *         return arr.astype("datetime64[ms]")
 */
      __pyx_t_15.__pyx_n = 2;
      __pyx_t_15.arr_unit = __pyx_v_arr_unit;
      __pyx_t_15.offset = 0;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_ms(__pyx_v_arr, &__pyx_t_15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5017, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/utils.pxd":5013
 *                 arr = arr_floor_div(arr, NS_MILLISECOND)
 *         # my_unit [M, Y] -> to_unit [ms]
 *         elif my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
      break;
      default: break;
    }

    /* "cytimes/utils.pxd":5019
 *             arr = dt64arr_as_int64_ms(arr, arr_unit, 0)
 *         # my_unit [rest] -> to_unit [ms]
 *         return arr.astype("datetime64[ms]")             # <<<<<<<<<<<<<<
 * 
 *     # To second
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5019, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_ms};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5019, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5019, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5007
 * 
 *     # To millisecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  }

  /* "cytimes/utils.pxd":5022
 * 
 *     # To second
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  __pyx_t_1 = (__pyx_v_to_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5024
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_SECOND)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5025
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_SECOND)
 *         # my_unit [M, Y] -> to_unit [s]
 */
      __pyx_t_12.__pyx_n = 1;
      __pyx_t_12.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_12); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5025, __pyx_L1_error)
      __pyx_t_8 = (!__pyx_t_1);
      if (__pyx_t_8) {

        /* "cytimes/utils.pxd":5026
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_SECOND)             # <<<<<<<<<<<<<<
 *         # my_unit [M, Y] -> to_unit [s]
 *         elif my_unit in (
 */
        __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_SECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5026, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "cytimes/utils.pxd":5025
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_SECOND)
 *         # my_unit [M, Y] -> to_unit [s]
 */
      }

      /* "cytimes/utils.pxd":5024
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_SECOND)
 */
      break;
      case NPY_FR_M:

      /* "cytimes/utils.pxd":5029
 *         # my_unit [M, Y] -> to_unit [s]
 *         elif my_unit in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 */
      case NPY_FR_Y:

      /* "cytimes/utils.pxd":5032
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             arr = dt64arr_as_int64_s(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *         # my_unit [rest] -> to_unit [s]
 *         return arr.astype("datetime64[s]")
 */
      __pyx_t_16.__pyx_n = 2;
      __pyx_t_16.arr_unit = __pyx_v_arr_unit;
      __pyx_t_16.offset = 0;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_s(__pyx_v_arr, &__pyx_t_16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5032, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/utils.pxd":5028
 *                 arr = arr_floor_div(arr, NS_SECOND)
 *         # my_unit [M, Y] -> to_unit [s]
 *         elif my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
      break;
      default: break;
    }

    /* "cytimes/utils.pxd":5034
 *             arr = dt64arr_as_int64_s(arr, arr_unit, 0)
 *         # my_unit [rest] -> to_unit [s]
 *         return arr.astype("datetime64[s]")             # <<<<<<<<<<<<<<
 * 
 *     # To minute
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5034, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_s_2};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5034, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5034, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5022
 * 
 *     # To second
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  }

  /* "cytimes/utils.pxd":5037
 * 
 *     # To minute
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  __pyx_t_8 = (__pyx_v_to_unit == NPY_FR_m);
  if (__pyx_t_8) {

    /* "cytimes/utils.pxd":5039
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_MINUTE)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5040
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_MINUTE)
 *         # my_unit [M, Y] -> to_unit [m]
 */
      __pyx_t_12.__pyx_n = 1;
      __pyx_t_12.arr_unit = __pyx_n_u_ns;
      __pyx_t_8 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_12); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 5040, __pyx_L1_error)
      __pyx_t_1 = (!__pyx_t_8);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5041
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_MINUTE)             # <<<<<<<<<<<<<<
 *         # my_unit [M, Y] -> to_unit [m]
 *         elif my_unit in (
 */
        __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MINUTE, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5041, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "cytimes/utils.pxd":5040
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_MINUTE)
 *         # my_unit [M, Y] -> to_unit [m]
 */
      }

      /* "cytimes/utils.pxd":5039
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_MINUTE)
 */
      break;
      case NPY_FR_M:

      /* "cytimes/utils.pxd":5044
 *         # my_unit [M, Y] -> to_unit [m]
 *         elif my_unit in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 */
      case NPY_FR_Y:

      /* "cytimes/utils.pxd":5047
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             arr = dt64arr_as_int64_m(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *         # my_unit [rest] -> to_unit [m]
 *         return arr.astype("datetime64[m]")
 */
      __pyx_t_17.__pyx_n = 2;
      __pyx_t_17.arr_unit = __pyx_v_arr_unit;
      __pyx_t_17.offset = 0;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_m(__pyx_v_arr, &__pyx_t_17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5047, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/utils.pxd":5043
 *                 arr = arr_floor_div(arr, NS_MINUTE)
 *         # my_unit [M, Y] -> to_unit [m]
 *         elif my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
      break;
      default: break;
    }

    /* "cytimes/utils.pxd":5049
 *             arr = dt64arr_as_int64_m(arr, arr_unit, 0)
 *         # my_unit [rest] -> to_unit [m]
 *         return arr.astype("datetime64[m]")             # <<<<<<<<<<<<<<
 * 
 *     # To hour
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_m};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5049, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5049, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5037
 * 
 *     # To minute
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  }

  /* "cytimes/utils.pxd":5052
 * 
 *     # To hour
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  __pyx_t_1 = (__pyx_v_to_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5054
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_HOUR)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5055
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_HOUR)
 *         # my_unit [M, Y] -> to_unit [h]
 */
      __pyx_t_12.__pyx_n = 1;
      __pyx_t_12.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_12); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5055, __pyx_L1_error)
      __pyx_t_8 = (!__pyx_t_1);
      if (__pyx_t_8) {

        /* "cytimes/utils.pxd":5056
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_HOUR)             # <<<<<<<<<<<<<<
 *         # my_unit [M, Y] -> to_unit [h]
 *         elif my_unit in (
 */
        __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_HOUR, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5056, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "cytimes/utils.pxd":5055
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_HOUR)
 *         # my_unit [M, Y] -> to_unit [h]
 */
      }

      /* "cytimes/utils.pxd":5054
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_HOUR)
 */
      break;
      case NPY_FR_M:

      /* "cytimes/utils.pxd":5059
 *         # my_unit [M, Y] -> to_unit [h]
 *         elif my_unit in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 */
      case NPY_FR_Y:

      /* "cytimes/utils.pxd":5062
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             arr = dt64arr_as_int64_h(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *         # my_unit [rest] -> to_unit [h]
 *         return arr.astype("datetime64[h]")
 */
      __pyx_t_18.__pyx_n = 2;
      __pyx_t_18.arr_unit = __pyx_v_arr_unit;
      __pyx_t_18.offset = 0;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_h(__pyx_v_arr, &__pyx_t_18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5062, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/utils.pxd":5058
 *                 arr = arr_floor_div(arr, NS_HOUR)
 *         # my_unit [M, Y] -> to_unit [h]
 *         elif my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
      break;
      default: break;
    }

    /* "cytimes/utils.pxd":5064
 *             arr = dt64arr_as_int64_h(arr, arr_unit, 0)
 *         # my_unit [rest] -> to_unit [h]
 *         return arr.astype("datetime64[h]")             # <<<<<<<<<<<<<<
 * 
 *     # To day
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_h};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5064, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5064, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5052
 * 
 *     # To hour
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  }

  /* "cytimes/utils.pxd":5067
 * 
 *     # To day
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  __pyx_t_8 = (__pyx_v_to_unit == NPY_FR_D);
  if (__pyx_t_8) {

    /* "cytimes/utils.pxd":5069
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_DAY)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5070
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_DAY)
 *         # my_unit [M, Y] -> to_unit [D]
 */
      __pyx_t_12.__pyx_n = 1;
      __pyx_t_12.arr_unit = __pyx_n_u_ns;
      __pyx_t_8 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_12); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 5070, __pyx_L1_error)
      __pyx_t_1 = (!__pyx_t_8);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5071
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_DAY)             # <<<<<<<<<<<<<<
 *         # my_unit [M, Y] -> to_unit [D]
 *         elif my_unit in (
 */
        __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5071, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "cytimes/utils.pxd":5070
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_DAY)
 *         # my_unit [M, Y] -> to_unit [D]
 */
      }

      /* "cytimes/utils.pxd":5069
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_DAY)
 */
      break;
      case NPY_FR_M:

      /* "cytimes/utils.pxd":5074
 *         # my_unit [M, Y] -> to_unit [D]
 *         elif my_unit in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 */
      case NPY_FR_Y:

      /* "cytimes/utils.pxd":5077
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *         # my_unit [rest] -> to_unit [D]
 *         return arr.astype("datetime64[D]")
 */
      __pyx_t_19.__pyx_n = 2;
      __pyx_t_19.arr_unit = __pyx_v_arr_unit;
      __pyx_t_19.offset = 0;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5077, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/utils.pxd":5073
 *                 arr = arr_floor_div(arr, NS_DAY)
 *         # my_unit [M, Y] -> to_unit [D]
 *         elif my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
      break;
      default: break;
    }

    /* "cytimes/utils.pxd":5079
 *             arr = dt64arr_as_int64_D(arr, arr_unit, 0)
 *         # my_unit [rest] -> to_unit [D]
 *         return arr.astype("datetime64[D]")             # <<<<<<<<<<<<<<
 * 
 *     # To week
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_D};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5079, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5079, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5067
 * 
 *     # To day
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  }

  /* "cytimes/utils.pxd":5082
 * 
 *     # To week
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_W:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [W]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  __pyx_t_1 = (__pyx_v_to_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5084
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_W:
 *         # my_unit [ns] -> to_unit [W]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_DAY * 7)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5085
 *         # my_unit [ns] -> to_unit [W]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_DAY * 7)
 *         # my_unit [M, Y] -> to_unit [W]
 */
      __pyx_t_12.__pyx_n = 1;
      __pyx_t_12.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_12); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5085, __pyx_L1_error)
      __pyx_t_8 = (!__pyx_t_1);
      if (__pyx_t_8) {

        /* "cytimes/utils.pxd":5086
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_DAY * 7)             # <<<<<<<<<<<<<<
 *         # my_unit [M, Y] -> to_unit [W]
 *         elif my_unit in (
 */
        __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, (__pyx_v_7cytimes_5utils_NS_DAY * 7), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5086, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "cytimes/utils.pxd":5085
 *         # my_unit [ns] -> to_unit [W]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_DAY * 7)
 *         # my_unit [M, Y] -> to_unit [W]
 */
      }

      /* "cytimes/utils.pxd":5084
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_W:
 *         # my_unit [ns] -> to_unit [W]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_DAY * 7)
 */
      break;
      case NPY_FR_M:

      /* "cytimes/utils.pxd":5089
 *         # my_unit [M, Y] -> to_unit [W]
 *         elif my_unit in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 */
      case NPY_FR_Y:

      /* "cytimes/utils.pxd":5092
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             arr = dt64arr_as_int64_W(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *         # my_unit [rest] -> to_unit [D]
 *         return arr.astype("datetime64[W]")
 */
      __pyx_t_20.__pyx_n = 2;
      __pyx_t_20.arr_unit = __pyx_v_arr_unit;
      __pyx_t_20.offset = 0;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_W(__pyx_v_arr, &__pyx_t_20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5092, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/utils.pxd":5088
 *                 arr = arr_floor_div(arr, NS_DAY * 7)
 *         # my_unit [M, Y] -> to_unit [W]
 *         elif my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
      break;
      default: break;
    }

    /* "cytimes/utils.pxd":5094
 *             arr = dt64arr_as_int64_W(arr, arr_unit, 0)
 *         # my_unit [rest] -> to_unit [D]
 *         return arr.astype("datetime64[W]")             # <<<<<<<<<<<<<<
 * 
 *     # To month
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_W};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5094, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5094, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5082
 * 
 *     # To week
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_W:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [W]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  }

  /* "cytimes/utils.pxd":5097
 * 
 *     # To month
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_M:             # <<<<<<<<<<<<<<
 *         # my_unit [ns, Y] -> to_unit [M]
 *         if my_unit in (
 */
  __pyx_t_8 = (__pyx_v_to_unit == NPY_FR_M);
  if (__pyx_t_8) {

    /* "cytimes/utils.pxd":5099
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         # my_unit [ns, Y] -> to_unit [M]
 *         if my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5100
 *         # my_unit [ns, Y] -> to_unit [M]
 *         if my_unit in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 */
      case NPY_FR_Y:

      /* "cytimes/utils.pxd":5103
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             arr = dt64arr_as_int64_M(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *         # my_unit [rest] -> to_unit [M]
 *         return arr.astype("datetime64[M]")
 */
      __pyx_t_21.__pyx_n = 2;
      __pyx_t_21.arr_unit = __pyx_v_arr_unit;
      __pyx_t_21.offset = 0;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/utils.pxd":5099
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         # my_unit [ns, Y] -> to_unit [M]
 *         if my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
      break;
      default: break;
    }

    /* "cytimes/utils.pxd":5105
 *             arr = dt64arr_as_int64_M(arr, arr_unit, 0)
 *         # my_unit [rest] -> to_unit [M]
 *         return arr.astype("datetime64[M]")             # <<<<<<<<<<<<<<
 * 
 *     # To year
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_M};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5105, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5105, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5097
 * 
 *     # To month
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_M:             # <<<<<<<<<<<<<<
 *         # my_unit [ns, Y] -> to_unit [M]
 *         if my_unit in (
 */
  }

  /* "cytimes/utils.pxd":5108
 * 
 *     # To year
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         arr = dt64arr_as_int64_Y(arr, arr_unit, 0)
 *         return arr.astype("datetime64[Y]")
 */
  __pyx_t_8 = (__pyx_v_to_unit == NPY_FR_Y);
  if (__pyx_t_8) {

    /* "cytimes/utils.pxd":5109
 *     # To year
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         arr = dt64arr_as_int64_Y(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *         return arr.astype("datetime64[Y]")
 * 
 */
    __pyx_t_22.__pyx_n = 2;
    __pyx_t_22.arr_unit = __pyx_v_arr_unit;
    __pyx_t_22.offset = 0;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.pxd":5110
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         arr = dt64arr_as_int64_Y(arr, arr_unit, 0)
 *         return arr.astype("datetime64[Y]")             # <<<<<<<<<<<<<<
 * 
 *     # Rest
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_Y};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5110, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5110, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5108
 * 
 *     # To year
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         arr = dt64arr_as_int64_Y(arr, arr_unit, 0)
 *         return arr.astype("datetime64[Y]")
 */
  }

  /* "cytimes/utils.pxd":5113
 * 
 *     # Rest
 *     return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(to_unit))             # <<<<<<<<<<<<<<
 * 
 * # . arithmetic
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_to_unit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5113, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":4915
 * 
 * # . conversion: unit
 * cdef inline np.ndarray dt64arr_as_unit(np.ndarray arr, str unit, str arr_unit=None, bint limit=False):             # <<<<<<<<<<<<<<
 *     """Convert np.ndarray[datetime64] to the specified unit `<'ndarray[datetime64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_arr_unit);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":5116
 * 
 * # . arithmetic
 * cdef inline np.ndarray dt64arr_round(np.ndarray arr, str unit, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Perform round operation on the np.ndarray[datetime64] to the
 *     specified unit `<'ndarray[datetime64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_round(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_unit, struct __pyx_opt_args_7cytimes_5utils_dt64arr_round *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  int __pyx_v_my_unit;
  int __pyx_v_to_unit;
  int __pyx_v_dtype;
  PyObject *__pyx_v_to_dtype = NULL;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_arr_round_to_mul __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_round", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":5124
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5125
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5124
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "cytimes/utils.pxd":5129
 *     # Get time unit
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "cytimes/utils.pxd":5130
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5131
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":5132
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_n_u_int64); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5132, __pyx_L1_error)

      /* "cytimes/utils.pxd":5131
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "cytimes/utils.pxd":5133
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 5133, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":5130
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":5134
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5135
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:
 *         my_unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 5135, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":5134
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":5137
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     to_unit = map_nptime_unit_str2int(unit)
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 5137, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "cytimes/utils.pxd":5138
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)
 *     to_unit = map_nptime_unit_str2int(unit)             # <<<<<<<<<<<<<<
 * 
 *     # Fast-path
 */
  __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 5138, __pyx_L1_error)
  __pyx_v_to_unit = __pyx_t_2;

  /* "cytimes/utils.pxd":5143
 *     #: 1. same or my_unit is lower than to_unit (ms is lower than us)
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr
 */
  __pyx_t_3 = (__pyx_v_my_unit <= __pyx_v_to_unit);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_to_unit == NPY_FR_ns);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5144
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             return arr
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))
 */
    __pyx_t_1 = (__pyx_v_dtype == NPY_DATETIME);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":5145
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr             # <<<<<<<<<<<<<<
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))
 * 
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":5144
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             return arr
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))
 */
    }

    /* "cytimes/utils.pxd":5146
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))             # <<<<<<<<<<<<<<
 * 
 *     # To microsecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_my_unit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5146, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5143
 *     #: 1. same or my_unit is lower than to_unit (ms is lower than us)
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr
 */
  }

  /* "cytimes/utils.pxd":5149
 * 
 *     # To microsecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  switch (__pyx_v_to_unit) {
    case NPY_FR_us:

    /* "cytimes/utils.pxd":5151
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MICROSECOND)
 */
    __pyx_t_1 = (__pyx_v_my_unit == NPY_FR_ns);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":5152
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5152, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5153
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MICROSECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5153, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5154
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_round_div(arr, NS_MICROSECOND)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/utils.pxd":5152
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L11;
      }

      /* "cytimes/utils.pxd":5156
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_round_div(arr, NS_MICROSECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [D...us] are lower units, which is covered
 */
      /*else*/ {
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5156, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5157
 *             else:
 *                 arr = arr_round_div(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...us] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L11:;

      /* "cytimes/utils.pxd":5151
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MICROSECOND)
 */
      goto __pyx_L10;
    }

    /* "cytimes/utils.pxd":5161
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("round", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To millisecond
 */
    /*else*/ {
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_round, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5161, __pyx_L1_error)
    }
    __pyx_L10:;

    /* "cytimes/utils.pxd":5149
 * 
 *     # To microsecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_ms:

    /* "cytimes/utils.pxd":5166
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MILLISECOND)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5167
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_MILLISECOND)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5167, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5168
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MILLISECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MILLISECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5168, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5169
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MILLISECOND)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_MILLISECOND, US_MILLISECOND)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/utils.pxd":5167
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_MILLISECOND)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L12;
      }

      /* "cytimes/utils.pxd":5171
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_MILLISECOND, US_MILLISECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [ms]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_MILLISECOND;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MILLISECOND, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5171, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5172
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_MILLISECOND, US_MILLISECOND)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [ms]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L12:;

      /* "cytimes/utils.pxd":5166
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MILLISECOND)
 */
      break;
      case NPY_FR_us:

      /* "cytimes/utils.pxd":5175
 *         # my_unit [us] -> to_unit [ms]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_MILLISECOND)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [D...ms] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MILLISECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5176
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_MILLISECOND)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...ms] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "cytimes/utils.pxd":5174
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [ms]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, US_MILLISECOND)
 *             to_dtype = "datetime64[us]"
 */
      break;
      default:

      /* "cytimes/utils.pxd":5180
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("round", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To second
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_round, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5180, __pyx_L1_error)
      break;
    }

    /* "cytimes/utils.pxd":5164
 * 
 *     # To millisecond
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_s:

    /* "cytimes/utils.pxd":5185
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_SECOND)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5186
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_SECOND)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5186, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5187
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_SECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_SECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5188
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_SECOND)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_SECOND, US_SECOND)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/utils.pxd":5186
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_SECOND)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L13;
      }

      /* "cytimes/utils.pxd":5190
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_SECOND, US_SECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [s]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_SECOND;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_SECOND, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5190, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5191
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_SECOND, US_SECOND)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L13:;

      /* "cytimes/utils.pxd":5185
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_SECOND)
 */
      break;
      case NPY_FR_us:

      /* "cytimes/utils.pxd":5194
 *         # my_unit [us] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_SECOND)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [s]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_SECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5195
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_SECOND)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "cytimes/utils.pxd":5193
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, US_SECOND)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "cytimes/utils.pxd":5198
 *         # my_unit [ms] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_round_to_mul(arr, MS_SECOND)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [D...s] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_SECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5199
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_round_to_mul(arr, MS_SECOND)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...s] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "cytimes/utils.pxd":5197
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, MS_SECOND)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      default:

      /* "cytimes/utils.pxd":5203
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("round", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To minute
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_round, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5203, __pyx_L1_error)
      break;
    }

    /* "cytimes/utils.pxd":5183
 * 
 *     # To second
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_m:

    /* "cytimes/utils.pxd":5208
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MINUTE)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5209
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_MINUTE)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5209, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5210
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MINUTE)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5210, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5211
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MINUTE)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_MINUTE, US_MINUTE)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/utils.pxd":5209
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_MINUTE)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L14;
      }

      /* "cytimes/utils.pxd":5213
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_MINUTE, US_MINUTE)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [m]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_MINUTE;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MINUTE, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5213, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5214
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_MINUTE, US_MINUTE)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L14:;

      /* "cytimes/utils.pxd":5208
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MINUTE)
 */
      break;
      case NPY_FR_us:

      /* "cytimes/utils.pxd":5217
 *         # my_unit [us] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_MINUTE)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [m]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5218
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_MINUTE)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "cytimes/utils.pxd":5216
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, US_MINUTE)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "cytimes/utils.pxd":5221
 *         # my_unit [ms] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_round_to_mul(arr, MS_MINUTE)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [m]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5221, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5222
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_round_to_mul(arr, MS_MINUTE)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [s] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "cytimes/utils.pxd":5220
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, MS_MINUTE)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      case NPY_FR_s:

      /* "cytimes/utils.pxd":5225
 *         # my_unit [s] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_round_to_mul(arr, SS_MINUTE)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[s]"
 *         # my_unit [D...m] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5225, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5226
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_round_to_mul(arr, SS_MINUTE)
 *             to_dtype = "datetime64[s]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...m] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_s_2);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_s_2;

      /* "cytimes/utils.pxd":5224
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, SS_MINUTE)
 *             to_dtype = "datetime64[s]"
 */
      break;
      default:

      /* "cytimes/utils.pxd":5230
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("round", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To hour
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_round, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5230, __pyx_L1_error)
      break;
    }

    /* "cytimes/utils.pxd":5206
 * 
 *     # To minute
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_h:

    /* "cytimes/utils.pxd":5235
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_HOUR)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5236
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_HOUR)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5236, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5237
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_HOUR)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5237, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5238
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_HOUR)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_HOUR, US_HOUR)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/utils.pxd":5236
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_HOUR)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L15;
      }

      /* "cytimes/utils.pxd":5240
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_HOUR, US_HOUR)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [h]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_HOUR;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_HOUR, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5241
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_HOUR, US_HOUR)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L15:;

      /* "cytimes/utils.pxd":5235
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_HOUR)
 */
      break;
      case NPY_FR_us:

      /* "cytimes/utils.pxd":5244
 *         # my_unit [us] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_HOUR)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [h]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5244, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5245
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_HOUR)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "cytimes/utils.pxd":5243
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, US_HOUR)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "cytimes/utils.pxd":5248
 *         # my_unit [ms] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_round_to_mul(arr, MS_HOUR)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [h]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5249
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_round_to_mul(arr, MS_HOUR)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [s] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "cytimes/utils.pxd":5247
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, MS_HOUR)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      case NPY_FR_s:

      /* "cytimes/utils.pxd":5252
 *         # my_unit [s] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_round_to_mul(arr, SS_HOUR)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [h]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5253
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_round_to_mul(arr, SS_HOUR)
 *             to_dtype = "datetime64[s]"             # <<<<<<<<<<<<<<
 *         # my_unit [m] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_s_2);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_s_2;

      /* "cytimes/utils.pxd":5251
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, SS_HOUR)
 *             to_dtype = "datetime64[s]"
 */
      break;
      case NPY_FR_m:

      /* "cytimes/utils.pxd":5256
 *         # my_unit [m] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_round_to_mul(arr, 60)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[m]"
 *         # my_unit [D...h] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, 60, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5257
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_round_to_mul(arr, 60)
 *             to_dtype = "datetime64[m]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...h] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_m);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_m;

      /* "cytimes/utils.pxd":5255
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, 60)
 *             to_dtype = "datetime64[m]"
 */
      break;
      default:

      /* "cytimes/utils.pxd":5261
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("round", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To day
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_round, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5261, __pyx_L1_error)
      break;
    }

    /* "cytimes/utils.pxd":5233
 * 
 *     # To hour
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_D:

    /* "cytimes/utils.pxd":5266
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_DAY)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5267
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_DAY)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5267, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5268
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_DAY)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5268, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5269
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_DAY)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_DAY, US_DAY)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/utils.pxd":5267
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_DAY)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L16;
      }

      /* "cytimes/utils.pxd":5271
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_DAY, US_DAY)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [D]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_DAY;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5271, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5272
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_DAY, US_DAY)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L16:;

      /* "cytimes/utils.pxd":5266
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_DAY)
 */
      break;
      case NPY_FR_us:

      /* "cytimes/utils.pxd":5275
 *         # my_unit [us] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_DAY)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5275, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5276
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_DAY)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "cytimes/utils.pxd":5274
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, US_DAY)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "cytimes/utils.pxd":5279
 *         # my_unit [ms] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_round_to_mul(arr, MS_DAY)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5280
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_round_to_mul(arr, MS_DAY)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [s] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "cytimes/utils.pxd":5278
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, MS_DAY)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      case NPY_FR_s:

      /* "cytimes/utils.pxd":5283
 *         # my_unit [s] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_round_to_mul(arr, SS_DAY)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5283, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5284
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_round_to_mul(arr, SS_DAY)
 *             to_dtype = "datetime64[s]"             # <<<<<<<<<<<<<<
 *         # my_unit [m] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_s_2);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_s_2;

      /* "cytimes/utils.pxd":5282
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, SS_DAY)
 *             to_dtype = "datetime64[s]"
 */
      break;
      case NPY_FR_m:

      /* "cytimes/utils.pxd":5287
 *         # my_unit [m] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_round_to_mul(arr, 1440)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[m]"
 *         # my_unit [h] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, 0x5A0, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5288
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_round_to_mul(arr, 1440)
 *             to_dtype = "datetime64[m]"             # <<<<<<<<<<<<<<
 *         # my_unit [h] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_m);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_m;

      /* "cytimes/utils.pxd":5286
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, 1440)
 *             to_dtype = "datetime64[m]"
 */
      break;
      case NPY_FR_h:

      /* "cytimes/utils.pxd":5291
 *         # my_unit [h] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *             arr = arr_round_to_mul(arr, 24)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[h]"
 *         # my_unit [D] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, 24, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5292
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *             arr = arr_round_to_mul(arr, 24)
 *             to_dtype = "datetime64[h]"             # <<<<<<<<<<<<<<
 *         # my_unit [D] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_h);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_h;

      /* "cytimes/utils.pxd":5290
 *             to_dtype = "datetime64[m]"
 *         # my_unit [h] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, 24)
 *             to_dtype = "datetime64[h]"
 */
      break;
      default:

      /* "cytimes/utils.pxd":5296
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("round", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # Invalid unit
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_round, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5296, __pyx_L1_error)
      break;
    }

    /* "cytimes/utils.pxd":5264
 * 
 *     # To day
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    default:

    /* "cytimes/utils.pxd":5300
 *     # Invalid unit
 *     else:
 *         _raise_dt64arr_rcl_unsupport_unit_error("round", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # Convert to datetime64
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_round, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5300, __pyx_L1_error)
    break;
  }

  /* "cytimes/utils.pxd":5303
 * 
 *     # Convert to datetime64
 *     return arr.astype(to_dtype)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_ceil(np.ndarray arr, str unit, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(!__pyx_v_to_dtype)) { __Pyx_RaiseUnboundLocalError("to_dtype"); __PYX_ERR(0, 5303, __pyx_L1_error) }
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_to_dtype};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5303, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":5116
 * 
 * # . arithmetic
 * cdef inline np.ndarray dt64arr_round(np.ndarray arr, str unit, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Perform round operation on the np.ndarray[datetime64] to the
 *     specified unit `<'ndarray[datetime64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_round", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_to_dtype);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":5305
 *     return arr.astype(to_dtype)
 * 
 * cdef inline np.ndarray dt64arr_ceil(np.ndarray arr, str unit, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Perform ceil operation on the np.ndarray[datetime64] to the
 *     specified unit `<'ndarray[datetime64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_ceil(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_unit, struct __pyx_opt_args_7cytimes_5utils_dt64arr_ceil *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  int __pyx_v_my_unit;
  int __pyx_v_to_unit;
  int __pyx_v_dtype;
  PyObject *__pyx_v_to_dtype = NULL;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_arr_ceil_to_mul __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_ceil", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":5313
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5314
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5313
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "cytimes/utils.pxd":5318
 *     # Get time unit
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "cytimes/utils.pxd":5319
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5320
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":5321
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_n_u_int64); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5321, __pyx_L1_error)

      /* "cytimes/utils.pxd":5320
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "cytimes/utils.pxd":5322
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 5322, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":5319
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":5323
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5324
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:
 *         my_unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 5324, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":5323
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":5326
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     to_unit = map_nptime_unit_str2int(unit)
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 5326, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "cytimes/utils.pxd":5327
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)
 *     to_unit = map_nptime_unit_str2int(unit)             # <<<<<<<<<<<<<<
 * 
 *     # Fast-path
 */
  __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 5327, __pyx_L1_error)
  __pyx_v_to_unit = __pyx_t_2;

  /* "cytimes/utils.pxd":5332
 *     #: 1. same or my_unit is lower than to_unit (ms is lower than us)
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr
 */
  __pyx_t_3 = (__pyx_v_my_unit <= __pyx_v_to_unit);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_to_unit == NPY_FR_ns);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5333
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             return arr
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))
 */
    __pyx_t_1 = (__pyx_v_dtype == NPY_DATETIME);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":5334
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr             # <<<<<<<<<<<<<<
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))
 * 
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":5333
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             return arr
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))
 */
    }

    /* "cytimes/utils.pxd":5335
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))             # <<<<<<<<<<<<<<
 * 
 *     # To microsecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_my_unit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5335, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5335, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5332
 *     #: 1. same or my_unit is lower than to_unit (ms is lower than us)
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr
 */
  }

  /* "cytimes/utils.pxd":5338
 * 
 *     # To microsecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  switch (__pyx_v_to_unit) {
    case NPY_FR_us:

    /* "cytimes/utils.pxd":5340
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MICROSECOND)
 */
    __pyx_t_1 = (__pyx_v_my_unit == NPY_FR_ns);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":5341
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5341, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5342
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MICROSECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5343
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_ceil_div(arr, NS_MICROSECOND)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/utils.pxd":5341
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L11;
      }

      /* "cytimes/utils.pxd":5345
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_ceil_div(arr, NS_MICROSECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [D...us] are lower units, which is covered
 */
      /*else*/ {
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5345, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5346
 *             else:
 *                 arr = arr_ceil_div(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...us] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L11:;

      /* "cytimes/utils.pxd":5340
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MICROSECOND)
 */
      goto __pyx_L10;
    }

    /* "cytimes/utils.pxd":5350
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("ceil", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To millisecond
 */
    /*else*/ {
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_ceil, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5350, __pyx_L1_error)
    }
    __pyx_L10:;

    /* "cytimes/utils.pxd":5338
 * 
 *     # To microsecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_ms:

    /* "cytimes/utils.pxd":5355
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MILLISECOND)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5356
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_MILLISECOND)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5356, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5357
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MILLISECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MILLISECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5357, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5358
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MILLISECOND)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_MILLISECOND, US_MILLISECOND)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/utils.pxd":5356
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_MILLISECOND)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L12;
      }

      /* "cytimes/utils.pxd":5360
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_MILLISECOND, US_MILLISECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [ms]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_MILLISECOND;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MILLISECOND, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5360, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5361
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_MILLISECOND, US_MILLISECOND)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [ms]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L12:;

      /* "cytimes/utils.pxd":5355
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MILLISECOND)
 */
      break;
      case NPY_FR_us:

      /* "cytimes/utils.pxd":5364
 *         # my_unit [us] -> to_unit [ms]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_MILLISECOND)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [D...ms] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MILLISECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5364, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5365
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_MILLISECOND)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...ms] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "cytimes/utils.pxd":5363
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [ms]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, US_MILLISECOND)
 *             to_dtype = "datetime64[us]"
 */
      break;
      default:

      /* "cytimes/utils.pxd":5369
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("ceil", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To second
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_ceil, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5369, __pyx_L1_error)
      break;
    }

    /* "cytimes/utils.pxd":5353
 * 
 *     # To millisecond
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_s:

    /* "cytimes/utils.pxd":5374
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_SECOND)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5375
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_SECOND)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5375, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5376
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_SECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_SECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5376, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5377
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_SECOND)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_SECOND, US_SECOND)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/utils.pxd":5375
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_SECOND)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L13;
      }

      /* "cytimes/utils.pxd":5379
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_SECOND, US_SECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [s]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_SECOND;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_SECOND, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5379, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5380
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_SECOND, US_SECOND)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L13:;

      /* "cytimes/utils.pxd":5374
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_SECOND)
 */
      break;
      case NPY_FR_us:

      /* "cytimes/utils.pxd":5383
 *         # my_unit [us] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_SECOND)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [s]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_SECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5383, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5384
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_SECOND)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "cytimes/utils.pxd":5382
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, US_SECOND)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "cytimes/utils.pxd":5387
 *         # my_unit [ms] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_ceil_to_mul(arr, MS_SECOND)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [D...s] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_SECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5387, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5388
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_ceil_to_mul(arr, MS_SECOND)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...s] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "cytimes/utils.pxd":5386
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, MS_SECOND)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      default:

      /* "cytimes/utils.pxd":5392
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("ceil", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To minute
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_ceil, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5392, __pyx_L1_error)
      break;
    }

    /* "cytimes/utils.pxd":5372
 * 
 *     # To second
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_m:

    /* "cytimes/utils.pxd":5397
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MINUTE)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5398
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_MINUTE)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5398, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5399
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MINUTE)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5400
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MINUTE)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_MINUTE, US_MINUTE)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/utils.pxd":5398
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_MINUTE)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L14;
      }

      /* "cytimes/utils.pxd":5402
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_MINUTE, US_MINUTE)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [m]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_MINUTE;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MINUTE, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5402, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5403
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_MINUTE, US_MINUTE)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L14:;

      /* "cytimes/utils.pxd":5397
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MINUTE)
 */
      break;
      case NPY_FR_us:

      /* "cytimes/utils.pxd":5406
 *         # my_unit [us] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_MINUTE)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [m]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5406, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5407
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_MINUTE)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "cytimes/utils.pxd":5405
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, US_MINUTE)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "cytimes/utils.pxd":5410
 *         # my_unit [ms] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_ceil_to_mul(arr, MS_MINUTE)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [m]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5410, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5411
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_ceil_to_mul(arr, MS_MINUTE)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [s] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "cytimes/utils.pxd":5409
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, MS_MINUTE)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      case NPY_FR_s:

      /* "cytimes/utils.pxd":5414
 *         # my_unit [s] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_ceil_to_mul(arr, SS_MINUTE)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[s]"
 *         # my_unit [D...m] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5415
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_ceil_to_mul(arr, SS_MINUTE)
 *             to_dtype = "datetime64[s]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...m] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_s_2);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_s_2;

      /* "cytimes/utils.pxd":5413
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, SS_MINUTE)
 *             to_dtype = "datetime64[s]"
 */
      break;
      default:

      /* "cytimes/utils.pxd":5419
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("ceil", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To hour
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_ceil, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5419, __pyx_L1_error)
      break;
    }

    /* "cytimes/utils.pxd":5395
 * 
 *     # To minute
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_h:

    /* "cytimes/utils.pxd":5424
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_HOUR)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5425
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_HOUR)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5425, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5426
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_HOUR)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5426, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5427
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_HOUR)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_HOUR, US_HOUR)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/utils.pxd":5425
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_HOUR)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L15;
      }

      /* "cytimes/utils.pxd":5429
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_HOUR, US_HOUR)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [h]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_HOUR;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_HOUR, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5429, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5430
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_HOUR, US_HOUR)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L15:;

      /* "cytimes/utils.pxd":5424
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_HOUR)
 */
      break;
      case NPY_FR_us:

      /* "cytimes/utils.pxd":5433
 *         # my_unit [us] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_HOUR)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [h]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5434
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_HOUR)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "cytimes/utils.pxd":5432
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, US_HOUR)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "cytimes/utils.pxd":5437
 *         # my_unit [ms] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_ceil_to_mul(arr, MS_HOUR)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [h]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5438
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_ceil_to_mul(arr, MS_HOUR)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [s] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "cytimes/utils.pxd":5436
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, MS_HOUR)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      case NPY_FR_s:

      /* "cytimes/utils.pxd":5441
 *         # my_unit [s] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_ceil_to_mul(arr, SS_HOUR)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [h]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5441, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5442
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_ceil_to_mul(arr, SS_HOUR)
 *             to_dtype = "datetime64[s]"             # <<<<<<<<<<<<<<
 *         # my_unit [m] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_s_2);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_s_2;

      /* "cytimes/utils.pxd":5440
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, SS_HOUR)
 *             to_dtype = "datetime64[s]"
 */
      break;
      case NPY_FR_m:

      /* "cytimes/utils.pxd":5445
 *         # my_unit [m] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_ceil_to_mul(arr, 60)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[m]"
 *         # my_unit [D...h] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, 60, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5445, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5446
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_ceil_to_mul(arr, 60)
 *             to_dtype = "datetime64[m]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...h] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_m);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_m;

      /* "cytimes/utils.pxd":5444
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, 60)
 *             to_dtype = "datetime64[m]"
 */
      break;
      default:

      /* "cytimes/utils.pxd":5450
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("ceil", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To day
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_ceil, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5450, __pyx_L1_error)
      break;
    }

    /* "cytimes/utils.pxd":5422
 * 
 *     # To hour
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_D:

    /* "cytimes/utils.pxd":5455
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_DAY)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5456
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_DAY)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5456, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5457
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_DAY)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5457, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5458
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_DAY)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_DAY, US_DAY)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/utils.pxd":5456
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_DAY)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L16;
      }

      /* "cytimes/utils.pxd":5460
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_DAY, US_DAY)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [D]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_DAY;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5460, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5461
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_DAY, US_DAY)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L16:;

      /* "cytimes/utils.pxd":5455
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_DAY)
 */
      break;
      case NPY_FR_us:

      /* "cytimes/utils.pxd":5464
 *         # my_unit [us] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_DAY)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5465
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_DAY)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "cytimes/utils.pxd":5463
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, US_DAY)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "cytimes/utils.pxd":5468
 *         # my_unit [ms] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_ceil_to_mul(arr, MS_DAY)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5469
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_ceil_to_mul(arr, MS_DAY)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [s] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "cytimes/utils.pxd":5467
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, MS_DAY)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      case NPY_FR_s:

      /* "cytimes/utils.pxd":5472
 *         # my_unit [s] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_ceil_to_mul(arr, SS_DAY)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5472, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5473
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_ceil_to_mul(arr, SS_DAY)
 *             to_dtype = "datetime64[s]"             # <<<<<<<<<<<<<<
 *         # my_unit [m] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_s_2);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_s_2;

      /* "cytimes/utils.pxd":5471
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, SS_DAY)
 *             to_dtype = "datetime64[s]"
 */
      break;
      case NPY_FR_m:

      /* "cytimes/utils.pxd":5476
 *         # my_unit [m] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_ceil_to_mul(arr, 1440)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[m]"
 *         # my_unit [h] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, 0x5A0, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5477
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_ceil_to_mul(arr, 1440)
 *             to_dtype = "datetime64[m]"             # <<<<<<<<<<<<<<
 *         # my_unit [h] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_m);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_m;

      /* "cytimes/utils.pxd":5475
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, 1440)
 *             to_dtype = "datetime64[m]"
 */
      break;
      case NPY_FR_h:

      /* "cytimes/utils.pxd":5480
 *         # my_unit [h] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *             arr = arr_ceil_to_mul(arr, 24)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[h]"
 *         # my_unit [D] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, 24, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5480, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5481
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *             arr = arr_ceil_to_mul(arr, 24)
 *             to_dtype = "datetime64[h]"             # <<<<<<<<<<<<<<
 *         # my_unit [D] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_h);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_h;

      /* "cytimes/utils.pxd":5479
 *             to_dtype = "datetime64[m]"
 *         # my_unit [h] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, 24)
 *             to_dtype = "datetime64[h]"
 */
      break;
      default:

      /* "cytimes/utils.pxd":5485
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("ceil", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # Invalid unit
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_ceil, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5485, __pyx_L1_error)
      break;
    }

    /* "cytimes/utils.pxd":5453
 * 
 *     # To day
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    default:

    /* "cytimes/utils.pxd":5489
 *     # Invalid unit
 *     else:
 *         _raise_dt64arr_rcl_unsupport_unit_error("ceil", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # Convert to datetime64
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_ceil, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5489, __pyx_L1_error)
    break;
  }

  /* "cytimes/utils.pxd":5492
 * 
 *     # Convert to datetime64
 *     return arr.astype(to_dtype)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_floor(np.ndarray arr, str unit, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(!__pyx_v_to_dtype)) { __Pyx_RaiseUnboundLocalError("to_dtype"); __PYX_ERR(0, 5492, __pyx_L1_error) }
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_to_dtype};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5492, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":5305
 *     return arr.astype(to_dtype)
 * 
 * cdef inline np.ndarray dt64arr_ceil(np.ndarray arr, str unit, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Perform ceil operation on the np.ndarray[datetime64] to the
 *     specified unit `<'ndarray[datetime64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_to_dtype);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":5494
 *     return arr.astype(to_dtype)
 * 
 * cdef inline np.ndarray dt64arr_floor(np.ndarray arr, str unit, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Perform floor operation on the np.ndarray[datetime64] to the
 *     specified unit `<'ndarray[datetime64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_floor(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_unit, struct __pyx_opt_args_7cytimes_5utils_dt64arr_floor *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  int __pyx_v_my_unit;
  int __pyx_v_to_unit;
  int __pyx_v_dtype;
  PyObject *__pyx_v_to_dtype = NULL;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_to_mul __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_floor", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":5502
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5503
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5502
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "cytimes/utils.pxd":5507
 *     # Get time unit
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "cytimes/utils.pxd":5508
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5509
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":5510
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_n_u_int64); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5510, __pyx_L1_error)

      /* "cytimes/utils.pxd":5509
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "cytimes/utils.pxd":5511
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 5511, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":5508
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":5512
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5513
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:
 *         my_unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 5513, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":5512
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":5515
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     to_unit = map_nptime_unit_str2int(unit)
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 5515, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "cytimes/utils.pxd":5516
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)
 *     to_unit = map_nptime_unit_str2int(unit)             # <<<<<<<<<<<<<<
 * 
 *     # Fast-path
 */
  __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 5516, __pyx_L1_error)
  __pyx_v_to_unit = __pyx_t_2;

  /* "cytimes/utils.pxd":5521
 *     #: 1. same or my_unit is lower than to_unit (ms is lower than us)
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr
 */
  __pyx_t_3 = (__pyx_v_my_unit <= __pyx_v_to_unit);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_to_unit == NPY_FR_ns);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5522
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             return arr
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))
 */
    __pyx_t_1 = (__pyx_v_dtype == NPY_DATETIME);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":5523
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr             # <<<<<<<<<<<<<<
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))
 * 
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/utils.pxd":5522
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             return arr
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))
 */
    }

    /* "cytimes/utils.pxd":5524
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))             # <<<<<<<<<<<<<<
 * 
 *     # To microsecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_my_unit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5524, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5521
 *     #: 1. same or my_unit is lower than to_unit (ms is lower than us)
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr
 */
  }

  /* "cytimes/utils.pxd":5527
 * 
 *     # To microsecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  switch (__pyx_v_to_unit) {
    case NPY_FR_us:

    /* "cytimes/utils.pxd":5529
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MICROSECOND)
 */
    __pyx_t_1 = (__pyx_v_my_unit == NPY_FR_ns);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":5530
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5530, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5531
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MICROSECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5531, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5532
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_floor_div(arr, NS_MICROSECOND)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/utils.pxd":5530
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L11;
      }

      /* "cytimes/utils.pxd":5534
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_floor_div(arr, NS_MICROSECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [D...us] are lower units, which is covered
 */
      /*else*/ {
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5534, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5535
 *             else:
 *                 arr = arr_floor_div(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...us] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L11:;

      /* "cytimes/utils.pxd":5529
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MICROSECOND)
 */
      goto __pyx_L10;
    }

    /* "cytimes/utils.pxd":5539
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("floor", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To millisecond
 */
    /*else*/ {
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_floor, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5539, __pyx_L1_error)
    }
    __pyx_L10:;

    /* "cytimes/utils.pxd":5527
 * 
 *     # To microsecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_ms:

    /* "cytimes/utils.pxd":5544
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MILLISECOND)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5545
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_MILLISECOND)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5545, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5546
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MILLISECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MILLISECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5547
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MILLISECOND)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_MILLISECOND, US_MILLISECOND)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/utils.pxd":5545
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_MILLISECOND)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L12;
      }

      /* "cytimes/utils.pxd":5549
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_MILLISECOND, US_MILLISECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [ms]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_MILLISECOND;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MILLISECOND, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5549, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5550
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_MILLISECOND, US_MILLISECOND)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [ms]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L12:;

      /* "cytimes/utils.pxd":5544
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MILLISECOND)
 */
      break;
      case NPY_FR_us:

      /* "cytimes/utils.pxd":5553
 *         # my_unit [us] -> to_unit [ms]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_MILLISECOND)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [D...ms] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MILLISECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5553, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5554
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_MILLISECOND)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...ms] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "cytimes/utils.pxd":5552
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [ms]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, US_MILLISECOND)
 *             to_dtype = "datetime64[us]"
 */
      break;
      default:

      /* "cytimes/utils.pxd":5558
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("floor", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To second
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_floor, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5558, __pyx_L1_error)
      break;
    }

    /* "cytimes/utils.pxd":5542
 * 
 *     # To millisecond
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_s:

    /* "cytimes/utils.pxd":5563
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_SECOND)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5564
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_SECOND)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5564, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5565
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_SECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_SECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5565, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5566
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_SECOND)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_SECOND, US_SECOND)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/utils.pxd":5564
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_SECOND)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L13;
      }

      /* "cytimes/utils.pxd":5568
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_SECOND, US_SECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [s]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_SECOND;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_SECOND, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5568, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5569
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_SECOND, US_SECOND)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L13:;

      /* "cytimes/utils.pxd":5563
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_SECOND)
 */
      break;
      case NPY_FR_us:

      /* "cytimes/utils.pxd":5572
 *         # my_unit [us] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_SECOND)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [s]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_SECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5572, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5573
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_SECOND)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "cytimes/utils.pxd":5571
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, US_SECOND)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "cytimes/utils.pxd":5576
 *         # my_unit [ms] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_floor_to_mul(arr, MS_SECOND)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [D...s] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_SECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5577
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_floor_to_mul(arr, MS_SECOND)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...s] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "cytimes/utils.pxd":5575
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, MS_SECOND)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      default:

      /* "cytimes/utils.pxd":5581
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("floor", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To minute
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_floor, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5581, __pyx_L1_error)
      break;
    }

    /* "cytimes/utils.pxd":5561
 * 
 *     # To second
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_m:

    /* "cytimes/utils.pxd":5586
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MINUTE)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5587
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_MINUTE)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5587, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5588
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MINUTE)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5588, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5589
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MINUTE)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_MINUTE, US_MINUTE)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/utils.pxd":5587
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_MINUTE)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L14;
      }

      /* "cytimes/utils.pxd":5591
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_MINUTE, US_MINUTE)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [m]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_MINUTE;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MINUTE, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5591, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5592
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_MINUTE, US_MINUTE)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L14:;

      /* "cytimes/utils.pxd":5586
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MINUTE)
 */
      break;
      case NPY_FR_us:

      /* "cytimes/utils.pxd":5595
 *         # my_unit [us] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_MINUTE)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [m]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5595, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5596
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_MINUTE)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "cytimes/utils.pxd":5594
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, US_MINUTE)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "cytimes/utils.pxd":5599
 *         # my_unit [ms] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_floor_to_mul(arr, MS_MINUTE)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [m]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5599, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5600
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_floor_to_mul(arr, MS_MINUTE)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [s] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "cytimes/utils.pxd":5598
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, MS_MINUTE)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      case NPY_FR_s:

      /* "cytimes/utils.pxd":5603
 *         # my_unit [s] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_floor_to_mul(arr, SS_MINUTE)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[s]"
 *         # my_unit [D...m] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5603, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5604
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_floor_to_mul(arr, SS_MINUTE)
 *             to_dtype = "datetime64[s]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...m] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_s_2);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_s_2;

      /* "cytimes/utils.pxd":5602
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, SS_MINUTE)
 *             to_dtype = "datetime64[s]"
 */
      break;
      default:

      /* "cytimes/utils.pxd":5608
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("floor", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To hour
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_floor, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5608, __pyx_L1_error)
      break;
    }

    /* "cytimes/utils.pxd":5584
 * 
 *     # To minute
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_h:

    /* "cytimes/utils.pxd":5613
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_HOUR)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5614
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_HOUR)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5614, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5615
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_HOUR)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5615, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5616
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_HOUR)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_HOUR, US_HOUR)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/utils.pxd":5614
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_HOUR)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L15;
      }

      /* "cytimes/utils.pxd":5618
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_HOUR, US_HOUR)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [h]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_HOUR;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_HOUR, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5618, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5619
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_HOUR, US_HOUR)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L15:;

      /* "cytimes/utils.pxd":5613
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_HOUR)
 */
      break;
      case NPY_FR_us:

      /* "cytimes/utils.pxd":5622
 *         # my_unit [us] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_HOUR)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [h]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5623
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_HOUR)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "cytimes/utils.pxd":5621
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, US_HOUR)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "cytimes/utils.pxd":5626
 *         # my_unit [ms] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_floor_to_mul(arr, MS_HOUR)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [h]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5626, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5627
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_floor_to_mul(arr, MS_HOUR)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [s] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "cytimes/utils.pxd":5625
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, MS_HOUR)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      case NPY_FR_s:

      /* "cytimes/utils.pxd":5630
 *         # my_unit [s] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_floor_to_mul(arr, SS_HOUR)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [h]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5630, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5631
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_floor_to_mul(arr, SS_HOUR)
 *             to_dtype = "datetime64[s]"             # <<<<<<<<<<<<<<
 *         # my_unit [m] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_s_2);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_s_2;

      /* "cytimes/utils.pxd":5629
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, SS_HOUR)
 *             to_dtype = "datetime64[s]"
 */
      break;
      case NPY_FR_m:

      /* "cytimes/utils.pxd":5634
 *         # my_unit [m] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_floor_to_mul(arr, 60)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[m]"
 *         # my_unit [D...h] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, 60, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5634, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5635
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_floor_to_mul(arr, 60)
 *             to_dtype = "datetime64[m]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...h] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_m);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_m;

      /* "cytimes/utils.pxd":5633
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, 60)
 *             to_dtype = "datetime64[m]"
 */
      break;
      default:

      /* "cytimes/utils.pxd":5639
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("floor", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To day
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_floor, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5639, __pyx_L1_error)
      break;
    }

    /* "cytimes/utils.pxd":5611
 * 
 *     # To hour
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_D:

    /* "cytimes/utils.pxd":5644
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_DAY)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "cytimes/utils.pxd":5645
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_DAY)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5645, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5646
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_DAY)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5646, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5647
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_DAY)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_DAY, US_DAY)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/utils.pxd":5645
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_DAY)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L16;
      }

      /* "cytimes/utils.pxd":5649
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_DAY, US_DAY)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [D]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_DAY;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5649, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "cytimes/utils.pxd":5650
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_DAY, US_DAY)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L16:;

      /* "cytimes/utils.pxd":5644
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_DAY)
 */
      break;
      case NPY_FR_us:

      /* "cytimes/utils.pxd":5653
 *         # my_unit [us] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_DAY)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5653, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5654
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_DAY)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "cytimes/utils.pxd":5652
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, US_DAY)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "cytimes/utils.pxd":5657
 *         # my_unit [ms] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_floor_to_mul(arr, MS_DAY)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5657, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5658
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_floor_to_mul(arr, MS_DAY)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [s] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "cytimes/utils.pxd":5656
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, MS_DAY)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      case NPY_FR_s:

      /* "cytimes/utils.pxd":5661
 *         # my_unit [s] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_floor_to_mul(arr, SS_DAY)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5661, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5662
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_floor_to_mul(arr, SS_DAY)
 *             to_dtype = "datetime64[s]"             # <<<<<<<<<<<<<<
 *         # my_unit [m] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_s_2);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_s_2;

      /* "cytimes/utils.pxd":5660
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, SS_DAY)
 *             to_dtype = "datetime64[s]"
 */
      break;
      case NPY_FR_m:

      /* "cytimes/utils.pxd":5665
 *         # my_unit [m] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_floor_to_mul(arr, 1440)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[m]"
 *         # my_unit [h] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, 0x5A0, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5665, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5666
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_floor_to_mul(arr, 1440)
 *             to_dtype = "datetime64[m]"             # <<<<<<<<<<<<<<
 *         # my_unit [h] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_m);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_m;

      /* "cytimes/utils.pxd":5664
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, 1440)
 *             to_dtype = "datetime64[m]"
 */
      break;
      case NPY_FR_h:

      /* "cytimes/utils.pxd":5669
 *         # my_unit [h] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *             arr = arr_floor_to_mul(arr, 24)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[h]"
 *         # my_unit [D] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, 24, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5669, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.pxd":5670
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *             arr = arr_floor_to_mul(arr, 24)
 *             to_dtype = "datetime64[h]"             # <<<<<<<<<<<<<<
 *         # my_unit [D] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_h);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_h;

      /* "cytimes/utils.pxd":5668
 *             to_dtype = "datetime64[m]"
 *         # my_unit [h] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, 24)
 *             to_dtype = "datetime64[h]"
 */
      break;
      default:

      /* "cytimes/utils.pxd":5674
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("floor", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # Invalid unit
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_floor, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5674, __pyx_L1_error)
      break;
    }

    /* "cytimes/utils.pxd":5642
 * 
 *     # To day
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    default:

    /* "cytimes/utils.pxd":5678
 *     # Invalid unit
 *     else:
 *         _raise_dt64arr_rcl_unsupport_unit_error("floor", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # Convert to datetime64
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_floor, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5678, __pyx_L1_error)
    break;
  }

  /* "cytimes/utils.pxd":5681
 * 
 *     # Convert to datetime64
 *     return arr.astype(to_dtype)             # <<<<<<<<<<<<<<
 * 
 * # . comparison
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(!__pyx_v_to_dtype)) { __Pyx_RaiseUnboundLocalError("to_dtype"); __PYX_ERR(0, 5681, __pyx_L1_error) }
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_to_dtype};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5681, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":5494
 *     return arr.astype(to_dtype)
 * 
 * cdef inline np.ndarray dt64arr_floor(np.ndarray arr, str unit, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Perform floor operation on the np.ndarray[datetime64] to the
 *     specified unit `<'ndarray[datetime64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_to_dtype);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":5684
 * 
 * # . comparison
 * cdef inline np.ndarray dt64arr_find_closest(np.ndarray arr1, np.ndarray arr2):             # <<<<<<<<<<<<<<
 *     """For each element in 'arr1', find the closest values in 'arr2' `<'ndarray[int64]'>`."""
 *     # Validate
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_find_closest(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2) {
  npy_int64 __pyx_v_arr1_size;
  npy_int64 __pyx_v_arr2_size;
  PyArrayObject *__pyx_v_arrS = 0;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr1_ptr;
  npy_int64 *__pyx_v_arrS_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_targ;
  npy_int64 __pyx_v_left;
  npy_int64 __pyx_v_right;
  npy_int64 __pyx_v_mid;
  npy_int64 __pyx_v_cur_num;
  npy_int64 __pyx_v_cls_num;
  npy_int64 __pyx_v_min_diff;
  npy_int64 __pyx_v_cur_diff;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  npy_intp __pyx_t_5[1];
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  npy_int64 __pyx_t_9;
  npy_int64 __pyx_t_10;
  npy_int64 __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_find_closest", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr1);
  __Pyx_INCREF((PyObject *)__pyx_v_arr2);

  /* "cytimes/utils.pxd":5687
 *     """For each element in 'arr1', find the closest values in 'arr2' `<'ndarray[int64]'>`."""
 *     # Validate
 *     cdef np.npy_int64 arr1_size = arr1.shape[0]             # <<<<<<<<<<<<<<
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]
 *     if arr1_size <= 0 or arr2_size <= 0:
 */
  __pyx_v_arr1_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr1)[0]);

  /* "cytimes/utils.pxd":5688
 *     # Validate
 *     cdef np.npy_int64 arr1_size = arr1.shape[0]
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]             # <<<<<<<<<<<<<<
 *     if arr1_size <= 0 or arr2_size <= 0:
 *         raise ValueError("For comparision, array size must be > 0.")
 */
  __pyx_v_arr2_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr2)[0]);

  /* "cytimes/utils.pxd":5689
 *     cdef np.npy_int64 arr1_size = arr1.shape[0]
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]
 *     if arr1_size <= 0 or arr2_size <= 0:             # <<<<<<<<<<<<<<
 *         raise ValueError("For comparision, array size must be > 0.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  __pyx_t_2 = (__pyx_v_arr1_size <= 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_arr2_size <= 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":5690
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]
 *     if arr1_size <= 0 or arr2_size <= 0:
 *         raise ValueError("For comparision, array size must be > 0.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 5690, __pyx_L1_error)

    /* "cytimes/utils.pxd":5689
 *     cdef np.npy_int64 arr1_size = arr1.shape[0]
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]
 *     if arr1_size <= 0 or arr2_size <= 0:             # <<<<<<<<<<<<<<
 *         raise ValueError("For comparision, array size must be > 0.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  }

  /* "cytimes/utils.pxd":5691
 *     if arr1_size <= 0 or arr2_size <= 0:
 *         raise ValueError("For comparision, array size must be > 0.")
 *     arr1 = arr_assure_int64_like(arr1)             # <<<<<<<<<<<<<<
 *     arr2 = arr_assure_int64_like(arr2)
 * 
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr1, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":5692
 *         raise ValueError("For comparision, array size must be > 0.")
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)             # <<<<<<<<<<<<<<
 * 
 *     # Sort arr2
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr2, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":5695
 * 
 *     # Sort arr2
 *     cdef np.ndarray arrS = np.PyArray_Copy(arr2)             # <<<<<<<<<<<<<<
 *     np.PyArray_Sort(arrS, 0, np.NPY_SORTKIND.NPY_QUICKSORT)
 * 
 */
  __pyx_t_3 = PyArray_Copy(__pyx_v_arr2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5695, __pyx_L1_error)
  __pyx_v_arrS = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":5696
 *     # Sort arr2
 *     cdef np.ndarray arrS = np.PyArray_Copy(arr2)
 *     np.PyArray_Sort(arrS, 0, np.NPY_SORTKIND.NPY_QUICKSORT)             # <<<<<<<<<<<<<<
 * 
 *     # Prepare result and pointers
 */
  __pyx_t_4 = PyArray_Sort(__pyx_v_arrS, 0, NPY_QUICKSORT); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 5696, __pyx_L1_error)

  /* "cytimes/utils.pxd":5700
 *     # Prepare result and pointers
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [arr1_size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 */
  __pyx_t_5[0] = __pyx_v_arr1_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_5, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5700, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":5701
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [arr1_size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arrS_ptr = <np.npy_int64*> np.PyArray_DATA(arrS)
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":5702
 *         np.ndarray res = np.PyArray_EMPTY(1, [arr1_size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arrS_ptr = <np.npy_int64*> np.PyArray_DATA(arrS)
 *         np.npy_int64 i, targ, left, right, mid
 */
  __pyx_v_arr1_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr1));

  /* "cytimes/utils.pxd":5703
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arrS_ptr = <np.npy_int64*> np.PyArray_DATA(arrS)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, targ, left, right, mid
 *         np.npy_int64 cur_num, cls_num, min_diff, cur_diff
 */
  __pyx_v_arrS_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arrS));

  /* "cytimes/utils.pxd":5708
 * 
 *     # Find closest for elements in 'arr1'
 *     for i in range(arr1_size):             # <<<<<<<<<<<<<<
 *         targ, left, right = arr1_ptr[i], 0, arr2_size - 1
 *         cls_num = arrS_ptr[left]
 */
  __pyx_t_6 = __pyx_v_arr1_size;
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "cytimes/utils.pxd":5709
 *     # Find closest for elements in 'arr1'
 *     for i in range(arr1_size):
 *         targ, left, right = arr1_ptr[i], 0, arr2_size - 1             # <<<<<<<<<<<<<<
 *         cls_num = arrS_ptr[left]
 *         min_diff = targ - cls_num if cls_num < targ else cls_num - targ
 */
    __pyx_t_9 = (__pyx_v_arr1_ptr[__pyx_v_i]);
    __pyx_t_10 = 0;
    __pyx_t_11 = (__pyx_v_arr2_size - 1);
    __pyx_v_targ = __pyx_t_9;
    __pyx_v_left = __pyx_t_10;
    __pyx_v_right = __pyx_t_11;

    /* "cytimes/utils.pxd":5710
 *     for i in range(arr1_size):
 *         targ, left, right = arr1_ptr[i], 0, arr2_size - 1
 *         cls_num = arrS_ptr[left]             # <<<<<<<<<<<<<<
 *         min_diff = targ - cls_num if cls_num < targ else cls_num - targ
 *         # Binary search
 */
    __pyx_v_cls_num = (__pyx_v_arrS_ptr[__pyx_v_left]);

    /* "cytimes/utils.pxd":5711
 *         targ, left, right = arr1_ptr[i], 0, arr2_size - 1
 *         cls_num = arrS_ptr[left]
 *         min_diff = targ - cls_num if cls_num < targ else cls_num - targ             # <<<<<<<<<<<<<<
 *         # Binary search
 *         while left <= right:
 */
    __pyx_t_1 = (__pyx_v_cls_num < __pyx_v_targ);
    if (__pyx_t_1) {
      __pyx_t_11 = (__pyx_v_targ - __pyx_v_cls_num);
    } else {
      __pyx_t_11 = (__pyx_v_cls_num - __pyx_v_targ);
    }
    __pyx_v_min_diff = __pyx_t_11;

    /* "cytimes/utils.pxd":5713
 *         min_diff = targ - cls_num if cls_num < targ else cls_num - targ
 *         # Binary search
 *         while left <= right:             # <<<<<<<<<<<<<<
 *             mid = (left + right) // 2
 *             cur_num = arrS_ptr[mid]
 */
    while (1) {
      __pyx_t_1 = (__pyx_v_left <= __pyx_v_right);
      if (!__pyx_t_1) break;

      /* "cytimes/utils.pxd":5714
 *         # Binary search
 *         while left <= right:
 *             mid = (left + right) // 2             # <<<<<<<<<<<<<<
 *             cur_num = arrS_ptr[mid]
 *             cur_diff = targ - cur_num if cur_num < targ else cur_num - targ
 */
      __pyx_v_mid = __Pyx_div_npy_int64((__pyx_v_left + __pyx_v_right), 2);

      /* "cytimes/utils.pxd":5715
 *         while left <= right:
 *             mid = (left + right) // 2
 *             cur_num = arrS_ptr[mid]             # <<<<<<<<<<<<<<
 *             cur_diff = targ - cur_num if cur_num < targ else cur_num - targ
 * 
 */
      __pyx_v_cur_num = (__pyx_v_arrS_ptr[__pyx_v_mid]);

      /* "cytimes/utils.pxd":5716
 *             mid = (left + right) // 2
 *             cur_num = arrS_ptr[mid]
 *             cur_diff = targ - cur_num if cur_num < targ else cur_num - targ             # <<<<<<<<<<<<<<
 * 
 *             # Update closest number
 */
      __pyx_t_1 = (__pyx_v_cur_num < __pyx_v_targ);
      if (__pyx_t_1) {
        __pyx_t_11 = (__pyx_v_targ - __pyx_v_cur_num);
      } else {
        __pyx_t_11 = (__pyx_v_cur_num - __pyx_v_targ);
      }
      __pyx_v_cur_diff = __pyx_t_11;

      /* "cytimes/utils.pxd":5719
 * 
 *             # Update closest number
 *             if cur_diff < min_diff:             # <<<<<<<<<<<<<<
 *                 cls_num, min_diff = cur_num, cur_diff
 *             elif cur_diff == min_diff:
 */
      __pyx_t_1 = (__pyx_v_cur_diff < __pyx_v_min_diff);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5720
 *             # Update closest number
 *             if cur_diff < min_diff:
 *                 cls_num, min_diff = cur_num, cur_diff             # <<<<<<<<<<<<<<
 *             elif cur_diff == min_diff:
 *                 # Choose the smaller number in case of a tie
 */
        __pyx_t_11 = __pyx_v_cur_num;
        __pyx_t_10 = __pyx_v_cur_diff;
        __pyx_v_cls_num = __pyx_t_11;
        __pyx_v_min_diff = __pyx_t_10;

        /* "cytimes/utils.pxd":5719
 * 
 *             # Update closest number
 *             if cur_diff < min_diff:             # <<<<<<<<<<<<<<
 *                 cls_num, min_diff = cur_num, cur_diff
 *             elif cur_diff == min_diff:
 */
        goto __pyx_L10;
      }

      /* "cytimes/utils.pxd":5721
 *             if cur_diff < min_diff:
 *                 cls_num, min_diff = cur_num, cur_diff
 *             elif cur_diff == min_diff:             # <<<<<<<<<<<<<<
 *                 # Choose the smaller number in case of a tie
 *                 if cur_num < cls_num:
 */
      __pyx_t_1 = (__pyx_v_cur_diff == __pyx_v_min_diff);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5723
 *             elif cur_diff == min_diff:
 *                 # Choose the smaller number in case of a tie
 *                 if cur_num < cls_num:             # <<<<<<<<<<<<<<
 *                     cls_num = cur_num
 * 
 */
        __pyx_t_1 = (__pyx_v_cur_num < __pyx_v_cls_num);
        if (__pyx_t_1) {

          /* "cytimes/utils.pxd":5724
 *                 # Choose the smaller number in case of a tie
 *                 if cur_num < cls_num:
 *                     cls_num = cur_num             # <<<<<<<<<<<<<<
 * 
 *             if cur_num < targ:
 */
          __pyx_v_cls_num = __pyx_v_cur_num;

          /* "cytimes/utils.pxd":5723
 *             elif cur_diff == min_diff:
 *                 # Choose the smaller number in case of a tie
 *                 if cur_num < cls_num:             # <<<<<<<<<<<<<<
 *                     cls_num = cur_num
 * 
 */
        }

        /* "cytimes/utils.pxd":5721
 *             if cur_diff < min_diff:
 *                 cls_num, min_diff = cur_num, cur_diff
 *             elif cur_diff == min_diff:             # <<<<<<<<<<<<<<
 *                 # Choose the smaller number in case of a tie
 *                 if cur_num < cls_num:
 */
      }
      __pyx_L10:;

      /* "cytimes/utils.pxd":5726
 *                     cls_num = cur_num
 * 
 *             if cur_num < targ:             # <<<<<<<<<<<<<<
 *                 left = mid + 1
 *             elif cur_num > targ:
 */
      __pyx_t_1 = (__pyx_v_cur_num < __pyx_v_targ);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5727
 * 
 *             if cur_num < targ:
 *                 left = mid + 1             # <<<<<<<<<<<<<<
 *             elif cur_num > targ:
 *                 right = mid - 1
 */
        __pyx_v_left = (__pyx_v_mid + 1);

        /* "cytimes/utils.pxd":5726
 *                     cls_num = cur_num
 * 
 *             if cur_num < targ:             # <<<<<<<<<<<<<<
 *                 left = mid + 1
 *             elif cur_num > targ:
 */
        goto __pyx_L12;
      }

      /* "cytimes/utils.pxd":5728
 *             if cur_num < targ:
 *                 left = mid + 1
 *             elif cur_num > targ:             # <<<<<<<<<<<<<<
 *                 right = mid - 1
 *             else:
 */
      __pyx_t_1 = (__pyx_v_cur_num > __pyx_v_targ);
      if (__pyx_t_1) {

        /* "cytimes/utils.pxd":5729
 *                 left = mid + 1
 *             elif cur_num > targ:
 *                 right = mid - 1             # <<<<<<<<<<<<<<
 *             else:
 *                 # Exact match found
 */
        __pyx_v_right = (__pyx_v_mid - 1);

        /* "cytimes/utils.pxd":5728
 *             if cur_num < targ:
 *                 left = mid + 1
 *             elif cur_num > targ:             # <<<<<<<<<<<<<<
 *                 right = mid - 1
 *             else:
 */
        goto __pyx_L12;
      }

      /* "cytimes/utils.pxd":5732
 *             else:
 *                 # Exact match found
 *                 cls_num = cur_num             # <<<<<<<<<<<<<<
 *                 break  # exit loop
 * 
 */
      /*else*/ {
        __pyx_v_cls_num = __pyx_v_cur_num;

        /* "cytimes/utils.pxd":5733
 *                 # Exact match found
 *                 cls_num = cur_num
 *                 break  # exit loop             # <<<<<<<<<<<<<<
 * 
 *         res_ptr[i] = cls_num
 */
        goto __pyx_L9_break;
      }
      __pyx_L12:;
    }
    __pyx_L9_break:;

    /* "cytimes/utils.pxd":5735
 *                 break  # exit loop
 * 
 *         res_ptr[i] = cls_num             # <<<<<<<<<<<<<<
 * 
 *     # Return result
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_v_cls_num;
  }

  /* "cytimes/utils.pxd":5738
 * 
 *     # Return result
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_find_farthest(np.ndarray arr1, np.ndarray arr2):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":5684
 * 
 * # . comparison
 * cdef inline np.ndarray dt64arr_find_closest(np.ndarray arr1, np.ndarray arr2):             # <<<<<<<<<<<<<<
 *     """For each element in 'arr1', find the closest values in 'arr2' `<'ndarray[int64]'>`."""
 *     # Validate
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_find_closest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arrS);
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr1);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr2);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":5740
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_find_farthest(np.ndarray arr1, np.ndarray arr2):             # <<<<<<<<<<<<<<
 *     """For each element in 'arr1', find the farthest values in 'arr2' `<'ndarray[int64]'>`."""
 *     # Validate
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_find_farthest(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2) {
  npy_int64 __pyx_v_arr1_size;
  npy_int64 __pyx_v_arr2_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr1_ptr;
  npy_int64 *__pyx_v_arr2_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_num;
  npy_int64 __pyx_v_min_num;
  npy_int64 __pyx_v_max_num;
  npy_int64 __pyx_v_tie_num;
  npy_int64 __pyx_v_targ;
  npy_int64 __pyx_v_far_num;
  npy_int64 __pyx_v_diff_min;
  npy_int64 __pyx_v_diff_max;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_find_farthest", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr1);
  __Pyx_INCREF((PyObject *)__pyx_v_arr2);

  /* "cytimes/utils.pxd":5743
 *     """For each element in 'arr1', find the farthest values in 'arr2' `<'ndarray[int64]'>`."""
 *     # Validate
 *     cdef np.npy_int64 arr1_size = arr1.shape[0]             # <<<<<<<<<<<<<<
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]
 *     if arr1_size <= 0 or arr2_size <= 0:
 */
  __pyx_v_arr1_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr1)[0]);

  /* "cytimes/utils.pxd":5744
 *     # Validate
 *     cdef np.npy_int64 arr1_size = arr1.shape[0]
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]             # <<<<<<<<<<<<<<
 *     if arr1_size <= 0 or arr2_size <= 0:
 *         raise ValueError("For comparision, array size must be > 0.")
 */
  __pyx_v_arr2_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr2)[0]);

  /* "cytimes/utils.pxd":5745
 *     cdef np.npy_int64 arr1_size = arr1.shape[0]
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]
 *     if arr1_size <= 0 or arr2_size <= 0:             # <<<<<<<<<<<<<<
 *         raise ValueError("For comparision, array size must be > 0.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  __pyx_t_2 = (__pyx_v_arr1_size <= 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_arr2_size <= 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/utils.pxd":5746
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]
 *     if arr1_size <= 0 or arr2_size <= 0:
 *         raise ValueError("For comparision, array size must be > 0.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 5746, __pyx_L1_error)

    /* "cytimes/utils.pxd":5745
 *     cdef np.npy_int64 arr1_size = arr1.shape[0]
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]
 *     if arr1_size <= 0 or arr2_size <= 0:             # <<<<<<<<<<<<<<
 *         raise ValueError("For comparision, array size must be > 0.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  }

  /* "cytimes/utils.pxd":5747
 *     if arr1_size <= 0 or arr2_size <= 0:
 *         raise ValueError("For comparision, array size must be > 0.")
 *     arr1 = arr_assure_int64_like(arr1)             # <<<<<<<<<<<<<<
 *     arr2 = arr_assure_int64_like(arr2)
 * 
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr1, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":5748
 *         raise ValueError("For comparision, array size must be > 0.")
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)             # <<<<<<<<<<<<<<
 * 
 *     # Prepare result and pointers
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr2, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":5752
 *     # Prepare result and pointers
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [arr1_size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 */
  __pyx_t_4[0] = __pyx_v_arr1_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 5752, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/utils.pxd":5753
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [arr1_size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "cytimes/utils.pxd":5754
 *         np.ndarray res = np.PyArray_EMPTY(1, [arr1_size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 *         np.npy_int64 i, num, min_num, max_num, tie_num
 */
  __pyx_v_arr1_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr1));

  /* "cytimes/utils.pxd":5755
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, num, min_num, max_num, tie_num
 *         np.npy_int64 targ, far_num, diff_min, diff_max
 */
  __pyx_v_arr2_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr2));

  /* "cytimes/utils.pxd":5760
 * 
 *     # Find the min & max values in 'arr2'
 *     min_num = arr2_ptr[0]             # <<<<<<<<<<<<<<
 *     max_num = min_num
 *     for i in range(1, arr2_size):
 */
  __pyx_v_min_num = (__pyx_v_arr2_ptr[0]);

  /* "cytimes/utils.pxd":5761
 *     # Find the min & max values in 'arr2'
 *     min_num = arr2_ptr[0]
 *     max_num = min_num             # <<<<<<<<<<<<<<
 *     for i in range(1, arr2_size):
 *         num = arr2_ptr[i]
 */
  __pyx_v_max_num = __pyx_v_min_num;

  /* "cytimes/utils.pxd":5762
 *     min_num = arr2_ptr[0]
 *     max_num = min_num
 *     for i in range(1, arr2_size):             # <<<<<<<<<<<<<<
 *         num = arr2_ptr[i]
 *         if num < min_num:
 */
  __pyx_t_5 = __pyx_v_arr2_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "cytimes/utils.pxd":5763
 *     max_num = min_num
 *     for i in range(1, arr2_size):
 *         num = arr2_ptr[i]             # <<<<<<<<<<<<<<
 *         if num < min_num:
 *             min_num = num
 */
    __pyx_v_num = (__pyx_v_arr2_ptr[__pyx_v_i]);

    /* "cytimes/utils.pxd":5764
 *     for i in range(1, arr2_size):
 *         num = arr2_ptr[i]
 *         if num < min_num:             # <<<<<<<<<<<<<<
 *             min_num = num
 *         elif num > max_num:
 */
    __pyx_t_1 = (__pyx_v_num < __pyx_v_min_num);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":5765
 *         num = arr2_ptr[i]
 *         if num < min_num:
 *             min_num = num             # <<<<<<<<<<<<<<
 *         elif num > max_num:
 *             max_num = num
 */
      __pyx_v_min_num = __pyx_v_num;

      /* "cytimes/utils.pxd":5764
 *     for i in range(1, arr2_size):
 *         num = arr2_ptr[i]
 *         if num < min_num:             # <<<<<<<<<<<<<<
 *             min_num = num
 *         elif num > max_num:
 */
      goto __pyx_L8;
    }

    /* "cytimes/utils.pxd":5766
 *         if num < min_num:
 *             min_num = num
 *         elif num > max_num:             # <<<<<<<<<<<<<<
 *             max_num = num
 *     tie_num = min(min_num, max_num)
 */
    __pyx_t_1 = (__pyx_v_num > __pyx_v_max_num);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":5767
 *             min_num = num
 *         elif num > max_num:
 *             max_num = num             # <<<<<<<<<<<<<<
 *     tie_num = min(min_num, max_num)
 * 
 */
      __pyx_v_max_num = __pyx_v_num;

      /* "cytimes/utils.pxd":5766
 *         if num < min_num:
 *             min_num = num
 *         elif num > max_num:             # <<<<<<<<<<<<<<
 *             max_num = num
 *     tie_num = min(min_num, max_num)
 */
    }
    __pyx_L8:;
  }

  /* "cytimes/utils.pxd":5768
 *         elif num > max_num:
 *             max_num = num
 *     tie_num = min(min_num, max_num)             # <<<<<<<<<<<<<<
 * 
 *     # Find the furthest for elements in 'arr1'
 */
  __pyx_t_5 = __pyx_v_max_num;
  __pyx_t_6 = __pyx_v_min_num;
  __pyx_t_1 = (__pyx_t_5 < __pyx_t_6);
  if (__pyx_t_1) {
    __pyx_t_7 = __pyx_t_5;
  } else {
    __pyx_t_7 = __pyx_t_6;
  }
  __pyx_v_tie_num = __pyx_t_7;

  /* "cytimes/utils.pxd":5771
 * 
 *     # Find the furthest for elements in 'arr1'
 *     for i in range(arr1_size):             # <<<<<<<<<<<<<<
 *         targ = arr1_ptr[i]
 *         diff_min = targ - min_num if min_num < targ else min_num - targ
 */
  __pyx_t_7 = __pyx_v_arr1_size;
  __pyx_t_5 = __pyx_t_7;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "cytimes/utils.pxd":5772
 *     # Find the furthest for elements in 'arr1'
 *     for i in range(arr1_size):
 *         targ = arr1_ptr[i]             # <<<<<<<<<<<<<<
 *         diff_min = targ - min_num if min_num < targ else min_num - targ
 *         diff_max = targ - max_num if max_num < targ else max_num - targ
 */
    __pyx_v_targ = (__pyx_v_arr1_ptr[__pyx_v_i]);

    /* "cytimes/utils.pxd":5773
 *     for i in range(arr1_size):
 *         targ = arr1_ptr[i]
 *         diff_min = targ - min_num if min_num < targ else min_num - targ             # <<<<<<<<<<<<<<
 *         diff_max = targ - max_num if max_num < targ else max_num - targ
 * 
 */
    __pyx_t_1 = (__pyx_v_min_num < __pyx_v_targ);
    if (__pyx_t_1) {
      __pyx_t_8 = (__pyx_v_targ - __pyx_v_min_num);
    } else {
      __pyx_t_8 = (__pyx_v_min_num - __pyx_v_targ);
    }
    __pyx_v_diff_min = __pyx_t_8;

    /* "cytimes/utils.pxd":5774
 *         targ = arr1_ptr[i]
 *         diff_min = targ - min_num if min_num < targ else min_num - targ
 *         diff_max = targ - max_num if max_num < targ else max_num - targ             # <<<<<<<<<<<<<<
 * 
 *         if diff_min > diff_max:
 */
    __pyx_t_1 = (__pyx_v_max_num < __pyx_v_targ);
    if (__pyx_t_1) {
      __pyx_t_8 = (__pyx_v_targ - __pyx_v_max_num);
    } else {
      __pyx_t_8 = (__pyx_v_max_num - __pyx_v_targ);
    }
    __pyx_v_diff_max = __pyx_t_8;

    /* "cytimes/utils.pxd":5776
 *         diff_max = targ - max_num if max_num < targ else max_num - targ
 * 
 *         if diff_min > diff_max:             # <<<<<<<<<<<<<<
 *             far_num = min_num
 *         elif diff_min < diff_max:
 */
    __pyx_t_1 = (__pyx_v_diff_min > __pyx_v_diff_max);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":5777
 * 
 *         if diff_min > diff_max:
 *             far_num = min_num             # <<<<<<<<<<<<<<
 *         elif diff_min < diff_max:
 *             far_num = max_num
 */
      __pyx_v_far_num = __pyx_v_min_num;

      /* "cytimes/utils.pxd":5776
 *         diff_max = targ - max_num if max_num < targ else max_num - targ
 * 
 *         if diff_min > diff_max:             # <<<<<<<<<<<<<<
 *             far_num = min_num
 *         elif diff_min < diff_max:
 */
      goto __pyx_L11;
    }

    /* "cytimes/utils.pxd":5778
 *         if diff_min > diff_max:
 *             far_num = min_num
 *         elif diff_min < diff_max:             # <<<<<<<<<<<<<<
 *             far_num = max_num
 *         else:
 */
    __pyx_t_1 = (__pyx_v_diff_min < __pyx_v_diff_max);
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":5779
 *             far_num = min_num
 *         elif diff_min < diff_max:
 *             far_num = max_num             # <<<<<<<<<<<<<<
 *         else:
 *             far_num = tie_num
 */
      __pyx_v_far_num = __pyx_v_max_num;

      /* "cytimes/utils.pxd":5778
 *         if diff_min > diff_max:
 *             far_num = min_num
 *         elif diff_min < diff_max:             # <<<<<<<<<<<<<<
 *             far_num = max_num
 *         else:
 */
      goto __pyx_L11;
    }

    /* "cytimes/utils.pxd":5781
 *             far_num = max_num
 *         else:
 *             far_num = tie_num             # <<<<<<<<<<<<<<
 * 
 *         res_ptr[i] = far_num
 */
    /*else*/ {
      __pyx_v_far_num = __pyx_v_tie_num;
    }
    __pyx_L11:;

    /* "cytimes/utils.pxd":5783
 *             far_num = tie_num
 * 
 *         res_ptr[i] = far_num             # <<<<<<<<<<<<<<
 * 
 *     # Return result
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_v_far_num;
  }

  /* "cytimes/utils.pxd":5786
 * 
 *     # Return result
 *     return res             # <<<<<<<<<<<<<<
 * 
 * # . errors: internal
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":5740
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_find_farthest(np.ndarray arr1, np.ndarray arr2):             # <<<<<<<<<<<<<<
 *     """For each element in 'arr1', find the farthest values in 'arr2' `<'ndarray[int64]'>`."""
 *     # Validate
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_find_farthest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr1);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr2);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":5789
 * 
 * # . errors: internal
 * cdef inline bint _raise_dt64arr_as_int64_unit_error(str reso, int unit, bint is_dt64=True) except -1:             # <<<<<<<<<<<<<<
 *     """(internal) Raise unsupported unit for 'dt64arr_as_int64*()' functions."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(PyObject *__pyx_v_reso, int __pyx_v_unit, struct __pyx_opt_args_7cytimes_5utils__raise_dt64arr_as_int64_unit_error *__pyx_optional_args) {
  int __pyx_v_is_dt64 = ((int)1);
  PyObject *__pyx_v_obj_type = NULL;
  PyObject *__pyx_v_unit_str = NULL;
  PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_raise_dt64arr_as_int64_unit_error", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_is_dt64 = __pyx_optional_args->is_dt64;
    }
  }

  /* "cytimes/utils.pxd":5791
 * cdef inline bint _raise_dt64arr_as_int64_unit_error(str reso, int unit, bint is_dt64=True) except -1:
 *     """(internal) Raise unsupported unit for 'dt64arr_as_int64*()' functions."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"             # <<<<<<<<<<<<<<
 *     try:
 *         unit_str = map_nptime_unit_int2str(unit)
 */
  if (__pyx_v_is_dt64) {
    __Pyx_INCREF(__pyx_n_u_datetime64);
    __pyx_t_1 = __pyx_n_u_datetime64;
  } else {
    __Pyx_INCREF(__pyx_n_u_timedelta64);
    __pyx_t_1 = __pyx_n_u_timedelta64;
  }
  __pyx_v_obj_type = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":5792
 *     """(internal) Raise unsupported unit for 'dt64arr_as_int64*()' functions."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 *     try:             # <<<<<<<<<<<<<<
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "cytimes/utils.pxd":5793
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 *     try:
 *         unit_str = map_nptime_unit_int2str(unit)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         raise ValueError(
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5793, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_unit_str = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "cytimes/utils.pxd":5792
 *     """(internal) Raise unsupported unit for 'dt64arr_as_int64*()' functions."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 *     try:             # <<<<<<<<<<<<<<
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:
 */
    }

    /* "cytimes/utils.pxd":5801
 *         ) from err
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "cannot cast ndarray[%s[%s]] to int64 under '%s' resolution.\n"
 *             "Array with dtype of '%s[%s]' is not supported."
 */
    /*else:*/ {

      /* "cytimes/utils.pxd":5802
 *     else:
 *         raise ValueError(
 *             "cannot cast ndarray[%s[%s]] to int64 under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *             "Array with dtype of '%s[%s]' is not supported."
 *             % (obj_type, unit_str, reso, obj_type, unit_str)
 */
      __pyx_t_1 = PyTuple_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5802, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = 0;
      __pyx_t_6 = 127;
      __Pyx_INCREF(__pyx_kp_u_cannot_cast_ndarray_2);
      __pyx_t_5 += 20;
      __Pyx_GIVEREF(__pyx_kp_u_cannot_cast_ndarray_2);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_cannot_cast_ndarray_2);

      /* "cytimes/utils.pxd":5804
 *             "cannot cast ndarray[%s[%s]] to int64 under '%s' resolution.\n"
 *             "Array with dtype of '%s[%s]' is not supported."
 *             % (obj_type, unit_str, reso, obj_type, unit_str)             # <<<<<<<<<<<<<<
 *         )
 * 
 */
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_obj_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5804, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u__19);
      __pyx_t_5 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__19);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__19);
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_unit_str); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5804, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u_to_int64_under_2);
      __pyx_t_5 += 19;
      __Pyx_GIVEREF(__pyx_kp_u_to_int64_under_2);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_to_int64_under_2);
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_reso); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5804, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u_resolution_Array_with_dtype_of);
      __pyx_t_5 += 35;
      __Pyx_GIVEREF(__pyx_kp_u_resolution_Array_with_dtype_of);
      PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_resolution_Array_with_dtype_of);
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_obj_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5804, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u__19);
      __pyx_t_5 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__19);
      PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u__19);
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_unit_str); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5804, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u_is_not_supported_3);
      __pyx_t_5 += 20;
      __Pyx_GIVEREF(__pyx_kp_u_is_not_supported_3);
      PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_kp_u_is_not_supported_3);

      /* "cytimes/utils.pxd":5802
 *     else:
 *         raise ValueError(
 *             "cannot cast ndarray[%s[%s]] to int64 under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *             "Array with dtype of '%s[%s]' is not supported."
 *             % (obj_type, unit_str, reso, obj_type, unit_str)
 */
      __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 11, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5802, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cytimes/utils.pxd":5801
 *         ) from err
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "cannot cast ndarray[%s[%s]] to int64 under '%s' resolution.\n"
 *             "Array with dtype of '%s[%s]' is not supported."
 */
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5801, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 5801, __pyx_L5_except_error)
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/utils.pxd":5794
 *     try:
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "cannot cast ndarray[%s] to int64 under '%s' resolution.\n"
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("cytimes.utils._raise_dt64arr_as_int64_unit_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(0, 5794, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_v_err = __pyx_t_7;
      /*try:*/ {

        /* "cytimes/utils.pxd":5796
 *     except Exception as err:
 *         raise ValueError(
 *             "cannot cast ndarray[%s] to int64 under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *             "Array with datetime unit '%d' is not supported."
 *             % (obj_type, reso, unit)
 */
        __pyx_t_10 = PyTuple_New(7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5796, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_5 = 0;
        __pyx_t_6 = 127;
        __Pyx_INCREF(__pyx_kp_u_cannot_cast_ndarray_2);
        __pyx_t_5 += 20;
        __Pyx_GIVEREF(__pyx_kp_u_cannot_cast_ndarray_2);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_kp_u_cannot_cast_ndarray_2);

        /* "cytimes/utils.pxd":5798
 *             "cannot cast ndarray[%s] to int64 under '%s' resolution.\n"
 *             "Array with datetime unit '%d' is not supported."
 *             % (obj_type, reso, unit)             # <<<<<<<<<<<<<<
 *         ) from err
 *     else:
 */
        __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_obj_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5798, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_6;
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_INCREF(__pyx_kp_u_to_int64_under_3);
        __pyx_t_5 += 18;
        __Pyx_GIVEREF(__pyx_kp_u_to_int64_under_3);
        PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_kp_u_to_int64_under_3);
        __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_reso); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5798, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_6;
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_INCREF(__pyx_kp_u_resolution_Array_with_datetime);
        __pyx_t_5 += 40;
        __Pyx_GIVEREF(__pyx_kp_u_resolution_Array_with_datetime);
        PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_kp_u_resolution_Array_with_datetime);
        __pyx_t_11 = __Pyx_PyUnicode_From_int(__pyx_v_unit, 0, ' ', 'd'); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5798, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_INCREF(__pyx_kp_u_is_not_supported);
        __pyx_t_5 += 19;
        __Pyx_GIVEREF(__pyx_kp_u_is_not_supported);
        PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_kp_u_is_not_supported);

        /* "cytimes/utils.pxd":5796
 *     except Exception as err:
 *         raise ValueError(
 *             "cannot cast ndarray[%s] to int64 under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *             "Array with datetime unit '%d' is not supported."
 *             % (obj_type, reso, unit)
 */
        __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_10, 7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 5796, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "cytimes/utils.pxd":5795
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "cannot cast ndarray[%s] to int64 under '%s' resolution.\n"
 *             "Array with datetime unit '%d' is not supported."
 */
        __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5795, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/utils.pxd":5799
 *             "Array with datetime unit '%d' is not supported."
 *             % (obj_type, reso, unit)
 *         ) from err             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
        __Pyx_Raise(__pyx_t_10, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __PYX_ERR(0, 5795, __pyx_L14_error)
      }

      /* "cytimes/utils.pxd":5794
 *     try:
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "cannot cast ndarray[%s] to int64 under '%s' resolution.\n"
 */
      /*finally:*/ {
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_8 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          }
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/utils.pxd":5792
 *     """(internal) Raise unsupported unit for 'dt64arr_as_int64*()' functions."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 *     try:             # <<<<<<<<<<<<<<
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
  }

  /* "cytimes/utils.pxd":5789
 * 
 * # . errors: internal
 * cdef inline bint _raise_dt64arr_as_int64_unit_error(str reso, int unit, bint is_dt64=True) except -1:             # <<<<<<<<<<<<<<
 *     """(internal) Raise unsupported unit for 'dt64arr_as_int64*()' functions."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.utils._raise_dt64arr_as_int64_unit_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_XDECREF(__pyx_v_obj_type);
  __Pyx_XDECREF(__pyx_v_unit_str);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":5807
 *         )
 * 
 * cdef inline bint _raise_dt64arr_rcl_unsupport_unit_error(str ops, int to_unit, int my_unit) except -1:             # <<<<<<<<<<<<<<
 *     """(internal) Raise unsupported unit for 'dt64arr_round/ceil/floor()' functions."""
 *     my_unit_str = map_nptime_unit_int2str(my_unit)
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(PyObject *__pyx_v_ops, int __pyx_v_to_unit, int __pyx_v_my_unit) {
  PyObject *__pyx_v_my_unit_str = NULL;
  PyObject *__pyx_v_to_unit_str = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_raise_dt64arr_rcl_unsupport_unit_error", 1);

  /* "cytimes/utils.pxd":5809
 * cdef inline bint _raise_dt64arr_rcl_unsupport_unit_error(str ops, int to_unit, int my_unit) except -1:
 *     """(internal) Raise unsupported unit for 'dt64arr_round/ceil/floor()' functions."""
 *     my_unit_str = map_nptime_unit_int2str(my_unit)             # <<<<<<<<<<<<<<
 *     to_unit_str = map_nptime_unit_int2str(to_unit)
 *     raise ValueError(
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_my_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_my_unit_str = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":5810
 *     """(internal) Raise unsupported unit for 'dt64arr_round/ceil/floor()' functions."""
 *     my_unit_str = map_nptime_unit_int2str(my_unit)
 *     to_unit_str = map_nptime_unit_int2str(to_unit)             # <<<<<<<<<<<<<<
 *     raise ValueError(
 *         "%s operation on <'ndarray[datetime64[%s]]'> to "
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_to_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_to_unit_str = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":5812
 *     to_unit_str = map_nptime_unit_int2str(to_unit)
 *     raise ValueError(
 *         "%s operation on <'ndarray[datetime64[%s]]'> to "             # <<<<<<<<<<<<<<
 *         "'%s' resolution is not supported." % (ops, my_unit_str, to_unit_str)
 *     )
 */
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;

  /* "cytimes/utils.pxd":5813
 *     raise ValueError(
 *         "%s operation on <'ndarray[datetime64[%s]]'> to "
 *         "'%s' resolution is not supported." % (ops, my_unit_str, to_unit_str)             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_ops); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_operation_on_ndarray_datetime64);
  __pyx_t_2 += 35;
  __Pyx_GIVEREF(__pyx_kp_u_operation_on_ndarray_datetime64);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_operation_on_ndarray_datetime64);
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_my_unit_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_to);
  __pyx_t_2 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_to);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_to);
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_to_unit_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_resolution_is_not_supported);
  __pyx_t_2 += 30;
  __Pyx_GIVEREF(__pyx_kp_u_resolution_is_not_supported);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_resolution_is_not_supported);

  /* "cytimes/utils.pxd":5812
 *     to_unit_str = map_nptime_unit_int2str(to_unit)
 *     raise ValueError(
 *         "%s operation on <'ndarray[datetime64[%s]]'> to "             # <<<<<<<<<<<<<<
 *         "'%s' resolution is not supported." % (ops, my_unit_str, to_unit_str)
 *     )
 */
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 6, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":5811
 *     my_unit_str = map_nptime_unit_int2str(my_unit)
 *     to_unit_str = map_nptime_unit_int2str(to_unit)
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "%s operation on <'ndarray[datetime64[%s]]'> to "
 *         "'%s' resolution is not supported." % (ops, my_unit_str, to_unit_str)
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 5811, __pyx_L1_error)

  /* "cytimes/utils.pxd":5807
 *         )
 * 
 * cdef inline bint _raise_dt64arr_rcl_unsupport_unit_error(str ops, int to_unit, int my_unit) except -1:             # <<<<<<<<<<<<<<
 *     """(internal) Raise unsupported unit for 'dt64arr_round/ceil/floor()' functions."""
 *     my_unit_str = map_nptime_unit_int2str(my_unit)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils._raise_dt64arr_rcl_unsupport_unit_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_XDECREF(__pyx_v_my_unit_str);
  __Pyx_XDECREF(__pyx_v_to_unit_str);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":5816
 *     )
 * 
 * cdef inline bint _raise_dt64arr_convert_arr_unit_error(np.ndarray arr, str msg) except -1:             # <<<<<<<<<<<<<<
 *     raise ValueError(
 *         "cannot convert <'ndarray[%s]'> to %s without "
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_msg) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_raise_dt64arr_convert_arr_unit_error", 1);

  /* "cytimes/utils.pxd":5818
 * cdef inline bint _raise_dt64arr_convert_arr_unit_error(np.ndarray arr, str msg) except -1:
 *     raise ValueError(
 *         "cannot convert <'ndarray[%s]'> to %s without "             # <<<<<<<<<<<<<<
 *         "specifying the array datetime unit." % (arr.dtype, msg)
 *     )
 */
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_cannot_convert_ndarray);
  __pyx_t_2 += 25;
  __Pyx_GIVEREF(__pyx_kp_u_cannot_convert_ndarray);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_cannot_convert_ndarray);

  /* "cytimes/utils.pxd":5819
 *     raise ValueError(
 *         "cannot convert <'ndarray[%s]'> to %s without "
 *         "specifying the array datetime unit." % (arr.dtype, msg)             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u_to_2);
  __pyx_t_2 += 7;
  __Pyx_GIVEREF(__pyx_kp_u_to_2);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_to_2);
  __pyx_t_5 = __Pyx_PyUnicode_Unicode(__pyx_v_msg); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u_without_specifying_the_array_da);
  __pyx_t_2 += 44;
  __Pyx_GIVEREF(__pyx_kp_u_without_specifying_the_array_da);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_without_specifying_the_array_da);

  /* "cytimes/utils.pxd":5818
 * cdef inline bint _raise_dt64arr_convert_arr_unit_error(np.ndarray arr, str msg) except -1:
 *     raise ValueError(
 *         "cannot convert <'ndarray[%s]'> to %s without "             # <<<<<<<<<<<<<<
 *         "specifying the array datetime unit." % (arr.dtype, msg)
 *     )
 */
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.pxd":5817
 * 
 * cdef inline bint _raise_dt64arr_convert_arr_unit_error(np.ndarray arr, str msg) except -1:
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "cannot convert <'ndarray[%s]'> to %s without "
 *         "specifying the array datetime unit." % (arr.dtype, msg)
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 5817, __pyx_L1_error)

  /* "cytimes/utils.pxd":5816
 *     )
 * 
 * cdef inline bint _raise_dt64arr_convert_arr_unit_error(np.ndarray arr, str msg) except -1:             # <<<<<<<<<<<<<<
 *     raise ValueError(
 *         "cannot convert <'ndarray[%s]'> to %s without "
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils._raise_dt64arr_convert_arr_unit_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":5824
 * # NumPy: ndarray[timedelta64] --------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_td64arr(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the given array is dtype of 'timedelta64' `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_td64arr(PyArrayObject *__pyx_v_arr) {
  int __pyx_r;

  /* "cytimes/utils.pxd":5830
 *     >>> isinstance(arr.dtype, np.dtypes.TimeDelta64DType)
 *     """
 *     return np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_TIMEDELTA             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint validate_td64arr(np.ndarray arr) except -1:
 */
  __pyx_r = (PyArray_TYPE(__pyx_v_arr) == NPY_TIMEDELTA);
  goto __pyx_L0;

  /* "cytimes/utils.pxd":5824
 * # NumPy: ndarray[timedelta64] --------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_td64arr(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the given array is dtype of 'timedelta64' `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/utils.pxd":5832
 *     return np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_TIMEDELTA
 * 
 * cdef inline bint validate_td64arr(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Validate if the given array is dtype of 'timedelta64',
 *     raises `TypeError` if dtype is incorrect.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_validate_td64arr(PyArrayObject *__pyx_v_arr) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("validate_td64arr", 1);

  /* "cytimes/utils.pxd":5836
 *     raises `TypeError` if dtype is incorrect.
 *     """
 *     if not is_td64arr(arr):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects np.ndarray[timedelta64], got '%s'." % arr.dtype)
 *     return True
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_is_td64arr(__pyx_v_arr); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5836, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "cytimes/utils.pxd":5837
 *     """
 *     if not is_td64arr(arr):
 *         raise TypeError("expects np.ndarray[timedelta64], got '%s'." % arr.dtype)             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_expects_np_ndarray_timedelta64_g, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 5837, __pyx_L1_error)

    /* "cytimes/utils.pxd":5836
 *     raises `TypeError` if dtype is incorrect.
 *     """
 *     if not is_td64arr(arr):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects np.ndarray[timedelta64], got '%s'." % arr.dtype)
 *     return True
 */
  }

  /* "cytimes/utils.pxd":5838
 *     if not is_td64arr(arr):
 *         raise TypeError("expects np.ndarray[timedelta64], got '%s'." % arr.dtype)
 *     return True             # <<<<<<<<<<<<<<
 * 
 * # . conversion
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":5832
 *     return np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_TIMEDELTA
 * 
 * cdef inline bint validate_td64arr(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Validate if the given array is dtype of 'timedelta64',
 *     raises `TypeError` if dtype is incorrect.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils.validate_td64arr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":5841
 * 
 * # . conversion
 * cdef inline np.ndarray td64arr_as_int64_us(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[timedelta64] to int64 under 'us' (microsecond)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_td64arr_as_int64_us(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_td64arr_as_int64_us *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_div __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils__td64arr_W_as_int64_D __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils__td64arr_M_as_int64_D __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils__td64arr_Y_as_int64_D __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils__raise_dt64arr_as_int64_unit_error __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td64arr_as_int64_us", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/utils.pxd":5849
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5850
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5849
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "cytimes/utils.pxd":5854
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_TIMEDELTA:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "cytimes/utils.pxd":5855
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_TIMEDELTA:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_TIMEDELTA);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5856
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_TIMEDELTA:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "cytimes/utils.pxd":5857
 *     if dtype != np.NPY_TYPES.NPY_TIMEDELTA:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_us_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5857, __pyx_L1_error)

      /* "cytimes/utils.pxd":5856
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_TIMEDELTA:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "cytimes/utils.pxd":5858
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 5858, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":5859
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5859, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.pxd":5855
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_TIMEDELTA:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":5860
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5861
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 5861, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "cytimes/utils.pxd":5860
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.pxd":5863
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only timedelta64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 5863, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "cytimes/utils.pxd":5867
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5868
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5867
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/utils.pxd":5869
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5870
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, US_MILLISECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5870, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5870, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5869
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/utils.pxd":5871
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5872
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, US_MILLISECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, US_SECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MILLISECOND, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5871
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/utils.pxd":5873
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5874
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, US_SECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, US_MINUTE, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_SECOND, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5873
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/utils.pxd":5875
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5876
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, US_MINUTE, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, US_HOUR, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MINUTE, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5876, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5875
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/utils.pxd":5877
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5878
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, US_HOUR, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_HOUR, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5878, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5877
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/utils.pxd":5879
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5880
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _td64arr_W_as_int64_D(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_DAY, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5880, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5879
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "cytimes/utils.pxd":5881
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _td64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5882
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _td64arr_W_as_int64_D(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _td64arr_M_as_int64_D(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_7.__pyx_n = 2;
    __pyx_t_7.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_7.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__td64arr_W_as_int64_D(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5882, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5881
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _td64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "cytimes/utils.pxd":5883
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _td64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _td64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5884
 *         return _td64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _td64arr_M_as_int64_D(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _td64arr_Y_as_int64_D(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_8.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__td64arr_M_as_int64_D(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5884, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5883
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _td64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _td64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "cytimes/utils.pxd":5885
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _td64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _td64arr_Y_as_int64_D(arr, US_DAY, offset)
 *     # . unsupported
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5886
 *         return _td64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _td64arr_Y_as_int64_D(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("us", unit, False)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_9.__pyx_n = 2;
    __pyx_t_9.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_9.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__td64arr_Y_as_int64_D(__pyx_v_arr, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5885
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _td64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _td64arr_Y_as_int64_D(arr, US_DAY, offset)
 *     # . unsupported
 */
  }

  /* "cytimes/utils.pxd":5888
 *         return _td64arr_Y_as_int64_D(arr, US_DAY, offset)
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("us", unit, False)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray _td64arr_Y_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_t_10.__pyx_n = 1;
  __pyx_t_10.is_dt64 = 0;
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_us, __pyx_v_unit, &__pyx_t_10); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 5888, __pyx_L1_error)

  /* "cytimes/utils.pxd":5841
 * 
 * # . conversion
 * cdef inline np.ndarray td64arr_as_int64_us(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[timedelta64] to int64 under 'us' (microsecond)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.td64arr_as_int64_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":5890
 *     _raise_dt64arr_as_int64_unit_error("us", unit, False)
 * 
 * cdef inline np.ndarray _td64arr_Y_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[timedelta64[Y]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__td64arr_Y_as_int64_D(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils__td64arr_Y_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_div __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_td64arr_Y_as_int64_D", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "cytimes/utils.pxd":5897
 *     # We use integer arithmetic by scaling to avoid floating-point inaccuracies.
 *     # Multiply by 3652425 and divide by 10000 to represent 365.2425 days/year.
 *     if factor == 1:  # day             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 3_652_425), 10_000, offset) # arr * 365.2425
 *     if factor == 24:  # hour
 */
  __pyx_t_1 = (__pyx_v_factor == 1);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5898
 *     # Multiply by 3652425 and divide by 10000 to represent 365.2425 days/year.
 *     if factor == 1:  # day
 *         return arr_floor_div(arr_mul(arr, 3_652_425), 10_000, offset) # arr * 365.2425             # <<<<<<<<<<<<<<
 *     if factor == 24:  # hour
 *         return arr_floor_div(arr_mul(arr, 876_582), 100, offset) # arr * 8765.82 (365.2425 * 24)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, 0x37BB49, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(((PyArrayObject *)__pyx_t_2), 0x2710, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5897
 *     # We use integer arithmetic by scaling to avoid floating-point inaccuracies.
 *     # Multiply by 3652425 and divide by 10000 to represent 365.2425 days/year.
 *     if factor == 1:  # day             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 3_652_425), 10_000, offset) # arr * 365.2425
 *     if factor == 24:  # hour
 */
  }

  /* "cytimes/utils.pxd":5899
 *     if factor == 1:  # day
 *         return arr_floor_div(arr_mul(arr, 3_652_425), 10_000, offset) # arr * 365.2425
 *     if factor == 24:  # hour             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 876_582), 100, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute
 */
  __pyx_t_1 = (__pyx_v_factor == 24);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5900
 *         return arr_floor_div(arr_mul(arr, 3_652_425), 10_000, offset) # arr * 365.2425
 *     if factor == 24:  # hour
 *         return arr_floor_div(arr_mul(arr, 876_582), 100, offset) # arr * 8765.82 (365.2425 * 24)             # <<<<<<<<<<<<<<
 *     if factor == 1_440:  # minute
 *         return arr_floor_div(arr_mul(arr, 5_259_492), 10, offset) # arr * 8765.82 (365.2425 * 24)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, 0xD6026, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(((PyArrayObject *)__pyx_t_3), 0x64, &__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5899
 *     if factor == 1:  # day
 *         return arr_floor_div(arr_mul(arr, 3_652_425), 10_000, offset) # arr * 365.2425
 *     if factor == 24:  # hour             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 876_582), 100, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute
 */
  }

  /* "cytimes/utils.pxd":5901
 *     if factor == 24:  # hour
 *         return arr_floor_div(arr_mul(arr, 876_582), 100, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 5_259_492), 10, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == SS_DAY:  # second
 */
  __pyx_t_1 = (__pyx_v_factor == 0x5A0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5902
 *         return arr_floor_div(arr_mul(arr, 876_582), 100, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute
 *         return arr_floor_div(arr_mul(arr, 5_259_492), 10, offset) # arr * 8765.82 (365.2425 * 24)             # <<<<<<<<<<<<<<
 *     if factor == SS_DAY:  # second
 *         return arr_mul(arr, TD64_YY_SECOND)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, 0x5040E4, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(((PyArrayObject *)__pyx_t_2), 10, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5901
 *     if factor == 24:  # hour
 *         return arr_floor_div(arr_mul(arr, 876_582), 100, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 5_259_492), 10, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == SS_DAY:  # second
 */
  }

  /* "cytimes/utils.pxd":5903
 *     if factor == 1_440:  # minute
 *         return arr_floor_div(arr_mul(arr, 5_259_492), 10, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == SS_DAY:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_YY_SECOND)
 *     if factor == MS_DAY:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_SS_DAY);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5904
 *         return arr_floor_div(arr_mul(arr, 5_259_492), 10, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == SS_DAY:  # second
 *         return arr_mul(arr, TD64_YY_SECOND)             # <<<<<<<<<<<<<<
 *     if factor == MS_DAY:  # millisecond
 *         return arr_mul(arr, TD64_YY_MILLISECOND)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_TD64_YY_SECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5904, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5903
 *     if factor == 1_440:  # minute
 *         return arr_floor_div(arr_mul(arr, 5_259_492), 10, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == SS_DAY:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_YY_SECOND)
 *     if factor == MS_DAY:  # millisecond
 */
  }

  /* "cytimes/utils.pxd":5905
 *     if factor == SS_DAY:  # second
 *         return arr_mul(arr, TD64_YY_SECOND)
 *     if factor == MS_DAY:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_YY_MILLISECOND)
 *     if factor == US_DAY:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_MS_DAY);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5906
 *         return arr_mul(arr, TD64_YY_SECOND)
 *     if factor == MS_DAY:  # millisecond
 *         return arr_mul(arr, TD64_YY_MILLISECOND)             # <<<<<<<<<<<<<<
 *     if factor == US_DAY:  # microsecond
 *         return arr_mul(arr, TD64_YY_MICROSECOND)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_TD64_YY_MILLISECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5905
 *     if factor == SS_DAY:  # second
 *         return arr_mul(arr, TD64_YY_SECOND)
 *     if factor == MS_DAY:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_YY_MILLISECOND)
 *     if factor == US_DAY:  # microsecond
 */
  }

  /* "cytimes/utils.pxd":5907
 *     if factor == MS_DAY:  # millisecond
 *         return arr_mul(arr, TD64_YY_MILLISECOND)
 *     if factor == US_DAY:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_YY_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_US_DAY);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5908
 *         return arr_mul(arr, TD64_YY_MILLISECOND)
 *     if factor == US_DAY:  # microsecond
 *         return arr_mul(arr, TD64_YY_MICROSECOND)             # <<<<<<<<<<<<<<
 *     if factor == NS_DAY:  # nanosecond
 *         return arr_mul(arr, TD64_YY_NANOSECOND)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_TD64_YY_MICROSECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5908, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5907
 *     if factor == MS_DAY:  # millisecond
 *         return arr_mul(arr, TD64_YY_MILLISECOND)
 *     if factor == US_DAY:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_YY_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond
 */
  }

  /* "cytimes/utils.pxd":5909
 *     if factor == US_DAY:  # microsecond
 *         return arr_mul(arr, TD64_YY_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_YY_NANOSECOND)
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_NS_DAY);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5910
 *         return arr_mul(arr, TD64_YY_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond
 *         return arr_mul(arr, TD64_YY_NANOSECOND)             # <<<<<<<<<<<<<<
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 * 
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_TD64_YY_NANOSECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5909
 *     if factor == US_DAY:  # microsecond
 *         return arr_mul(arr, TD64_YY_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_YY_NANOSECOND)
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 */
  }

  /* "cytimes/utils.pxd":5911
 *     if factor == NS_DAY:  # nanosecond
 *         return arr_mul(arr, TD64_YY_NANOSECOND)
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray _td64arr_M_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_unsupported_factor_d_for_timedel, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_ERR(0, 5911, __pyx_L1_error)

  /* "cytimes/utils.pxd":5890
 *     _raise_dt64arr_as_int64_unit_error("us", unit, False)
 * 
 * cdef inline np.ndarray _td64arr_Y_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[timedelta64[Y]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils._td64arr_Y_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":5913
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 * 
 * cdef inline np.ndarray _td64arr_M_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[timedelta64[M]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__td64arr_M_as_int64_D(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils__td64arr_M_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_div __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_td64arr_M_as_int64_D", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "cytimes/utils.pxd":5920
 *     # We use integer arithmetic by scaling to avoid floating-point inaccuracies.
 *     # Multiply by 30436875 and divide by 1000000 to represent 30.436875 days/month.
 *     if factor == 1:  # day             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 30_436_875), 1_000_000, offset) # arr * 30.436875
 *     if factor == 24:  # hour
 */
  __pyx_t_1 = (__pyx_v_factor == 1);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5921
 *     # Multiply by 30436875 and divide by 1000000 to represent 30.436875 days/month.
 *     if factor == 1:  # day
 *         return arr_floor_div(arr_mul(arr, 30_436_875), 1_000_000, offset) # arr * 30.436875             # <<<<<<<<<<<<<<
 *     if factor == 24:  # hour
 *         return arr_floor_div(arr_mul(arr, 730_485), 1_000, offset) # arr * 730.485 (30.436875 * 24)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, 0x1D06E0B, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(((PyArrayObject *)__pyx_t_2), 0xF4240, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5920
 *     # We use integer arithmetic by scaling to avoid floating-point inaccuracies.
 *     # Multiply by 30436875 and divide by 1000000 to represent 30.436875 days/month.
 *     if factor == 1:  # day             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 30_436_875), 1_000_000, offset) # arr * 30.436875
 *     if factor == 24:  # hour
 */
  }

  /* "cytimes/utils.pxd":5922
 *     if factor == 1:  # day
 *         return arr_floor_div(arr_mul(arr, 30_436_875), 1_000_000, offset) # arr * 30.436875
 *     if factor == 24:  # hour             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 730_485), 1_000, offset) # arr * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute
 */
  __pyx_t_1 = (__pyx_v_factor == 24);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5923
 *         return arr_floor_div(arr_mul(arr, 30_436_875), 1_000_000, offset) # arr * 30.436875
 *     if factor == 24:  # hour
 *         return arr_floor_div(arr_mul(arr, 730_485), 1_000, offset) # arr * 730.485 (30.436875 * 24)             # <<<<<<<<<<<<<<
 *     if factor == 1_440:  # minute
 *         return arr_floor_div(arr_mul(arr, 438_291), 10, offset) # arr * 43829.1 (30.436875 * 1440)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, 0xB2575, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5923, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(((PyArrayObject *)__pyx_t_3), 0x3E8, &__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5923, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5922
 *     if factor == 1:  # day
 *         return arr_floor_div(arr_mul(arr, 30_436_875), 1_000_000, offset) # arr * 30.436875
 *     if factor == 24:  # hour             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 730_485), 1_000, offset) # arr * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute
 */
  }

  /* "cytimes/utils.pxd":5924
 *     if factor == 24:  # hour
 *         return arr_floor_div(arr_mul(arr, 730_485), 1_000, offset) # arr * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 438_291), 10, offset) # arr * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second
 */
  __pyx_t_1 = (__pyx_v_factor == 0x5A0);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5925
 *         return arr_floor_div(arr_mul(arr, 730_485), 1_000, offset) # arr * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute
 *         return arr_floor_div(arr_mul(arr, 438_291), 10, offset) # arr * 43829.1 (30.436875 * 1440)             # <<<<<<<<<<<<<<
 *     if factor == SS_DAY:  # second
 *         return arr_mul(arr, TD64_MM_SECOND)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, 0x6B013, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(((PyArrayObject *)__pyx_t_2), 10, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5924
 *     if factor == 24:  # hour
 *         return arr_floor_div(arr_mul(arr, 730_485), 1_000, offset) # arr * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 438_291), 10, offset) # arr * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second
 */
  }

  /* "cytimes/utils.pxd":5926
 *     if factor == 1_440:  # minute
 *         return arr_floor_div(arr_mul(arr, 438_291), 10, offset) # arr * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_MM_SECOND)
 *     if factor == MS_DAY:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_SS_DAY);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5927
 *         return arr_floor_div(arr_mul(arr, 438_291), 10, offset) # arr * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second
 *         return arr_mul(arr, TD64_MM_SECOND)             # <<<<<<<<<<<<<<
 *     if factor == MS_DAY:  # millisecond
 *         return arr_mul(arr, TD64_MM_MILLISECOND)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_TD64_MM_SECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5927, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5926
 *     if factor == 1_440:  # minute
 *         return arr_floor_div(arr_mul(arr, 438_291), 10, offset) # arr * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_MM_SECOND)
 *     if factor == MS_DAY:  # millisecond
 */
  }

  /* "cytimes/utils.pxd":5928
 *     if factor == SS_DAY:  # second
 *         return arr_mul(arr, TD64_MM_SECOND)
 *     if factor == MS_DAY:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_MM_MILLISECOND)
 *     if factor == US_DAY:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_MS_DAY);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5929
 *         return arr_mul(arr, TD64_MM_SECOND)
 *     if factor == MS_DAY:  # millisecond
 *         return arr_mul(arr, TD64_MM_MILLISECOND)             # <<<<<<<<<<<<<<
 *     if factor == US_DAY:  # microsecond
 *         return arr_mul(arr, TD64_MM_MICROSECOND)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_TD64_MM_MILLISECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5929, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5928
 *     if factor == SS_DAY:  # second
 *         return arr_mul(arr, TD64_MM_SECOND)
 *     if factor == MS_DAY:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_MM_MILLISECOND)
 *     if factor == US_DAY:  # microsecond
 */
  }

  /* "cytimes/utils.pxd":5930
 *     if factor == MS_DAY:  # millisecond
 *         return arr_mul(arr, TD64_MM_MILLISECOND)
 *     if factor == US_DAY:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_MM_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_US_DAY);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5931
 *         return arr_mul(arr, TD64_MM_MILLISECOND)
 *     if factor == US_DAY:  # microsecond
 *         return arr_mul(arr, TD64_MM_MICROSECOND)             # <<<<<<<<<<<<<<
 *     if factor == NS_DAY:  # nanosecond
 *         return arr_mul(arr, TD64_MM_NANOSECOND)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_TD64_MM_MICROSECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5930
 *     if factor == MS_DAY:  # millisecond
 *         return arr_mul(arr, TD64_MM_MILLISECOND)
 *     if factor == US_DAY:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_MM_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond
 */
  }

  /* "cytimes/utils.pxd":5932
 *     if factor == US_DAY:  # microsecond
 *         return arr_mul(arr, TD64_MM_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_MM_NANOSECOND)
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_NS_DAY);
  if (__pyx_t_1) {

    /* "cytimes/utils.pxd":5933
 *         return arr_mul(arr, TD64_MM_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond
 *         return arr_mul(arr, TD64_MM_NANOSECOND)             # <<<<<<<<<<<<<<
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 * 
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_TD64_MM_NANOSECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5933, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/utils.pxd":5932
 *     if factor == US_DAY:  # microsecond
 *         return arr_mul(arr, TD64_MM_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_MM_NANOSECOND)
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 */
  }

  /* "cytimes/utils.pxd":5934
 *     if factor == NS_DAY:  # nanosecond
 *         return arr_mul(arr, TD64_MM_NANOSECOND)
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray _td64arr_W_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_unsupported_factor_d_for_timedel_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_ERR(0, 5934, __pyx_L1_error)

  /* "cytimes/utils.pxd":5913
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 * 
 * cdef inline np.ndarray _td64arr_M_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[timedelta64[M]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils._td64arr_M_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.pxd":5936
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 * 
 * cdef inline np.ndarray _td64arr_W_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[timedelta64[W]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__td64arr_W_as_int64_D(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils__td64arr_W_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_td64arr_W_as_int64_D", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "cytimes/utils.pxd":5940
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 *     """
 *     return arr_mul(arr, 7 * factor, offset)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.offset = __pyx_v_offset;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, (7 * __pyx_v_factor), &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/utils.pxd":5936
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 * 
 * cdef inline np.ndarray _td64arr_W_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[timedelta64[W]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils._td64arr_W_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":104
 * 
 * # datetime.tzinfo --------------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _get_localtimezone() -> object:
 */

static PyObject *__pyx_f_7cytimes_5utils__get_localtimezone(void) {
  PyObject *__pyx_v_LOCALTZ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  int __pyx_t_10;
  struct __pyx_opt_args_7cytimes_5utils_tz_local_seconds __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_timezone_new __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_localtimezone", 1);

  /* "cytimes/utils.py":108
 * def _get_localtimezone() -> object:
 *     """(internal) Get the local timezone `<'ZoneInfo/timezone'>`."""
 *     from babel.dates import LOCALTZ             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(LOCALTZ, ZoneInfo):
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_LOCALTZ);
  __Pyx_GIVEREF(__pyx_n_s_LOCALTZ);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_LOCALTZ)) __PYX_ERR(1, 108, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_babel_dates, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_LOCALTZ); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_LOCALTZ = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":110
 *     from babel.dates import LOCALTZ
 * 
 *     if isinstance(LOCALTZ, ZoneInfo):             # <<<<<<<<<<<<<<
 *         return LOCALTZ
 *     try:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ZoneInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_LOCALTZ, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "cytimes/utils.py":111
 * 
 *     if isinstance(LOCALTZ, ZoneInfo):
 *         return LOCALTZ             # <<<<<<<<<<<<<<
 *     try:
 *         return ZoneInfo(LOCALTZ.zone)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_LOCALTZ);
    __pyx_r = __pyx_v_LOCALTZ;
    goto __pyx_L0;

    /* "cytimes/utils.py":110
 *     from babel.dates import LOCALTZ
 * 
 *     if isinstance(LOCALTZ, ZoneInfo):             # <<<<<<<<<<<<<<
 *         return LOCALTZ
 *     try:
 */
  }

  /* "cytimes/utils.py":112
 *     if isinstance(LOCALTZ, ZoneInfo):
 *         return LOCALTZ
 *     try:             # <<<<<<<<<<<<<<
 *         return ZoneInfo(LOCALTZ.zone)
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    /*try:*/ {

      /* "cytimes/utils.py":113
 *         return LOCALTZ
 *     try:
 *         return ZoneInfo(LOCALTZ.zone)             # <<<<<<<<<<<<<<
 *     except Exception:
 *         return datetime.timezone_new(
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ZoneInfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 113, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_LOCALTZ, __pyx_n_s_zone); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 113, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_9 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 113, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L8_try_return;

      /* "cytimes/utils.py":112
 *     if isinstance(LOCALTZ, ZoneInfo):
 *         return LOCALTZ
 *     try:             # <<<<<<<<<<<<<<
 *         return ZoneInfo(LOCALTZ.zone)
 *     except Exception:
 */
    }
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cytimes/utils.py":114
 *     try:
 *         return ZoneInfo(LOCALTZ.zone)
 *     except Exception:             # <<<<<<<<<<<<<<
 *         return datetime.timezone_new(
 *             datetime.timedelta_new(0, tz_local_seconds(None), 0), None  # type: ignore
 */
    __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_10) {
      __Pyx_AddTraceback("cytimes.utils._get_localtimezone", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_7) < 0) __PYX_ERR(1, 114, __pyx_L6_except_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "cytimes/utils.py":115
 *         return ZoneInfo(LOCALTZ.zone)
 *     except Exception:
 *         return datetime.timezone_new(             # <<<<<<<<<<<<<<
 *             datetime.timedelta_new(0, tz_local_seconds(None), 0), None  # type: ignore
 *         )
 */
      __Pyx_XDECREF(__pyx_r);

      /* "cytimes/utils.py":116
 *     except Exception:
 *         return datetime.timezone_new(
 *             datetime.timedelta_new(0, tz_local_seconds(None), 0), None  # type: ignore             # <<<<<<<<<<<<<<
 *         )
 * 
 */
      __pyx_t_11.__pyx_n = 1;
      __pyx_t_11.dt = ((PyDateTime_DateTime *)Py_None);
      __pyx_t_10 = __pyx_f_7cytimes_5utils_tz_local_seconds(&__pyx_t_11); if (unlikely(__pyx_t_10 == ((int)-200000))) __PYX_ERR(1, 116, __pyx_L6_except_error)
      __pyx_t_8 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(0, __pyx_t_10, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 116, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_8);

      /* "cytimes/utils.py":115
 *         return ZoneInfo(LOCALTZ.zone)
 *     except Exception:
 *         return datetime.timezone_new(             # <<<<<<<<<<<<<<
 *             datetime.timedelta_new(0, tz_local_seconds(None), 0), None  # type: ignore
 *         )
 */
      __pyx_t_13.__pyx_n = 1;
      __pyx_t_13.name = Py_None;
      __pyx_t_12 = __pyx_f_7cpython_8datetime_timezone_new(__pyx_t_8, &__pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 115, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_r = __pyx_t_12;
      __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L7_except_return;
    }
    goto __pyx_L6_except_error;

    /* "cytimes/utils.py":112
 *     if isinstance(LOCALTZ, ZoneInfo):
 *         return LOCALTZ
 *     try:             # <<<<<<<<<<<<<<
 *         return ZoneInfo(LOCALTZ.zone)
 *     except Exception:
 */
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L1_error;
    __pyx_L8_try_return:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L0;
    __pyx_L7_except_return:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L0;
  }

  /* "cytimes/utils.py":104
 * 
 * # datetime.tzinfo --------------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _get_localtimezone() -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cytimes.utils._get_localtimezone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_LOCALTZ);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":123
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _prep_timezone_map() -> dict:
 */

static PyObject *__pyx_f_7cytimes_5utils__prep_timezone_map(void) {
  PyObject *__pyx_v_available_timezones = NULL;
  PyObject *__pyx_v_tz_map = NULL;
  PyObject *__pyx_v_tz = NULL;
  PyObject *__pyx_7genexpr__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_prep_timezone_map", 1);

  /* "cytimes/utils.py":127
 * def _prep_timezone_map() -> dict:
 *     """(internal) Prepare the timezone map `<'dict'>`."""
 *     from zoneinfo import available_timezones             # <<<<<<<<<<<<<<
 * 
 *     # Zoneinfo timezones
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_available_timezones);
  __Pyx_GIVEREF(__pyx_n_s_available_timezones);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_available_timezones)) __PYX_ERR(1, 127, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_zoneinfo, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_available_timezones); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_available_timezones = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":130
 * 
 *     # Zoneinfo timezones
 *     tz_map = {name: ZoneInfo(name) for name in sorted(available_timezones())}             # <<<<<<<<<<<<<<
 *     # Local timezone
 *     tz_map["local"] = _LOCAL_TZ
 */
  { /* enter inner scope */
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 130, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_available_timezones);
    __pyx_t_4 = __pyx_v_available_timezones; __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 130, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_4 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 130, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_7 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 130, __pyx_L5_error)
    __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4);
    __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 130, __pyx_L5_error)
        #endif
        if (__pyx_t_8 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 130, __pyx_L5_error)
      #else
      __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 130, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_name, __pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ZoneInfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 130, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_7genexpr__pyx_v_name};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 130, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_7genexpr__pyx_v_name, (PyObject*)__pyx_t_1))) __PYX_ERR(1, 130, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_name); __pyx_7genexpr__pyx_v_name = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_name); __pyx_7genexpr__pyx_v_name = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_v_tz_map = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":132
 *     tz_map = {name: ZoneInfo(name) for name in sorted(available_timezones())}
 *     # Local timezone
 *     tz_map["local"] = _LOCAL_TZ             # <<<<<<<<<<<<<<
 *     # UTC timezone aliases
 *     for tz in (
 */
  if (unlikely((PyDict_SetItem(__pyx_v_tz_map, __pyx_n_u_local, __pyx_v_7cytimes_5utils__LOCAL_TZ) < 0))) __PYX_ERR(1, 132, __pyx_L1_error)

  /* "cytimes/utils.py":134
 *     tz_map["local"] = _LOCAL_TZ
 *     # UTC timezone aliases
 *     for tz in (             # <<<<<<<<<<<<<<
 *         "UTC",
 *         "Universal",
 */
  __pyx_t_2 = __pyx_tuple__34; __Pyx_INCREF(__pyx_t_2);
  __pyx_t_8 = 0;
  for (;;) {
    if (__pyx_t_8 >= 8) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 134, __pyx_L1_error)
    #else
    __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_tz, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "cytimes/utils.py":144
 *         "Zulu",
 *     ):
 *         tz_map[tz] = UTC             # <<<<<<<<<<<<<<
 *     return tz_map
 * 
 */
    if (unlikely((PyDict_SetItem(__pyx_v_tz_map, __pyx_v_tz, ((PyObject *)__pyx_v_7cytimes_5utils_UTC)) < 0))) __PYX_ERR(1, 144, __pyx_L1_error)

    /* "cytimes/utils.py":134
 *     tz_map["local"] = _LOCAL_TZ
 *     # UTC timezone aliases
 *     for tz in (             # <<<<<<<<<<<<<<
 *         "UTC",
 *         "Universal",
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":145
 *     ):
 *         tz_map[tz] = UTC
 *     return tz_map             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_tz_map);
  __pyx_r = __pyx_v_tz_map;
  goto __pyx_L0;

  /* "cytimes/utils.py":123
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _prep_timezone_map() -> dict:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils._prep_timezone_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_available_timezones);
  __Pyx_XDECREF(__pyx_v_tz_map);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":151
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def tz_parse(tz: datetime.tzinfo | str) -> object:
 */

static PyObject *__pyx_f_7cytimes_5utils_tz_parse(PyObject *__pyx_v_tz) {
  PyTypeObject *__pyx_v_dtype = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_UCS4 __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  unsigned int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_parse", 1);

  /* "cytimes/utils.py":162
 *     """
 *     # NoneType
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return tz
 *     # datetime.timezone
 */
  __pyx_t_1 = (__pyx_v_tz == Py_None);
  if (__pyx_t_1) {

    /* "cytimes/utils.py":163
 *     # NoneType
 *     if tz is None:
 *         return tz             # <<<<<<<<<<<<<<
 *     # datetime.timezone
 *     dtype = type(tz)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_tz);
    __pyx_r = __pyx_v_tz;
    goto __pyx_L0;

    /* "cytimes/utils.py":162
 *     """
 *     # NoneType
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return tz
 *     # datetime.timezone
 */
  }

  /* "cytimes/utils.py":165
 *         return tz
 *     # datetime.timezone
 *     dtype = type(tz)             # <<<<<<<<<<<<<<
 *     if dtype is typeref.TIMEZONE:
 *         return tz
 */
  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_tz)));
  __pyx_v_dtype = ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_tz)));

  /* "cytimes/utils.py":166
 *     # datetime.timezone
 *     dtype = type(tz)
 *     if dtype is typeref.TIMEZONE:             # <<<<<<<<<<<<<<
 *         return tz
 *     # 'str' timezone name
 */
  __pyx_t_1 = (__pyx_v_dtype == ((PyTypeObject*)__pyx_v_7cytimes_7typeref_TIMEZONE));
  if (__pyx_t_1) {

    /* "cytimes/utils.py":167
 *     dtype = type(tz)
 *     if dtype is typeref.TIMEZONE:
 *         return tz             # <<<<<<<<<<<<<<
 *     # 'str' timezone name
 *     elif dtype is str:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_tz);
    __pyx_r = __pyx_v_tz;
    goto __pyx_L0;

    /* "cytimes/utils.py":166
 *     # datetime.timezone
 *     dtype = type(tz)
 *     if dtype is typeref.TIMEZONE:             # <<<<<<<<<<<<<<
 *         return tz
 *     # 'str' timezone name
 */
  }

  /* "cytimes/utils.py":169
 *         return tz
 *     # 'str' timezone name
 *     elif dtype is str:             # <<<<<<<<<<<<<<
 *         try:
 *             return _TIMEZONE_MAP[tz]
 */
  __pyx_t_1 = (__pyx_v_dtype == (&PyUnicode_Type));
  if (__pyx_t_1) {

    /* "cytimes/utils.py":170
 *     # 'str' timezone name
 *     elif dtype is str:
 *         try:             # <<<<<<<<<<<<<<
 *             return _TIMEZONE_MAP[tz]
 *         except Exception:
 */
    {
      __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/utils.py":171
 *     elif dtype is str:
 *         try:
 *             return _TIMEZONE_MAP[tz]             # <<<<<<<<<<<<<<
 *         except Exception:
 *             pass
 */
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_7cytimes_5utils__TIMEZONE_MAP == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(1, 171, __pyx_L5_error)
        }
        __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_7cytimes_5utils__TIMEZONE_MAP, __pyx_v_tz); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 171, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L9_try_return;

        /* "cytimes/utils.py":170
 *     # 'str' timezone name
 *     elif dtype is str:
 *         try:             # <<<<<<<<<<<<<<
 *             return _TIMEZONE_MAP[tz]
 *         except Exception:
 */
      }
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cytimes/utils.py":172
 *         try:
 *             return _TIMEZONE_MAP[tz]
 *         except Exception:             # <<<<<<<<<<<<<<
 *             pass
 *     # 'Zoneinfo' timezone
 */
      __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
      if (__pyx_t_6) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L6_exception_handled;
      }
      goto __pyx_L7_except_error;

      /* "cytimes/utils.py":170
 *     # 'str' timezone name
 *     elif dtype is str:
 *         try:             # <<<<<<<<<<<<<<
 *             return _TIMEZONE_MAP[tz]
 *         except Exception:
 */
      __pyx_L7_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_return:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L0;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    }

    /* "cytimes/utils.py":169
 *         return tz
 *     # 'str' timezone name
 *     elif dtype is str:             # <<<<<<<<<<<<<<
 *         try:
 *             return _TIMEZONE_MAP[tz]
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.py":175
 *             pass
 *     # 'Zoneinfo' timezone
 *     elif dtype is typeref.ZONEINFO:             # <<<<<<<<<<<<<<
 *         try:
 *             return _TIMEZONE_MAP[tz.key]
 */
  __pyx_t_1 = (__pyx_v_dtype == ((PyTypeObject*)__pyx_v_7cytimes_7typeref_ZONEINFO));
  if (__pyx_t_1) {

    /* "cytimes/utils.py":176
 *     # 'Zoneinfo' timezone
 *     elif dtype is typeref.ZONEINFO:
 *         try:             # <<<<<<<<<<<<<<
 *             return _TIMEZONE_MAP[tz.key]
 *         except Exception:
 */
    {
      __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/utils.py":177
 *     elif dtype is typeref.ZONEINFO:
 *         try:
 *             return _TIMEZONE_MAP[tz.key]             # <<<<<<<<<<<<<<
 *         except Exception:
 *             pass
 */
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_7cytimes_5utils__TIMEZONE_MAP == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(1, 177, __pyx_L11_error)
        }
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 177, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_7cytimes_5utils__TIMEZONE_MAP, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 177, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_r = __pyx_t_7;
        __pyx_t_7 = 0;
        goto __pyx_L15_try_return;

        /* "cytimes/utils.py":176
 *     # 'Zoneinfo' timezone
 *     elif dtype is typeref.ZONEINFO:
 *         try:             # <<<<<<<<<<<<<<
 *             return _TIMEZONE_MAP[tz.key]
 *         except Exception:
 */
      }
      __pyx_L11_error:;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cytimes/utils.py":178
 *         try:
 *             return _TIMEZONE_MAP[tz.key]
 *         except Exception:             # <<<<<<<<<<<<<<
 *             pass
 *     # Subclass of 'Zoneinfo' timezone
 */
      __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
      if (__pyx_t_6) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L12_exception_handled;
      }
      goto __pyx_L13_except_error;

      /* "cytimes/utils.py":176
 *     # 'Zoneinfo' timezone
 *     elif dtype is typeref.ZONEINFO:
 *         try:             # <<<<<<<<<<<<<<
 *             return _TIMEZONE_MAP[tz.key]
 *         except Exception:
 */
      __pyx_L13_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_L15_try_return:;
      __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_L0;
      __pyx_L12_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
    }

    /* "cytimes/utils.py":175
 *             pass
 *     # 'Zoneinfo' timezone
 *     elif dtype is typeref.ZONEINFO:             # <<<<<<<<<<<<<<
 *         try:
 *             return _TIMEZONE_MAP[tz.key]
 */
    goto __pyx_L4;
  }

  /* "cytimes/utils.py":181
 *             pass
 *     # Subclass of 'Zoneinfo' timezone
 *     elif isinstance(tz, typeref.ZONEINFO):             # <<<<<<<<<<<<<<
 *         return tz
 *     # 'pytz' timezone
 */
  __pyx_t_7 = __pyx_v_7cytimes_7typeref_ZONEINFO;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_7); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 181, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_1) {

    /* "cytimes/utils.py":182
 *     # Subclass of 'Zoneinfo' timezone
 *     elif isinstance(tz, typeref.ZONEINFO):
 *         return tz             # <<<<<<<<<<<<<<
 *     # 'pytz' timezone
 *     elif hasattr(tz, "localize"):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_tz);
    __pyx_r = __pyx_v_tz;
    goto __pyx_L0;

    /* "cytimes/utils.py":181
 *             pass
 *     # Subclass of 'Zoneinfo' timezone
 *     elif isinstance(tz, typeref.ZONEINFO):             # <<<<<<<<<<<<<<
 *         return tz
 *     # 'pytz' timezone
 */
  }

  /* "cytimes/utils.py":184
 *         return tz
 *     # 'pytz' timezone
 *     elif hasattr(tz, "localize"):             # <<<<<<<<<<<<<<
 *         try:
 *             return _TIMEZONE_MAP[tz.zone]
 */
  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_tz, __pyx_n_u_localize); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 184, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/utils.py":185
 *     # 'pytz' timezone
 *     elif hasattr(tz, "localize"):
 *         try:             # <<<<<<<<<<<<<<
 *             return _TIMEZONE_MAP[tz.zone]
 *         except Exception:
 */
    {
      __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/utils.py":186
 *     elif hasattr(tz, "localize"):
 *         try:
 *             return _TIMEZONE_MAP[tz.zone]             # <<<<<<<<<<<<<<
 *         except Exception:
 *             pass
 */
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_7cytimes_5utils__TIMEZONE_MAP == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(1, 186, __pyx_L17_error)
        }
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_zone); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 186, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_7cytimes_5utils__TIMEZONE_MAP, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 186, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L21_try_return;

        /* "cytimes/utils.py":185
 *     # 'pytz' timezone
 *     elif hasattr(tz, "localize"):
 *         try:             # <<<<<<<<<<<<<<
 *             return _TIMEZONE_MAP[tz.zone]
 *         except Exception:
 */
      }
      __pyx_L17_error:;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cytimes/utils.py":187
 *         try:
 *             return _TIMEZONE_MAP[tz.zone]
 *         except Exception:             # <<<<<<<<<<<<<<
 *             pass
 *     # Invalid timezone
 */
      __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
      if (__pyx_t_6) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L18_exception_handled;
      }
      goto __pyx_L19_except_error;

      /* "cytimes/utils.py":185
 *     # 'pytz' timezone
 *     elif hasattr(tz, "localize"):
 *         try:             # <<<<<<<<<<<<<<
 *             return _TIMEZONE_MAP[tz.zone]
 *         except Exception:
 */
      __pyx_L19_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_L21_try_return:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L0;
      __pyx_L18_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    }

    /* "cytimes/utils.py":184
 *         return tz
 *     # 'pytz' timezone
 *     elif hasattr(tz, "localize"):             # <<<<<<<<<<<<<<
 *         try:
 *             return _TIMEZONE_MAP[tz.zone]
 */
  }
  __pyx_L4:;

  /* "cytimes/utils.py":190
 *             pass
 *     # Invalid timezone
 *     raise errors.InvalidTimezoneError("invalid timezone '%s' %s" % (tz, type(tz)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_errors); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_InvalidTimezoneError); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = 0;
  __pyx_t_10 = 127;
  __Pyx_INCREF(__pyx_kp_u_invalid_timezone);
  __pyx_t_9 += 18;
  __Pyx_GIVEREF(__pyx_kp_u_invalid_timezone);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_u_invalid_timezone);
  __pyx_t_11 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_tz), __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_10;
  __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_11);
  __pyx_t_11 = 0;
  __Pyx_INCREF(__pyx_kp_u__35);
  __pyx_t_9 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__35);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u__35);
  __pyx_t_11 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_tz))), __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_10;
  __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_11);
  __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_7, 4, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  __pyx_t_12 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_12 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_11};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __PYX_ERR(1, 190, __pyx_L1_error)

  /* "cytimes/utils.py":151
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def tz_parse(tz: datetime.tzinfo | str) -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.utils.tz_parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_dtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":195
 * ########## The REST utility functions are in the utils.pxd file ##########
 * ########## The following functions are for testing purpose only ##########
 * def _test_utils() -> None:             # <<<<<<<<<<<<<<
 *     # Parser
 *     _test_parser()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_1_test_utils(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_1_test_utils = {"_test_utils", (PyCFunction)__pyx_pw_7cytimes_5utils_1_test_utils, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_1_test_utils(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_utils (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils__test_utils(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils__test_utils(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_utils", 1);

  /* "cytimes/utils.py":197
 * def _test_utils() -> None:
 *     # Parser
 *     _test_parser()             # <<<<<<<<<<<<<<
 *     # Time
 *     _test_localtime_n_gmtime()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_parser); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":199
 *     _test_parser()
 *     # Time
 *     _test_localtime_n_gmtime()             # <<<<<<<<<<<<<<
 *     # Calendar
 *     _test_is_leap_year()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_localtime_n_gmtime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":201
 *     _test_localtime_n_gmtime()
 *     # Calendar
 *     _test_is_leap_year()             # <<<<<<<<<<<<<<
 *     _test_days_bf_year()
 *     _test_quarter_of_month()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_is_leap_year); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":202
 *     # Calendar
 *     _test_is_leap_year()
 *     _test_days_bf_year()             # <<<<<<<<<<<<<<
 *     _test_quarter_of_month()
 *     _test_days_in_quarter()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_days_bf_year); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":203
 *     _test_is_leap_year()
 *     _test_days_bf_year()
 *     _test_quarter_of_month()             # <<<<<<<<<<<<<<
 *     _test_days_in_quarter()
 *     _test_days_in_month()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_quarter_of_month); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 203, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":204
 *     _test_days_bf_year()
 *     _test_quarter_of_month()
 *     _test_days_in_quarter()             # <<<<<<<<<<<<<<
 *     _test_days_in_month()
 *     _test_days_bf_month()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_days_in_quarter); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":205
 *     _test_quarter_of_month()
 *     _test_days_in_quarter()
 *     _test_days_in_month()             # <<<<<<<<<<<<<<
 *     _test_days_bf_month()
 *     _test_weekday()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_days_in_month); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":206
 *     _test_days_in_quarter()
 *     _test_days_in_month()
 *     _test_days_bf_month()             # <<<<<<<<<<<<<<
 *     _test_weekday()
 *     _test_isocalendar()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_days_bf_month); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":207
 *     _test_days_in_month()
 *     _test_days_bf_month()
 *     _test_weekday()             # <<<<<<<<<<<<<<
 *     _test_isocalendar()
 *     _test_iso_1st_monday()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_weekday); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":208
 *     _test_days_bf_month()
 *     _test_weekday()
 *     _test_isocalendar()             # <<<<<<<<<<<<<<
 *     _test_iso_1st_monday()
 *     _test_ymd_to_ordinal()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_isocalendar); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":209
 *     _test_weekday()
 *     _test_isocalendar()
 *     _test_iso_1st_monday()             # <<<<<<<<<<<<<<
 *     _test_ymd_to_ordinal()
 *     _test_ymd_fr_ordinal()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_iso_1st_monday); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":210
 *     _test_isocalendar()
 *     _test_iso_1st_monday()
 *     _test_ymd_to_ordinal()             # <<<<<<<<<<<<<<
 *     _test_ymd_fr_ordinal()
 *     _test_ymd_fr_isocalendar()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_ymd_to_ordinal); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":211
 *     _test_iso_1st_monday()
 *     _test_ymd_to_ordinal()
 *     _test_ymd_fr_ordinal()             # <<<<<<<<<<<<<<
 *     _test_ymd_fr_isocalendar()
 *     # datetime.date
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_ymd_fr_ordinal); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":212
 *     _test_ymd_to_ordinal()
 *     _test_ymd_fr_ordinal()
 *     _test_ymd_fr_isocalendar()             # <<<<<<<<<<<<<<
 *     # datetime.date
 *     _test_date_generate()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_ymd_fr_isocalendar); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":214
 *     _test_ymd_fr_isocalendar()
 *     # datetime.date
 *     _test_date_generate()             # <<<<<<<<<<<<<<
 *     _test_date_type_check()
 *     _test_date_conversion()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_date_generate); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":215
 *     # datetime.date
 *     _test_date_generate()
 *     _test_date_type_check()             # <<<<<<<<<<<<<<
 *     _test_date_conversion()
 *     # datetime.datetime
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_date_type_check); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":216
 *     _test_date_generate()
 *     _test_date_type_check()
 *     _test_date_conversion()             # <<<<<<<<<<<<<<
 *     # datetime.datetime
 *     _test_dt_generate()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_date_conversion); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":218
 *     _test_date_conversion()
 *     # datetime.datetime
 *     _test_dt_generate()             # <<<<<<<<<<<<<<
 *     _test_dt_type_check()
 *     _test_dt_tzinfo()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_dt_generate); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":219
 *     # datetime.datetime
 *     _test_dt_generate()
 *     _test_dt_type_check()             # <<<<<<<<<<<<<<
 *     _test_dt_tzinfo()
 *     _test_dt_conversion()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_dt_type_check); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":220
 *     _test_dt_generate()
 *     _test_dt_type_check()
 *     _test_dt_tzinfo()             # <<<<<<<<<<<<<<
 *     _test_dt_conversion()
 *     _test_dt_mainipulate()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_dt_tzinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":221
 *     _test_dt_type_check()
 *     _test_dt_tzinfo()
 *     _test_dt_conversion()             # <<<<<<<<<<<<<<
 *     _test_dt_mainipulate()
 *     _test_dt_arithmetic()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_dt_conversion); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":222
 *     _test_dt_tzinfo()
 *     _test_dt_conversion()
 *     _test_dt_mainipulate()             # <<<<<<<<<<<<<<
 *     _test_dt_arithmetic()
 *     # datetime.time
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_dt_mainipulate); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":223
 *     _test_dt_conversion()
 *     _test_dt_mainipulate()
 *     _test_dt_arithmetic()             # <<<<<<<<<<<<<<
 *     # datetime.time
 *     _test_time_generate()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_dt_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":225
 *     _test_dt_arithmetic()
 *     # datetime.time
 *     _test_time_generate()             # <<<<<<<<<<<<<<
 *     _test_time_type_check()
 *     _test_time_tzinfo()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_time_generate); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":226
 *     # datetime.time
 *     _test_time_generate()
 *     _test_time_type_check()             # <<<<<<<<<<<<<<
 *     _test_time_tzinfo()
 *     _test_time_conversion()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_time_type_check); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":227
 *     _test_time_generate()
 *     _test_time_type_check()
 *     _test_time_tzinfo()             # <<<<<<<<<<<<<<
 *     _test_time_conversion()
 *     # datetime.timedelta
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_time_tzinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":228
 *     _test_time_type_check()
 *     _test_time_tzinfo()
 *     _test_time_conversion()             # <<<<<<<<<<<<<<
 *     # datetime.timedelta
 *     _test_timedelta_generate()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_time_conversion); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":230
 *     _test_time_conversion()
 *     # datetime.timedelta
 *     _test_timedelta_generate()             # <<<<<<<<<<<<<<
 *     _test_timedelta_type_check()
 *     _test_timedelta_conversion()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_timedelta_generate); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":231
 *     # datetime.timedelta
 *     _test_timedelta_generate()
 *     _test_timedelta_type_check()             # <<<<<<<<<<<<<<
 *     _test_timedelta_conversion()
 *     # datetime.tzinfo
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_timedelta_type_check); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":232
 *     _test_timedelta_generate()
 *     _test_timedelta_type_check()
 *     _test_timedelta_conversion()             # <<<<<<<<<<<<<<
 *     # datetime.tzinfo
 *     _test_tzinfo_generate()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_timedelta_conversion); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":234
 *     _test_timedelta_conversion()
 *     # datetime.tzinfo
 *     _test_tzinfo_generate()             # <<<<<<<<<<<<<<
 *     _test_tzinfo_type_check()
 *     _test_tzinfo_access()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_tzinfo_generate); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":235
 *     # datetime.tzinfo
 *     _test_tzinfo_generate()
 *     _test_tzinfo_type_check()             # <<<<<<<<<<<<<<
 *     _test_tzinfo_access()
 *     # numpy.share
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_tzinfo_type_check); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":236
 *     _test_tzinfo_generate()
 *     _test_tzinfo_type_check()
 *     _test_tzinfo_access()             # <<<<<<<<<<<<<<
 *     # numpy.share
 *     _test_numpy_share()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_tzinfo_access); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":238
 *     _test_tzinfo_access()
 *     # numpy.share
 *     _test_numpy_share()             # <<<<<<<<<<<<<<
 *     # numpy.datetime64
 *     _test_datetime64_type_check()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_numpy_share); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":240
 *     _test_numpy_share()
 *     # numpy.datetime64
 *     _test_datetime64_type_check()             # <<<<<<<<<<<<<<
 *     _test_datetime64_conversion()
 *     # numpy.timedelta64
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_datetime64_type_check); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":241
 *     # numpy.datetime64
 *     _test_datetime64_type_check()
 *     _test_datetime64_conversion()             # <<<<<<<<<<<<<<
 *     # numpy.timedelta64
 *     _test_timedelta64_type_check()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_datetime64_conversion); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":243
 *     _test_datetime64_conversion()
 *     # numpy.timedelta64
 *     _test_timedelta64_type_check()             # <<<<<<<<<<<<<<
 *     _test_timedelta64_conversion()
 *     # numpy.ndarray
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_timedelta64_type_check); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":244
 *     # numpy.timedelta64
 *     _test_timedelta64_type_check()
 *     _test_timedelta64_conversion()             # <<<<<<<<<<<<<<
 *     # numpy.ndarray
 *     _test_ndarray_type_check()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_timedelta64_conversion); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":246
 *     _test_timedelta64_conversion()
 *     # numpy.ndarray
 *     _test_ndarray_type_check()             # <<<<<<<<<<<<<<
 *     _test_ndarray_dt64_type_check()
 *     _test_ndarray_dt64_conversion()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_ndarray_type_check); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":247
 *     # numpy.ndarray
 *     _test_ndarray_type_check()
 *     _test_ndarray_dt64_type_check()             # <<<<<<<<<<<<<<
 *     _test_ndarray_dt64_conversion()
 *     _test_ndarray_td64_type_check()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_ndarray_dt64_type_check); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":248
 *     _test_ndarray_type_check()
 *     _test_ndarray_dt64_type_check()
 *     _test_ndarray_dt64_conversion()             # <<<<<<<<<<<<<<
 *     _test_ndarray_td64_type_check()
 *     _test_ndarray_td64_conversion()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_ndarray_dt64_conversion); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":249
 *     _test_ndarray_dt64_type_check()
 *     _test_ndarray_dt64_conversion()
 *     _test_ndarray_td64_type_check()             # <<<<<<<<<<<<<<
 *     _test_ndarray_td64_conversion()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_ndarray_td64_type_check); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":250
 *     _test_ndarray_dt64_conversion()
 *     _test_ndarray_td64_type_check()
 *     _test_ndarray_td64_conversion()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_test_ndarray_td64_conversion); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":195
 * ########## The REST utility functions are in the utils.pxd file ##########
 * ########## The following functions are for testing purpose only ##########
 * def _test_utils() -> None:             # <<<<<<<<<<<<<<
 *     # Parser
 *     _test_parser()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils._test_utils", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":254
 * 
 * # Parser
 * def _test_parser() -> None:             # <<<<<<<<<<<<<<
 *     # boolean
 *     assert is_iso_sep("t")  # type: ignore
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_3_test_parser(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_3_test_parser = {"_test_parser", (PyCFunction)__pyx_pw_7cytimes_5utils_3_test_parser, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_3_test_parser(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_parser (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_2_test_parser(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_2_test_parser(CYTHON_UNUSED PyObject *__pyx_self) {
  Py_UCS4 __pyx_v_i;
  PyObject *__pyx_v_t = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  unsigned char const *__pyx_t_3;
  unsigned char const *__pyx_t_4;
  unsigned char const *__pyx_t_5;
  unsigned char const *__pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_parser", 1);

  /* "cytimes/utils.py":256
 * def _test_parser() -> None:
 *     # boolean
 *     assert is_iso_sep("t")  # type: ignore             # <<<<<<<<<<<<<<
 *     assert is_iso_sep("T")  # type: ignore
 *     assert is_iso_sep(" ")  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_iso_sep(0x74); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 256, __pyx_L1_error)
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 256, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 256, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":257
 *     # boolean
 *     assert is_iso_sep("t")  # type: ignore
 *     assert is_iso_sep("T")  # type: ignore             # <<<<<<<<<<<<<<
 *     assert is_iso_sep(" ")  # type: ignore
 *     assert not is_iso_sep("a")  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_iso_sep(84); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 257, __pyx_L1_error)
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 257, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 257, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":258
 *     assert is_iso_sep("t")  # type: ignore
 *     assert is_iso_sep("T")  # type: ignore
 *     assert is_iso_sep(" ")  # type: ignore             # <<<<<<<<<<<<<<
 *     assert not is_iso_sep("a")  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_iso_sep(32); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 258, __pyx_L1_error)
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 258, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 258, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":259
 *     assert is_iso_sep("T")  # type: ignore
 *     assert is_iso_sep(" ")  # type: ignore
 *     assert not is_iso_sep("a")  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     assert is_isodate_sep("-")  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_iso_sep(97); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 259, __pyx_L1_error)
    __pyx_t_2 = (!__pyx_t_1);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 259, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 259, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":261
 *     assert not is_iso_sep("a")  # type: ignore
 * 
 *     assert is_isodate_sep("-")  # type: ignore             # <<<<<<<<<<<<<<
 *     assert is_isodate_sep("/")  # type: ignore
 *     assert not is_isodate_sep("a")  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_is_isodate_sep(45); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 261, __pyx_L1_error)
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 261, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 261, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":262
 * 
 *     assert is_isodate_sep("-")  # type: ignore
 *     assert is_isodate_sep("/")  # type: ignore             # <<<<<<<<<<<<<<
 *     assert not is_isodate_sep("a")  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_is_isodate_sep(47); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 262, __pyx_L1_error)
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 262, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 262, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":263
 *     assert is_isodate_sep("-")  # type: ignore
 *     assert is_isodate_sep("/")  # type: ignore
 *     assert not is_isodate_sep("a")  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     assert is_isoweek_sep("w")  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_is_isodate_sep(97); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 263, __pyx_L1_error)
    __pyx_t_1 = (!__pyx_t_2);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 263, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 263, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":265
 *     assert not is_isodate_sep("a")  # type: ignore
 * 
 *     assert is_isoweek_sep("w")  # type: ignore             # <<<<<<<<<<<<<<
 *     assert is_isoweek_sep("W")  # type: ignore
 *     assert not is_isoweek_sep("a")  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_isoweek_sep(0x77); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 265, __pyx_L1_error)
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 265, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 265, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":266
 * 
 *     assert is_isoweek_sep("w")  # type: ignore
 *     assert is_isoweek_sep("W")  # type: ignore             # <<<<<<<<<<<<<<
 *     assert not is_isoweek_sep("a")  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_isoweek_sep(87); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 266, __pyx_L1_error)
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 266, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 266, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":267
 *     assert is_isoweek_sep("w")  # type: ignore
 *     assert is_isoweek_sep("W")  # type: ignore
 *     assert not is_isoweek_sep("a")  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     assert is_isotime_sep(":")  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_isoweek_sep(97); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 267, __pyx_L1_error)
    __pyx_t_2 = (!__pyx_t_1);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 267, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 267, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":269
 *     assert not is_isoweek_sep("a")  # type: ignore
 * 
 *     assert is_isotime_sep(":")  # type: ignore             # <<<<<<<<<<<<<<
 *     assert not is_isotime_sep("a")  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_is_isotime_sep(58); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 269, __pyx_L1_error)
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 269, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 269, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":270
 * 
 *     assert is_isotime_sep(":")  # type: ignore
 *     assert not is_isotime_sep("a")  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     for i in "0123456789":
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_is_isotime_sep(97); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 270, __pyx_L1_error)
    __pyx_t_1 = (!__pyx_t_2);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 270, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 270, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":272
 *     assert not is_isotime_sep("a")  # type: ignore
 * 
 *     for i in "0123456789":             # <<<<<<<<<<<<<<
 *         assert is_ascii_digit(i)  # type: ignore
 *     assert not is_ascii_digit("a")  # type: ignore
 */
  __pyx_t_4 = ((unsigned char const *)((char const *)"0123456789"));
  __pyx_t_5 = (__pyx_t_4 + 10);
  for (__pyx_t_6 = __pyx_t_4; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
    __pyx_t_3 = __pyx_t_6;
    __pyx_v_i = (__pyx_t_3[0]);

    /* "cytimes/utils.py":273
 * 
 *     for i in "0123456789":
 *         assert is_ascii_digit(i)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert not is_ascii_digit("a")  # type: ignore
 * 
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_ascii_digit(__pyx_v_i); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 273, __pyx_L1_error)
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 273, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 273, __pyx_L1_error)
    #endif
  }

  /* "cytimes/utils.py":274
 *     for i in "0123456789":
 *         assert is_ascii_digit(i)  # type: ignore
 *     assert not is_ascii_digit("a")  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     for i in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_ascii_digit(97); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 274, __pyx_L1_error)
    __pyx_t_2 = (!__pyx_t_1);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 274, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 274, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":276
 *     assert not is_ascii_digit("a")  # type: ignore
 * 
 *     for i in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":             # <<<<<<<<<<<<<<
 *         assert is_ascii_alpha_upper(i)  # type: ignore
 *     assert not is_ascii_alpha_upper("1")  # type: ignore
 */
  __pyx_t_5 = ((unsigned char const *)((char const *)"ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
  __pyx_t_4 = (__pyx_t_5 + 26);
  for (__pyx_t_6 = __pyx_t_5; __pyx_t_6 < __pyx_t_4; __pyx_t_6++) {
    __pyx_t_3 = __pyx_t_6;
    __pyx_v_i = (__pyx_t_3[0]);

    /* "cytimes/utils.py":277
 * 
 *     for i in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
 *         assert is_ascii_alpha_upper(i)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert not is_ascii_alpha_upper("1")  # type: ignore
 * 
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_2 = __pyx_f_7cytimes_5utils_is_ascii_alpha_upper(__pyx_v_i); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 277, __pyx_L1_error)
      if (unlikely(!__pyx_t_2)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 277, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 277, __pyx_L1_error)
    #endif
  }

  /* "cytimes/utils.py":278
 *     for i in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
 *         assert is_ascii_alpha_upper(i)  # type: ignore
 *     assert not is_ascii_alpha_upper("1")  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     for i in "abcdefghijklmnopqrstuvwxyz":
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_is_ascii_alpha_upper(49); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 278, __pyx_L1_error)
    __pyx_t_1 = (!__pyx_t_2);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 278, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 278, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":280
 *     assert not is_ascii_alpha_upper("1")  # type: ignore
 * 
 *     for i in "abcdefghijklmnopqrstuvwxyz":             # <<<<<<<<<<<<<<
 *         assert is_ascii_alpha_lower(i)  # type: ignore
 *     assert not is_ascii_alpha_lower("1")  # type: ignore
 */
  __pyx_t_4 = ((unsigned char const *)((char const *)"abcdefghijklmnopqrstuvwxyz"));
  __pyx_t_5 = (__pyx_t_4 + 26);
  for (__pyx_t_6 = __pyx_t_4; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
    __pyx_t_3 = __pyx_t_6;
    __pyx_v_i = (__pyx_t_3[0]);

    /* "cytimes/utils.py":281
 * 
 *     for i in "abcdefghijklmnopqrstuvwxyz":
 *         assert is_ascii_alpha_lower(i)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert not is_ascii_alpha_lower("1")  # type: ignore
 * 
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_ascii_alpha_lower(__pyx_v_i); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 281, __pyx_L1_error)
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 281, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 281, __pyx_L1_error)
    #endif
  }

  /* "cytimes/utils.py":282
 *     for i in "abcdefghijklmnopqrstuvwxyz":
 *         assert is_ascii_alpha_lower(i)  # type: ignore
 *     assert not is_ascii_alpha_lower("1")  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     # Parse
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_ascii_alpha_lower(49); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 282, __pyx_L1_error)
    __pyx_t_2 = (!__pyx_t_1);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 282, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 282, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":285
 * 
 *     # Parse
 *     t: str = "2021-01-02T03:04:05.006007"             # <<<<<<<<<<<<<<
 *     assert parse_isoyear(t, 0, 0) == 2021  # type: ignore
 *     assert parse_isoyear(t, 1, 0) == -1  # type: ignore
 */
  __Pyx_INCREF(__pyx_kp_u_2021_01_02T03_04_05_006007);
  __pyx_v_t = __pyx_kp_u_2021_01_02T03_04_05_006007;

  /* "cytimes/utils.py":286
 *     # Parse
 *     t: str = "2021-01-02T03:04:05.006007"
 *     assert parse_isoyear(t, 0, 0) == 2021  # type: ignore             # <<<<<<<<<<<<<<
 *     assert parse_isoyear(t, 1, 0) == -1  # type: ignore
 *     assert parse_isomonth(t, 5, 0) == 1  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_7 = __pyx_f_7cytimes_5utils_parse_isoyear(__pyx_v_t, 0, 0); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(1, 286, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 == 0x7E5);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 286, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 286, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":287
 *     t: str = "2021-01-02T03:04:05.006007"
 *     assert parse_isoyear(t, 0, 0) == 2021  # type: ignore
 *     assert parse_isoyear(t, 1, 0) == -1  # type: ignore             # <<<<<<<<<<<<<<
 *     assert parse_isomonth(t, 5, 0) == 1  # type: ignore
 *     assert parse_isomonth(t, 6, 0) == -1  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_7 = __pyx_f_7cytimes_5utils_parse_isoyear(__pyx_v_t, 1, 0); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(1, 287, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 == -1L);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 287, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 287, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":288
 *     assert parse_isoyear(t, 0, 0) == 2021  # type: ignore
 *     assert parse_isoyear(t, 1, 0) == -1  # type: ignore
 *     assert parse_isomonth(t, 5, 0) == 1  # type: ignore             # <<<<<<<<<<<<<<
 *     assert parse_isomonth(t, 6, 0) == -1  # type: ignore
 *     assert parse_isoday(t, 8, 0) == 2  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_7 = __pyx_f_7cytimes_5utils_parse_isomonth(__pyx_v_t, 5, 0); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(1, 288, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 == 1);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 288, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 288, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":289
 *     assert parse_isoyear(t, 1, 0) == -1  # type: ignore
 *     assert parse_isomonth(t, 5, 0) == 1  # type: ignore
 *     assert parse_isomonth(t, 6, 0) == -1  # type: ignore             # <<<<<<<<<<<<<<
 *     assert parse_isoday(t, 8, 0) == 2  # type: ignore
 *     assert parse_isoday(t, 9, 0) == -1  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_7 = __pyx_f_7cytimes_5utils_parse_isomonth(__pyx_v_t, 6, 0); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(1, 289, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 == -1L);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 289, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 289, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":290
 *     assert parse_isomonth(t, 5, 0) == 1  # type: ignore
 *     assert parse_isomonth(t, 6, 0) == -1  # type: ignore
 *     assert parse_isoday(t, 8, 0) == 2  # type: ignore             # <<<<<<<<<<<<<<
 *     assert parse_isoday(t, 9, 0) == -1  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_7 = __pyx_f_7cytimes_5utils_parse_isoday(__pyx_v_t, 8, 0); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(1, 290, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 == 2);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 290, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 290, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":291
 *     assert parse_isomonth(t, 6, 0) == -1  # type: ignore
 *     assert parse_isoday(t, 8, 0) == 2  # type: ignore
 *     assert parse_isoday(t, 9, 0) == -1  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     t = "2021-W52-6"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_7 = __pyx_f_7cytimes_5utils_parse_isoday(__pyx_v_t, 9, 0); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(1, 291, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 == -1L);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 291, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 291, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":293
 *     assert parse_isoday(t, 9, 0) == -1  # type: ignore
 * 
 *     t = "2021-W52-6"             # <<<<<<<<<<<<<<
 *     assert parse_isoweek(t, 6, 0) == 52  # type: ignore
 *     assert parse_isoweek(t, 7, 0) == -1  # type: ignore
 */
  __Pyx_INCREF(__pyx_kp_u_2021_W52_6);
  __Pyx_DECREF_SET(__pyx_v_t, __pyx_kp_u_2021_W52_6);

  /* "cytimes/utils.py":294
 * 
 *     t = "2021-W52-6"
 *     assert parse_isoweek(t, 6, 0) == 52  # type: ignore             # <<<<<<<<<<<<<<
 *     assert parse_isoweek(t, 7, 0) == -1  # type: ignore
 *     assert parse_isoweekday(t, 9, 0) == 6  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_7 = __pyx_f_7cytimes_5utils_parse_isoweek(__pyx_v_t, 6, 0); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(1, 294, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 == 52);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 294, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 294, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":295
 *     t = "2021-W52-6"
 *     assert parse_isoweek(t, 6, 0) == 52  # type: ignore
 *     assert parse_isoweek(t, 7, 0) == -1  # type: ignore             # <<<<<<<<<<<<<<
 *     assert parse_isoweekday(t, 9, 0) == 6  # type: ignore
 *     assert parse_isoweekday(t, 8, 0) == -1  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_7 = __pyx_f_7cytimes_5utils_parse_isoweek(__pyx_v_t, 7, 0); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(1, 295, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 == -1L);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 295, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 295, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":296
 *     assert parse_isoweek(t, 6, 0) == 52  # type: ignore
 *     assert parse_isoweek(t, 7, 0) == -1  # type: ignore
 *     assert parse_isoweekday(t, 9, 0) == 6  # type: ignore             # <<<<<<<<<<<<<<
 *     assert parse_isoweekday(t, 8, 0) == -1  # type: ignore
 *     assert parse_isoweekday(t, 10, 0) == -1  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_7 = __pyx_f_7cytimes_5utils_parse_isoweekday(__pyx_v_t, 9, 0); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(1, 296, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 == 6);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 296, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 296, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":297
 *     assert parse_isoweek(t, 7, 0) == -1  # type: ignore
 *     assert parse_isoweekday(t, 9, 0) == 6  # type: ignore
 *     assert parse_isoweekday(t, 8, 0) == -1  # type: ignore             # <<<<<<<<<<<<<<
 *     assert parse_isoweekday(t, 10, 0) == -1  # type: ignore
 *     assert parse_isoweekday(t, 1, 0) == -1  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_7 = __pyx_f_7cytimes_5utils_parse_isoweekday(__pyx_v_t, 8, 0); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(1, 297, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 == -1L);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 297, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 297, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":298
 *     assert parse_isoweekday(t, 9, 0) == 6  # type: ignore
 *     assert parse_isoweekday(t, 8, 0) == -1  # type: ignore
 *     assert parse_isoweekday(t, 10, 0) == -1  # type: ignore             # <<<<<<<<<<<<<<
 *     assert parse_isoweekday(t, 1, 0) == -1  # type: ignore
 *     assert parse_isoweekday(t, 0, 0) == 2  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_7 = __pyx_f_7cytimes_5utils_parse_isoweekday(__pyx_v_t, 10, 0); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(1, 298, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 == -1L);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 298, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 298, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":299
 *     assert parse_isoweekday(t, 8, 0) == -1  # type: ignore
 *     assert parse_isoweekday(t, 10, 0) == -1  # type: ignore
 *     assert parse_isoweekday(t, 1, 0) == -1  # type: ignore             # <<<<<<<<<<<<<<
 *     assert parse_isoweekday(t, 0, 0) == 2  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_7 = __pyx_f_7cytimes_5utils_parse_isoweekday(__pyx_v_t, 1, 0); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(1, 299, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 == -1L);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 299, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 299, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":300
 *     assert parse_isoweekday(t, 10, 0) == -1  # type: ignore
 *     assert parse_isoweekday(t, 1, 0) == -1  # type: ignore
 *     assert parse_isoweekday(t, 0, 0) == 2  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     t = "2021-365"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_7 = __pyx_f_7cytimes_5utils_parse_isoweekday(__pyx_v_t, 0, 0); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(1, 300, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 == 2);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 300, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 300, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":302
 *     assert parse_isoweekday(t, 0, 0) == 2  # type: ignore
 * 
 *     t = "2021-365"             # <<<<<<<<<<<<<<
 *     assert parse_isoyearday(t, 5, 0) == 365  # type: ignore
 *     assert parse_isoyearday(t, 6, 0) == -1  # type: ignore
 */
  __Pyx_INCREF(__pyx_kp_u_2021_365);
  __Pyx_DECREF_SET(__pyx_v_t, __pyx_kp_u_2021_365);

  /* "cytimes/utils.py":303
 * 
 *     t = "2021-365"
 *     assert parse_isoyearday(t, 5, 0) == 365  # type: ignore             # <<<<<<<<<<<<<<
 *     assert parse_isoyearday(t, 6, 0) == -1  # type: ignore
 *     assert parse_isoyearday(t, 4, 0) == -1  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_7 = __pyx_f_7cytimes_5utils_parse_isoyearday(__pyx_v_t, 5, 0); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(1, 303, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 == 0x16D);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 303, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 303, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":304
 *     t = "2021-365"
 *     assert parse_isoyearday(t, 5, 0) == 365  # type: ignore
 *     assert parse_isoyearday(t, 6, 0) == -1  # type: ignore             # <<<<<<<<<<<<<<
 *     assert parse_isoyearday(t, 4, 0) == -1  # type: ignore
 *     t = "2021-367"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_7 = __pyx_f_7cytimes_5utils_parse_isoyearday(__pyx_v_t, 6, 0); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(1, 304, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 == -1L);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 304, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 304, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":305
 *     assert parse_isoyearday(t, 5, 0) == 365  # type: ignore
 *     assert parse_isoyearday(t, 6, 0) == -1  # type: ignore
 *     assert parse_isoyearday(t, 4, 0) == -1  # type: ignore             # <<<<<<<<<<<<<<
 *     t = "2021-367"
 *     assert parse_isoyearday(t, 5, 0) == -1  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_7 = __pyx_f_7cytimes_5utils_parse_isoyearday(__pyx_v_t, 4, 0); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(1, 305, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 == -1L);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 305, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 305, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":306
 *     assert parse_isoyearday(t, 6, 0) == -1  # type: ignore
 *     assert parse_isoyearday(t, 4, 0) == -1  # type: ignore
 *     t = "2021-367"             # <<<<<<<<<<<<<<
 *     assert parse_isoyearday(t, 5, 0) == -1  # type: ignore
 *     t = "2021-000"
 */
  __Pyx_INCREF(__pyx_kp_u_2021_367);
  __Pyx_DECREF_SET(__pyx_v_t, __pyx_kp_u_2021_367);

  /* "cytimes/utils.py":307
 *     assert parse_isoyearday(t, 4, 0) == -1  # type: ignore
 *     t = "2021-367"
 *     assert parse_isoyearday(t, 5, 0) == -1  # type: ignore             # <<<<<<<<<<<<<<
 *     t = "2021-000"
 *     assert parse_isoyearday(t, 5, 0) == -1  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_7 = __pyx_f_7cytimes_5utils_parse_isoyearday(__pyx_v_t, 5, 0); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(1, 307, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 == -1L);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 307, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 307, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":308
 *     t = "2021-367"
 *     assert parse_isoyearday(t, 5, 0) == -1  # type: ignore
 *     t = "2021-000"             # <<<<<<<<<<<<<<
 *     assert parse_isoyearday(t, 5, 0) == -1  # type: ignore
 * 
 */
  __Pyx_INCREF(__pyx_kp_u_2021_000);
  __Pyx_DECREF_SET(__pyx_v_t, __pyx_kp_u_2021_000);

  /* "cytimes/utils.py":309
 *     assert parse_isoyearday(t, 5, 0) == -1  # type: ignore
 *     t = "2021-000"
 *     assert parse_isoyearday(t, 5, 0) == -1  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: parser")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_7 = __pyx_f_7cytimes_5utils_parse_isoyearday(__pyx_v_t, 5, 0); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(1, 309, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_7 == -1L);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 309, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 309, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":311
 *     assert parse_isoyearday(t, 5, 0) == -1  # type: ignore
 * 
 *     print("Passed: parser")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cytimes/utils.py":254
 * 
 * # Parser
 * def _test_parser() -> None:             # <<<<<<<<<<<<<<
 *     # boolean
 *     assert is_iso_sep("t")  # type: ignore
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cytimes.utils._test_parser", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":315
 * 
 * # Time
 * def _test_localtime_n_gmtime() -> None:             # <<<<<<<<<<<<<<
 *     import time
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_5_test_localtime_n_gmtime(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_5_test_localtime_n_gmtime = {"_test_localtime_n_gmtime", (PyCFunction)__pyx_pw_7cytimes_5utils_5_test_localtime_n_gmtime, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_5_test_localtime_n_gmtime(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_localtime_n_gmtime (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_4_test_localtime_n_gmtime(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_4_test_localtime_n_gmtime(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_time = NULL;
  PyObject *__pyx_v_t = NULL;
  struct tm __pyx_v_val;
  PyObject *__pyx_v_cmp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  double __pyx_t_5;
  struct tm __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_localtime_n_gmtime", 1);

  /* "cytimes/utils.py":316
 * # Time
 * def _test_localtime_n_gmtime() -> None:
 *     import time             # <<<<<<<<<<<<<<
 * 
 *     t = time.time()
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_time, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_time = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":318
 *     import time
 * 
 *     t = time.time()             # <<<<<<<<<<<<<<
 *     val = tm_localtime(t)  # type: ignore
 *     cmp = time.localtime(t)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_time, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_t = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":319
 * 
 *     t = time.time()
 *     val = tm_localtime(t)  # type: ignore             # <<<<<<<<<<<<<<
 *     cmp = time.localtime(t)
 *     assert val.tm_sec == cmp.tm_sec, f"{val.tm_sec} != {cmp.tm_sec}"
 */
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 319, __pyx_L1_error)
  __pyx_t_6 = __pyx_f_7cytimes_5utils_tm_localtime(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 319, __pyx_L1_error)
  __pyx_v_val = __pyx_t_6;

  /* "cytimes/utils.py":320
 *     t = time.time()
 *     val = tm_localtime(t)  # type: ignore
 *     cmp = time.localtime(t)             # <<<<<<<<<<<<<<
 *     assert val.tm_sec == cmp.tm_sec, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_min == cmp.tm_min, f"{val.tm_sec} != {cmp.tm_sec}"
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_time, __pyx_n_s_localtime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_t};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 320, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_cmp = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":321
 *     val = tm_localtime(t)  # type: ignore
 *     cmp = time.localtime(t)
 *     assert val.tm_sec == cmp.tm_sec, f"{val.tm_sec} != {cmp.tm_sec}"             # <<<<<<<<<<<<<<
 *     assert val.tm_min == cmp.tm_min, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_hour == cmp.tm_hour, f"{val.tm_sec} != {cmp.tm_sec}"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_val.tm_sec); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 321, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 321, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_7)) {
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 321, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_val.tm_sec, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 321, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_INCREF(__pyx_kp_u__38);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__38);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__38);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 321, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 321, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 321, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 321, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 321, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":322
 *     cmp = time.localtime(t)
 *     assert val.tm_sec == cmp.tm_sec, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_min == cmp.tm_min, f"{val.tm_sec} != {cmp.tm_sec}"             # <<<<<<<<<<<<<<
 *     assert val.tm_hour == cmp.tm_hour, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_mday == cmp.tm_mday, f"{val.tm_sec} != {cmp.tm_sec}"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_val.tm_min); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 322, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 322, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) {
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_val.tm_sec, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__38);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__38);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u__38);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 322, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 322, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":323
 *     assert val.tm_sec == cmp.tm_sec, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_min == cmp.tm_min, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_hour == cmp.tm_hour, f"{val.tm_sec} != {cmp.tm_sec}"             # <<<<<<<<<<<<<<
 *     assert val.tm_mday == cmp.tm_mday, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_mon == cmp.tm_mon, f"{val.tm_sec} != {cmp.tm_sec}"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_val.tm_hour); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_hour); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 323, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 323, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_7)) {
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_val.tm_sec, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_INCREF(__pyx_kp_u__38);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__38);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__38);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 323, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 323, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":324
 *     assert val.tm_min == cmp.tm_min, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_hour == cmp.tm_hour, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_mday == cmp.tm_mday, f"{val.tm_sec} != {cmp.tm_sec}"             # <<<<<<<<<<<<<<
 *     assert val.tm_mon == cmp.tm_mon, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_year == cmp.tm_year, f"{val.tm_sec} != {cmp.tm_sec}"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_val.tm_mday); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_mday); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 324, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 324, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) {
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_val.tm_sec, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__38);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__38);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u__38);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 324, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 324, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":325
 *     assert val.tm_hour == cmp.tm_hour, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_mday == cmp.tm_mday, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_mon == cmp.tm_mon, f"{val.tm_sec} != {cmp.tm_sec}"             # <<<<<<<<<<<<<<
 *     assert val.tm_year == cmp.tm_year, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_wday == cmp.tm_wday, f"{val.tm_sec} != {cmp.tm_sec}"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_val.tm_mon); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_mon); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 325, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_7)) {
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_val.tm_sec, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_INCREF(__pyx_kp_u__38);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__38);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__38);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 325, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 325, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":326
 *     assert val.tm_mday == cmp.tm_mday, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_mon == cmp.tm_mon, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_year == cmp.tm_year, f"{val.tm_sec} != {cmp.tm_sec}"             # <<<<<<<<<<<<<<
 *     assert val.tm_wday == cmp.tm_wday, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_yday == cmp.tm_yday, f"{val.tm_sec} != {cmp.tm_sec}"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_val.tm_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_year); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 326, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 326, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) {
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_val.tm_sec, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__38);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__38);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u__38);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 326, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 326, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":327
 *     assert val.tm_mon == cmp.tm_mon, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_year == cmp.tm_year, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_wday == cmp.tm_wday, f"{val.tm_sec} != {cmp.tm_sec}"             # <<<<<<<<<<<<<<
 *     assert val.tm_yday == cmp.tm_yday, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_isdst == cmp.tm_isdst, f"{val.tm_sec} != {cmp.tm_sec}"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_val.tm_wday); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_wday); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 327, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 327, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_7)) {
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 327, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_val.tm_sec, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 327, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_INCREF(__pyx_kp_u__38);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__38);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__38);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 327, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 327, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 327, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 327, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 327, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":328
 *     assert val.tm_year == cmp.tm_year, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_wday == cmp.tm_wday, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_yday == cmp.tm_yday, f"{val.tm_sec} != {cmp.tm_sec}"             # <<<<<<<<<<<<<<
 *     assert val.tm_isdst == cmp.tm_isdst, f"{val.tm_sec} != {cmp.tm_sec}"
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_val.tm_yday); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_yday); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 328, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 328, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) {
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_val.tm_sec, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__38);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__38);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u__38);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 328, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 328, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":329
 *     assert val.tm_wday == cmp.tm_wday, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_yday == cmp.tm_yday, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_isdst == cmp.tm_isdst, f"{val.tm_sec} != {cmp.tm_sec}"             # <<<<<<<<<<<<<<
 * 
 *     val = tm_gmtime(t)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_val.tm_isdst); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_isdst); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 329, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 329, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_7)) {
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_val.tm_sec, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_INCREF(__pyx_kp_u__38);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__38);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__38);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 329, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 329, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":331
 *     assert val.tm_isdst == cmp.tm_isdst, f"{val.tm_sec} != {cmp.tm_sec}"
 * 
 *     val = tm_gmtime(t)  # type: ignore             # <<<<<<<<<<<<<<
 *     cmp = time.gmtime(t)
 *     assert val.tm_sec == cmp.tm_sec, f"{val.tm_sec} != {cmp.tm_sec}"
 */
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 331, __pyx_L1_error)
  __pyx_t_6 = __pyx_f_7cytimes_5utils_tm_gmtime(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 331, __pyx_L1_error)
  __pyx_v_val = __pyx_t_6;

  /* "cytimes/utils.py":332
 * 
 *     val = tm_gmtime(t)  # type: ignore
 *     cmp = time.gmtime(t)             # <<<<<<<<<<<<<<
 *     assert val.tm_sec == cmp.tm_sec, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_min == cmp.tm_min, f"{val.tm_sec} != {cmp.tm_sec}"
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_time, __pyx_n_s_gmtime); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_t};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_cmp, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":333
 *     val = tm_gmtime(t)  # type: ignore
 *     cmp = time.gmtime(t)
 *     assert val.tm_sec == cmp.tm_sec, f"{val.tm_sec} != {cmp.tm_sec}"             # <<<<<<<<<<<<<<
 *     assert val.tm_min == cmp.tm_min, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_hour == cmp.tm_hour, f"{val.tm_sec} != {cmp.tm_sec}"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_val.tm_sec); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 333, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 333, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) {
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_val.tm_sec, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__38);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__38);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u__38);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 333, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 333, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":334
 *     cmp = time.gmtime(t)
 *     assert val.tm_sec == cmp.tm_sec, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_min == cmp.tm_min, f"{val.tm_sec} != {cmp.tm_sec}"             # <<<<<<<<<<<<<<
 *     assert val.tm_hour == cmp.tm_hour, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_mday == cmp.tm_mday, f"{val.tm_sec} != {cmp.tm_sec}"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_val.tm_min); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_min); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 334, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 334, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_7)) {
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_val.tm_sec, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_INCREF(__pyx_kp_u__38);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__38);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__38);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 334, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 334, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":335
 *     assert val.tm_sec == cmp.tm_sec, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_min == cmp.tm_min, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_hour == cmp.tm_hour, f"{val.tm_sec} != {cmp.tm_sec}"             # <<<<<<<<<<<<<<
 *     assert val.tm_mday == cmp.tm_mday, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_mon == cmp.tm_mon, f"{val.tm_sec} != {cmp.tm_sec}"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_val.tm_hour); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_hour); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 335, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 335, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) {
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 335, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_val.tm_sec, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 335, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__38);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__38);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u__38);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 335, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 335, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 335, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 335, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 335, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":336
 *     assert val.tm_min == cmp.tm_min, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_hour == cmp.tm_hour, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_mday == cmp.tm_mday, f"{val.tm_sec} != {cmp.tm_sec}"             # <<<<<<<<<<<<<<
 *     assert val.tm_mon == cmp.tm_mon, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_year == cmp.tm_year, f"{val.tm_sec} != {cmp.tm_sec}"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_val.tm_mday); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_mday); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 336, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 336, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_7)) {
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 336, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_val.tm_sec, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 336, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_INCREF(__pyx_kp_u__38);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__38);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__38);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 336, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 336, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 336, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 336, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 336, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":337
 *     assert val.tm_hour == cmp.tm_hour, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_mday == cmp.tm_mday, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_mon == cmp.tm_mon, f"{val.tm_sec} != {cmp.tm_sec}"             # <<<<<<<<<<<<<<
 *     assert val.tm_year == cmp.tm_year, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_wday == cmp.tm_wday, f"{val.tm_sec} != {cmp.tm_sec}"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_val.tm_mon); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_mon); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 337, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 337, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) {
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_val.tm_sec, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__38);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__38);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u__38);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 337, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 337, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":338
 *     assert val.tm_mday == cmp.tm_mday, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_mon == cmp.tm_mon, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_year == cmp.tm_year, f"{val.tm_sec} != {cmp.tm_sec}"             # <<<<<<<<<<<<<<
 *     assert val.tm_wday == cmp.tm_wday, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_yday == cmp.tm_yday, f"{val.tm_sec} != {cmp.tm_sec}"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_val.tm_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_year); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 338, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 338, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_7)) {
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_val.tm_sec, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_INCREF(__pyx_kp_u__38);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__38);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__38);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 338, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 338, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":339
 *     assert val.tm_mon == cmp.tm_mon, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_year == cmp.tm_year, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_wday == cmp.tm_wday, f"{val.tm_sec} != {cmp.tm_sec}"             # <<<<<<<<<<<<<<
 *     assert val.tm_yday == cmp.tm_yday, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_isdst == cmp.tm_isdst, f"{val.tm_sec} != {cmp.tm_sec}"
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_val.tm_wday); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 339, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_wday); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 339, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 339, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 339, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) {
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 339, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_val.tm_sec, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 339, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__38);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__38);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u__38);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 339, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 339, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 339, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 339, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 339, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":340
 *     assert val.tm_year == cmp.tm_year, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_wday == cmp.tm_wday, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_yday == cmp.tm_yday, f"{val.tm_sec} != {cmp.tm_sec}"             # <<<<<<<<<<<<<<
 *     assert val.tm_isdst == cmp.tm_isdst, f"{val.tm_sec} != {cmp.tm_sec}"
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_val.tm_yday); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_yday); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 340, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 340, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_7)) {
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_val.tm_sec, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_INCREF(__pyx_kp_u__38);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__38);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__38);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 340, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 340, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":341
 *     assert val.tm_wday == cmp.tm_wday, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_yday == cmp.tm_yday, f"{val.tm_sec} != {cmp.tm_sec}"
 *     assert val.tm_isdst == cmp.tm_isdst, f"{val.tm_sec} != {cmp.tm_sec}"             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: localtime & gmtime")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_val.tm_isdst); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_isdst); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 341, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 341, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) {
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_val.tm_sec, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__38);
      __pyx_t_8 += 4;
      __Pyx_GIVEREF(__pyx_kp_u__38);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u__38);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 341, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 341, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":343
 *     assert val.tm_isdst == cmp.tm_isdst, f"{val.tm_sec} != {cmp.tm_sec}"
 * 
 *     print("Passed: localtime & gmtime")             # <<<<<<<<<<<<<<
 * 
 *     del time
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":345
 *     print("Passed: localtime & gmtime")
 * 
 *     del time             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_time); __pyx_v_time = 0;

  /* "cytimes/utils.py":315
 * 
 * # Time
 * def _test_localtime_n_gmtime() -> None:             # <<<<<<<<<<<<<<
 *     import time
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils._test_localtime_n_gmtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XDECREF(__pyx_v_cmp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":349
 * 
 * # Calendar
 * def _test_is_leap_year() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _is_leap  # type: ignore
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_7_test_is_leap_year(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_7_test_is_leap_year = {"_test_is_leap_year", (PyCFunction)__pyx_pw_7cytimes_5utils_7_test_is_leap_year, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_7_test_is_leap_year(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_is_leap_year (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_6_test_is_leap_year(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_6_test_is_leap_year(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v__is_leap = NULL;
  long __pyx_v_i;
  int __pyx_v_val;
  PyObject *__pyx_v_cmp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_is_leap_year", 1);

  /* "cytimes/utils.py":350
 * # Calendar
 * def _test_is_leap_year() -> None:
 *     from _pydatetime import _is_leap  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     for i in range(1, 10000):
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_is_leap);
  __Pyx_GIVEREF(__pyx_n_s_is_leap);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_is_leap)) __PYX_ERR(1, 350, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pydatetime, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_is_leap); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v__is_leap = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":352
 *     from _pydatetime import _is_leap  # type: ignore
 * 
 *     for i in range(1, 10000):             # <<<<<<<<<<<<<<
 *         val = is_leap_year(i)  # type: ignore
 *         cmp = _is_leap(i)
 */
  for (__pyx_t_3 = 1; __pyx_t_3 < 0x2710; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "cytimes/utils.py":353
 * 
 *     for i in range(1, 10000):
 *         val = is_leap_year(i)  # type: ignore             # <<<<<<<<<<<<<<
 *         cmp = _is_leap(i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 */
    __pyx_t_4 = __pyx_f_7cytimes_5utils_is_leap_year(__pyx_v_i); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 353, __pyx_L1_error)
    __pyx_v_val = __pyx_t_4;

    /* "cytimes/utils.py":354
 *     for i in range(1, 10000):
 *         val = is_leap_year(i)  # type: ignore
 *         cmp = _is_leap(i)             # <<<<<<<<<<<<<<
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     print("Passed: is_leap_year")
 */
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__is_leap);
    __pyx_t_5 = __pyx_v__is_leap; __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_1};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 354, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_cmp, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/utils.py":355
 *         val = is_leap_year(i)  # type: ignore
 *         cmp = _is_leap(i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"             # <<<<<<<<<<<<<<
 *     print("Passed: is_leap_year")
 * 
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 355, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_v_cmp, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 355, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 355, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) {
        __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 355, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = 0;
        __pyx_t_9 = 127;
        __pyx_t_2 = __Pyx_PyUnicode_From_long(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 355, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 += __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__40);
        __pyx_t_8 += 2;
        __Pyx_GIVEREF(__pyx_kp_u__40);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_u__40);
        __pyx_t_2 = __Pyx_PyUnicode_FromBInt_bint(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 355, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 += __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__38);
        __pyx_t_8 += 4;
        __Pyx_GIVEREF(__pyx_kp_u__38);
        PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_kp_u__38);
        __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_cmp, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 355, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_9;
        __pyx_t_8 += __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_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 355, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(1, 355, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 355, __pyx_L1_error)
    #endif
  }

  /* "cytimes/utils.py":356
 *         cmp = _is_leap(i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     print("Passed: is_leap_year")             # <<<<<<<<<<<<<<
 * 
 *     del _is_leap
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":358
 *     print("Passed: is_leap_year")
 * 
 *     del _is_leap             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v__is_leap); __pyx_v__is_leap = 0;

  /* "cytimes/utils.py":349
 * 
 * # Calendar
 * def _test_is_leap_year() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _is_leap  # type: ignore
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytimes.utils._test_is_leap_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__is_leap);
  __Pyx_XDECREF(__pyx_v_cmp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":361
 * 
 * 
 * def _test_days_bf_year() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _days_before_year  # type: ignore
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_9_test_days_bf_year(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_9_test_days_bf_year = {"_test_days_bf_year", (PyCFunction)__pyx_pw_7cytimes_5utils_9_test_days_bf_year, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_9_test_days_bf_year(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_days_bf_year (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_8_test_days_bf_year(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_8_test_days_bf_year(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v__days_before_year = NULL;
  long __pyx_v_i;
  int __pyx_v_val;
  PyObject *__pyx_v_cmp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_UCS4 __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_days_bf_year", 1);

  /* "cytimes/utils.py":362
 * 
 * def _test_days_bf_year() -> None:
 *     from _pydatetime import _days_before_year  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     for i in range(1, 10000):
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_days_before_year);
  __Pyx_GIVEREF(__pyx_n_s_days_before_year);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_days_before_year)) __PYX_ERR(1, 362, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pydatetime, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_days_before_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v__days_before_year = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":364
 *     from _pydatetime import _days_before_year  # type: ignore
 * 
 *     for i in range(1, 10000):             # <<<<<<<<<<<<<<
 *         val = days_bf_year(i)  # type: ignore
 *         cmp = _days_before_year(i)
 */
  for (__pyx_t_3 = 1; __pyx_t_3 < 0x2710; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "cytimes/utils.py":365
 * 
 *     for i in range(1, 10000):
 *         val = days_bf_year(i)  # type: ignore             # <<<<<<<<<<<<<<
 *         cmp = _days_before_year(i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 */
    __pyx_t_4 = __pyx_f_7cytimes_5utils_days_bf_year(__pyx_v_i); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 365, __pyx_L1_error)
    __pyx_v_val = __pyx_t_4;

    /* "cytimes/utils.py":366
 *     for i in range(1, 10000):
 *         val = days_bf_year(i)  # type: ignore
 *         cmp = _days_before_year(i)             # <<<<<<<<<<<<<<
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     print("Passed: days_bf_year")
 */
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__days_before_year);
    __pyx_t_5 = __pyx_v__days_before_year; __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_1};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 366, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_cmp, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/utils.py":367
 *         val = days_bf_year(i)  # type: ignore
 *         cmp = _days_before_year(i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"             # <<<<<<<<<<<<<<
 *     print("Passed: days_bf_year")
 * 
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 367, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_v_cmp, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 367, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 367, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_8)) {
        __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 367, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_9 = 0;
        __pyx_t_10 = 127;
        __pyx_t_2 = __Pyx_PyUnicode_From_long(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 367, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_9 += __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__40);
        __pyx_t_9 += 2;
        __Pyx_GIVEREF(__pyx_kp_u__40);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_u__40);
        __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_val, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 367, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_9 += __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__38);
        __pyx_t_9 += 4;
        __Pyx_GIVEREF(__pyx_kp_u__38);
        PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_kp_u__38);
        __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_cmp, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 367, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_10;
        __pyx_t_9 += __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_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 367, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(1, 367, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 367, __pyx_L1_error)
    #endif
  }

  /* "cytimes/utils.py":368
 *         cmp = _days_before_year(i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     print("Passed: days_bf_year")             # <<<<<<<<<<<<<<
 * 
 *     del _days_before_year
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":370
 *     print("Passed: days_bf_year")
 * 
 *     del _days_before_year             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v__days_before_year); __pyx_v__days_before_year = 0;

  /* "cytimes/utils.py":361
 * 
 * 
 * def _test_days_bf_year() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _days_before_year  # type: ignore
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytimes.utils._test_days_bf_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__days_before_year);
  __Pyx_XDECREF(__pyx_v_cmp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":373
 * 
 * 
 * def _test_quarter_of_month() -> None:             # <<<<<<<<<<<<<<
 *     count: cython.int = 0
 *     value: cython.int = 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_11_test_quarter_of_month(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_11_test_quarter_of_month = {"_test_quarter_of_month", (PyCFunction)__pyx_pw_7cytimes_5utils_11_test_quarter_of_month, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_11_test_quarter_of_month(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_quarter_of_month (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_10_test_quarter_of_month(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_10_test_quarter_of_month(CYTHON_UNUSED PyObject *__pyx_self) {
  int __pyx_v_count;
  int __pyx_v_value;
  long __pyx_v_i;
  int __pyx_v_val;
  int __pyx_v_cmp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_quarter_of_month", 1);

  /* "cytimes/utils.py":374
 * 
 * def _test_quarter_of_month() -> None:
 *     count: cython.int = 0             # <<<<<<<<<<<<<<
 *     value: cython.int = 1
 *     for i in range(1, 13):
 */
  __pyx_v_count = 0;

  /* "cytimes/utils.py":375
 * def _test_quarter_of_month() -> None:
 *     count: cython.int = 0
 *     value: cython.int = 1             # <<<<<<<<<<<<<<
 *     for i in range(1, 13):
 *         val = quarter_of_month(i)  # type: ignore
 */
  __pyx_v_value = 1;

  /* "cytimes/utils.py":376
 *     count: cython.int = 0
 *     value: cython.int = 1
 *     for i in range(1, 13):             # <<<<<<<<<<<<<<
 *         val = quarter_of_month(i)  # type: ignore
 *         cmp = value
 */
  for (__pyx_t_1 = 1; __pyx_t_1 < 13; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "cytimes/utils.py":377
 *     value: cython.int = 1
 *     for i in range(1, 13):
 *         val = quarter_of_month(i)  # type: ignore             # <<<<<<<<<<<<<<
 *         cmp = value
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_quarter_of_month(__pyx_v_i); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 377, __pyx_L1_error)
    __pyx_v_val = __pyx_t_2;

    /* "cytimes/utils.py":378
 *     for i in range(1, 13):
 *         val = quarter_of_month(i)  # type: ignore
 *         cmp = value             # <<<<<<<<<<<<<<
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *         count += 1
 */
    __pyx_v_cmp = __pyx_v_value;

    /* "cytimes/utils.py":379
 *         val = quarter_of_month(i)  # type: ignore
 *         cmp = value
 *         assert val == cmp, f"{i}: {val} != {cmp}"             # <<<<<<<<<<<<<<
 *         count += 1
 *         if count == 3:
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_3 = (__pyx_v_val == __pyx_v_cmp);
      if (unlikely(!__pyx_t_3)) {
        __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 379, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = 0;
        __pyx_t_6 = 127;
        __pyx_t_7 = __Pyx_PyUnicode_From_long(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 379, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
        __pyx_t_7 = 0;
        __Pyx_INCREF(__pyx_kp_u__40);
        __pyx_t_5 += 2;
        __Pyx_GIVEREF(__pyx_kp_u__40);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_u__40);
        __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_v_val, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 379, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_7);
        __pyx_t_7 = 0;
        __Pyx_INCREF(__pyx_kp_u__38);
        __pyx_t_5 += 4;
        __Pyx_GIVEREF(__pyx_kp_u__38);
        PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_kp_u__38);
        __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_v_cmp, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 379, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 379, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_7, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(1, 379, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 379, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":380
 *         cmp = value
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *         count += 1             # <<<<<<<<<<<<<<
 *         if count == 3:
 *             count = 0
 */
    __pyx_v_count = (__pyx_v_count + 1);

    /* "cytimes/utils.py":381
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *         count += 1
 *         if count == 3:             # <<<<<<<<<<<<<<
 *             count = 0
 *             value += 1
 */
    __pyx_t_3 = (__pyx_v_count == 3);
    if (__pyx_t_3) {

      /* "cytimes/utils.py":382
 *         count += 1
 *         if count == 3:
 *             count = 0             # <<<<<<<<<<<<<<
 *             value += 1
 *     print("Passed: quarter_of_month")
 */
      __pyx_v_count = 0;

      /* "cytimes/utils.py":383
 *         if count == 3:
 *             count = 0
 *             value += 1             # <<<<<<<<<<<<<<
 *     print("Passed: quarter_of_month")
 * 
 */
      __pyx_v_value = (__pyx_v_value + 1);

      /* "cytimes/utils.py":381
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *         count += 1
 *         if count == 3:             # <<<<<<<<<<<<<<
 *             count = 0
 *             value += 1
 */
    }
  }

  /* "cytimes/utils.py":384
 *             count = 0
 *             value += 1
 *     print("Passed: quarter_of_month")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/utils.py":373
 * 
 * 
 * def _test_quarter_of_month() -> None:             # <<<<<<<<<<<<<<
 *     count: cython.int = 0
 *     value: cython.int = 1
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.utils._test_quarter_of_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":387
 * 
 * 
 * def _test_days_in_quarter() -> None:             # <<<<<<<<<<<<<<
 *     # non-leap
 *     year: cython.int = 2021
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_13_test_days_in_quarter(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_13_test_days_in_quarter = {"_test_days_in_quarter", (PyCFunction)__pyx_pw_7cytimes_5utils_13_test_days_in_quarter, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_13_test_days_in_quarter(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_days_in_quarter (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_12_test_days_in_quarter(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_12_test_days_in_quarter(CYTHON_UNUSED PyObject *__pyx_self) {
  int __pyx_v_year;
  long __pyx_v_i;
  int __pyx_v_qtr;
  int __pyx_v_val;
  long __pyx_v_cmp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_days_in_quarter", 1);

  /* "cytimes/utils.py":389
 * def _test_days_in_quarter() -> None:
 *     # non-leap
 *     year: cython.int = 2021             # <<<<<<<<<<<<<<
 *     for i in range(1, 13):
 *         qtr: cython.int = quarter_of_month(i)  # type: ignore
 */
  __pyx_v_year = 0x7E5;

  /* "cytimes/utils.py":390
 *     # non-leap
 *     year: cython.int = 2021
 *     for i in range(1, 13):             # <<<<<<<<<<<<<<
 *         qtr: cython.int = quarter_of_month(i)  # type: ignore
 *         val = days_in_quarter(year, i)  # type: ignore
 */
  for (__pyx_t_1 = 1; __pyx_t_1 < 13; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "cytimes/utils.py":391
 *     year: cython.int = 2021
 *     for i in range(1, 13):
 *         qtr: cython.int = quarter_of_month(i)  # type: ignore             # <<<<<<<<<<<<<<
 *         val = days_in_quarter(year, i)  # type: ignore
 *         cmp = DAYS_IN_QUARTER[qtr]
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_quarter_of_month(__pyx_v_i); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 391, __pyx_L1_error)
    __pyx_v_qtr = __pyx_t_2;

    /* "cytimes/utils.py":392
 *     for i in range(1, 13):
 *         qtr: cython.int = quarter_of_month(i)  # type: ignore
 *         val = days_in_quarter(year, i)  # type: ignore             # <<<<<<<<<<<<<<
 *         cmp = DAYS_IN_QUARTER[qtr]
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_days_in_quarter(__pyx_v_year, __pyx_v_i); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 392, __pyx_L1_error)
    __pyx_v_val = __pyx_t_2;

    /* "cytimes/utils.py":393
 *         qtr: cython.int = quarter_of_month(i)  # type: ignore
 *         val = days_in_quarter(year, i)  # type: ignore
 *         cmp = DAYS_IN_QUARTER[qtr]             # <<<<<<<<<<<<<<
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     # leap
 */
    __pyx_v_cmp = (__pyx_v_7cytimes_5utils_DAYS_IN_QUARTER[__pyx_v_qtr]);

    /* "cytimes/utils.py":394
 *         val = days_in_quarter(year, i)  # type: ignore
 *         cmp = DAYS_IN_QUARTER[qtr]
 *         assert val == cmp, f"{i}: {val} != {cmp}"             # <<<<<<<<<<<<<<
 *     # leap
 *     year = 2024
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_3 = (__pyx_v_val == __pyx_v_cmp);
      if (unlikely(!__pyx_t_3)) {
        __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 394, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = 0;
        __pyx_t_6 = 127;
        __pyx_t_7 = __Pyx_PyUnicode_From_long(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 394, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
        __pyx_t_7 = 0;
        __Pyx_INCREF(__pyx_kp_u__40);
        __pyx_t_5 += 2;
        __Pyx_GIVEREF(__pyx_kp_u__40);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_u__40);
        __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_v_val, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 394, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_7);
        __pyx_t_7 = 0;
        __Pyx_INCREF(__pyx_kp_u__38);
        __pyx_t_5 += 4;
        __Pyx_GIVEREF(__pyx_kp_u__38);
        PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_kp_u__38);
        __pyx_t_7 = __Pyx_PyUnicode_From_long(__pyx_v_cmp, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 394, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 394, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_7, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(1, 394, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 394, __pyx_L1_error)
    #endif
  }

  /* "cytimes/utils.py":396
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     # leap
 *     year = 2024             # <<<<<<<<<<<<<<
 *     for i in range(1, 13):
 *         qtr: cython.int = quarter_of_month(i)  # type: ignore
 */
  __pyx_v_year = 0x7E8;

  /* "cytimes/utils.py":397
 *     # leap
 *     year = 2024
 *     for i in range(1, 13):             # <<<<<<<<<<<<<<
 *         qtr: cython.int = quarter_of_month(i)  # type: ignore
 *         val = days_in_quarter(year, i)  # type: ignore
 */
  for (__pyx_t_1 = 1; __pyx_t_1 < 13; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "cytimes/utils.py":398
 *     year = 2024
 *     for i in range(1, 13):
 *         qtr: cython.int = quarter_of_month(i)  # type: ignore             # <<<<<<<<<<<<<<
 *         val = days_in_quarter(year, i)  # type: ignore
 *         if qtr == 1:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_quarter_of_month(__pyx_v_i); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 398, __pyx_L1_error)
    __pyx_v_qtr = __pyx_t_2;

    /* "cytimes/utils.py":399
 *     for i in range(1, 13):
 *         qtr: cython.int = quarter_of_month(i)  # type: ignore
 *         val = days_in_quarter(year, i)  # type: ignore             # <<<<<<<<<<<<<<
 *         if qtr == 1:
 *             cmp = DAYS_IN_QUARTER[qtr] + 1
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_days_in_quarter(__pyx_v_year, __pyx_v_i); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 399, __pyx_L1_error)
    __pyx_v_val = __pyx_t_2;

    /* "cytimes/utils.py":400
 *         qtr: cython.int = quarter_of_month(i)  # type: ignore
 *         val = days_in_quarter(year, i)  # type: ignore
 *         if qtr == 1:             # <<<<<<<<<<<<<<
 *             cmp = DAYS_IN_QUARTER[qtr] + 1
 *         else:
 */
    __pyx_t_3 = (__pyx_v_qtr == 1);
    if (__pyx_t_3) {

      /* "cytimes/utils.py":401
 *         val = days_in_quarter(year, i)  # type: ignore
 *         if qtr == 1:
 *             cmp = DAYS_IN_QUARTER[qtr] + 1             # <<<<<<<<<<<<<<
 *         else:
 *             cmp = DAYS_IN_QUARTER[qtr]
 */
      __pyx_v_cmp = ((__pyx_v_7cytimes_5utils_DAYS_IN_QUARTER[__pyx_v_qtr]) + 1);

      /* "cytimes/utils.py":400
 *         qtr: cython.int = quarter_of_month(i)  # type: ignore
 *         val = days_in_quarter(year, i)  # type: ignore
 *         if qtr == 1:             # <<<<<<<<<<<<<<
 *             cmp = DAYS_IN_QUARTER[qtr] + 1
 *         else:
 */
      goto __pyx_L7;
    }

    /* "cytimes/utils.py":403
 *             cmp = DAYS_IN_QUARTER[qtr] + 1
 *         else:
 *             cmp = DAYS_IN_QUARTER[qtr]             # <<<<<<<<<<<<<<
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     print("Passed: days_in_quarter")
 */
    /*else*/ {
      __pyx_v_cmp = (__pyx_v_7cytimes_5utils_DAYS_IN_QUARTER[__pyx_v_qtr]);
    }
    __pyx_L7:;

    /* "cytimes/utils.py":404
 *         else:
 *             cmp = DAYS_IN_QUARTER[qtr]
 *         assert val == cmp, f"{i}: {val} != {cmp}"             # <<<<<<<<<<<<<<
 *     print("Passed: days_in_quarter")
 * 
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_3 = (__pyx_v_val == __pyx_v_cmp);
      if (unlikely(!__pyx_t_3)) {
        __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 404, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 = 0;
        __pyx_t_6 = 127;
        __pyx_t_4 = __Pyx_PyUnicode_From_long(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 404, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
        __pyx_t_4 = 0;
        __Pyx_INCREF(__pyx_kp_u__40);
        __pyx_t_5 += 2;
        __Pyx_GIVEREF(__pyx_kp_u__40);
        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_kp_u__40);
        __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_val, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 404, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4);
        __pyx_t_4 = 0;
        __Pyx_INCREF(__pyx_kp_u__38);
        __pyx_t_5 += 4;
        __Pyx_GIVEREF(__pyx_kp_u__38);
        PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_kp_u__38);
        __pyx_t_4 = __Pyx_PyUnicode_From_long(__pyx_v_cmp, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 404, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 404, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_4, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(1, 404, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 404, __pyx_L1_error)
    #endif
  }

  /* "cytimes/utils.py":405
 *             cmp = DAYS_IN_QUARTER[qtr]
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     print("Passed: days_in_quarter")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":387
 * 
 * 
 * def _test_days_in_quarter() -> None:             # <<<<<<<<<<<<<<
 *     # non-leap
 *     year: cython.int = 2021
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.utils._test_days_in_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":408
 * 
 * 
 * def _test_days_in_month() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _days_in_month  # type: ignore
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_15_test_days_in_month(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_15_test_days_in_month = {"_test_days_in_month", (PyCFunction)__pyx_pw_7cytimes_5utils_15_test_days_in_month, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_15_test_days_in_month(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_days_in_month (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_14_test_days_in_month(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_14_test_days_in_month(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v__days_in_month = NULL;
  int __pyx_v_year;
  long __pyx_v_i;
  int __pyx_v_val;
  PyObject *__pyx_v_cmp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_UCS4 __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_days_in_month", 1);

  /* "cytimes/utils.py":409
 * 
 * def _test_days_in_month() -> None:
 *     from _pydatetime import _days_in_month  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     # non-leap
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_days_in_month);
  __Pyx_GIVEREF(__pyx_n_s_days_in_month);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_days_in_month)) __PYX_ERR(1, 409, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pydatetime, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_days_in_month); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v__days_in_month = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":412
 * 
 *     # non-leap
 *     year: cython.int = 2021             # <<<<<<<<<<<<<<
 *     for i in range(1, 13):
 *         val = days_in_month(year, i)  # type: ignore
 */
  __pyx_v_year = 0x7E5;

  /* "cytimes/utils.py":413
 *     # non-leap
 *     year: cython.int = 2021
 *     for i in range(1, 13):             # <<<<<<<<<<<<<<
 *         val = days_in_month(year, i)  # type: ignore
 *         cmp = _days_in_month(year, i)
 */
  for (__pyx_t_3 = 1; __pyx_t_3 < 13; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "cytimes/utils.py":414
 *     year: cython.int = 2021
 *     for i in range(1, 13):
 *         val = days_in_month(year, i)  # type: ignore             # <<<<<<<<<<<<<<
 *         cmp = _days_in_month(year, i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 */
    __pyx_t_4 = __pyx_f_7cytimes_5utils_days_in_month(__pyx_v_year, __pyx_v_i); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 414, __pyx_L1_error)
    __pyx_v_val = __pyx_t_4;

    /* "cytimes/utils.py":415
 *     for i in range(1, 13):
 *         val = days_in_month(year, i)  # type: ignore
 *         cmp = _days_in_month(year, i)             # <<<<<<<<<<<<<<
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     # leap
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v__days_in_month);
    __pyx_t_6 = __pyx_v__days_in_month; __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 415, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_cmp, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/utils.py":416
 *         val = days_in_month(year, i)  # type: ignore
 *         cmp = _days_in_month(year, i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"             # <<<<<<<<<<<<<<
 *     # leap
 *     year = 2024
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 416, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_cmp, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 416, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 416, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_9)) {
        __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 416, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_10 = 0;
        __pyx_t_11 = 127;
        __pyx_t_2 = __Pyx_PyUnicode_From_long(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 416, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_INCREF(__pyx_kp_u__40);
        __pyx_t_10 += 2;
        __Pyx_GIVEREF(__pyx_kp_u__40);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_u__40);
        __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_val, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 416, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_INCREF(__pyx_kp_u__38);
        __pyx_t_10 += 4;
        __Pyx_GIVEREF(__pyx_kp_u__38);
        PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_kp_u__38);
        __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_cmp, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 416, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_11;
        __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_6, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 416, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(1, 416, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 416, __pyx_L1_error)
    #endif
  }

  /* "cytimes/utils.py":418
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     # leap
 *     year = 2024             # <<<<<<<<<<<<<<
 *     for i in range(1, 13):
 *         val = days_in_month(year, i)  # type: ignore
 */
  __pyx_v_year = 0x7E8;

  /* "cytimes/utils.py":419
 *     # leap
 *     year = 2024
 *     for i in range(1, 13):             # <<<<<<<<<<<<<<
 *         val = days_in_month(year, i)  # type: ignore
 *         cmp = _days_in_month(year, i)
 */
  for (__pyx_t_3 = 1; __pyx_t_3 < 13; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "cytimes/utils.py":420
 *     year = 2024
 *     for i in range(1, 13):
 *         val = days_in_month(year, i)  # type: ignore             # <<<<<<<<<<<<<<
 *         cmp = _days_in_month(year, i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 */
    __pyx_t_4 = __pyx_f_7cytimes_5utils_days_in_month(__pyx_v_year, __pyx_v_i); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 420, __pyx_L1_error)
    __pyx_v_val = __pyx_t_4;

    /* "cytimes/utils.py":421
 *     for i in range(1, 13):
 *         val = days_in_month(year, i)  # type: ignore
 *         cmp = _days_in_month(year, i)             # <<<<<<<<<<<<<<
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     print("Passed: days_in_month")
 */
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v__days_in_month);
    __pyx_t_1 = __pyx_v__days_in_month; __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 421, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_cmp, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/utils.py":422
 *         val = days_in_month(year, i)  # type: ignore
 *         cmp = _days_in_month(year, i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"             # <<<<<<<<<<<<<<
 *     print("Passed: days_in_month")
 * 
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_cmp, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 422, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 422, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_9)) {
        __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 422, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_10 = 0;
        __pyx_t_11 = 127;
        __pyx_t_2 = __Pyx_PyUnicode_From_long(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_INCREF(__pyx_kp_u__40);
        __pyx_t_10 += 2;
        __Pyx_GIVEREF(__pyx_kp_u__40);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__40);
        __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_val, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_INCREF(__pyx_kp_u__38);
        __pyx_t_10 += 4;
        __Pyx_GIVEREF(__pyx_kp_u__38);
        PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__38);
        __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_cmp, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_11;
        __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(1, 422, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 422, __pyx_L1_error)
    #endif
  }

  /* "cytimes/utils.py":423
 *         cmp = _days_in_month(year, i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     print("Passed: days_in_month")             # <<<<<<<<<<<<<<
 * 
 *     del _days_in_month
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":425
 *     print("Passed: days_in_month")
 * 
 *     del _days_in_month             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v__days_in_month); __pyx_v__days_in_month = 0;

  /* "cytimes/utils.py":408
 * 
 * 
 * def _test_days_in_month() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _days_in_month  # type: ignore
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.utils._test_days_in_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__days_in_month);
  __Pyx_XDECREF(__pyx_v_cmp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":428
 * 
 * 
 * def _test_days_bf_month() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _days_before_month  # type: ignore
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_17_test_days_bf_month(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_17_test_days_bf_month = {"_test_days_bf_month", (PyCFunction)__pyx_pw_7cytimes_5utils_17_test_days_bf_month, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_17_test_days_bf_month(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_days_bf_month (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_16_test_days_bf_month(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_16_test_days_bf_month(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v__days_before_month = NULL;
  int __pyx_v_year;
  long __pyx_v_i;
  int __pyx_v_val;
  PyObject *__pyx_v_cmp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_UCS4 __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_days_bf_month", 1);

  /* "cytimes/utils.py":429
 * 
 * def _test_days_bf_month() -> None:
 *     from _pydatetime import _days_before_month  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     # non-leap
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_days_before_month);
  __Pyx_GIVEREF(__pyx_n_s_days_before_month);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_days_before_month)) __PYX_ERR(1, 429, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pydatetime, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_days_before_month); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v__days_before_month = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":432
 * 
 *     # non-leap
 *     year: cython.int = 2021             # <<<<<<<<<<<<<<
 *     for i in range(1, 13):
 *         val = days_bf_month(year, i)  # type: ignore
 */
  __pyx_v_year = 0x7E5;

  /* "cytimes/utils.py":433
 *     # non-leap
 *     year: cython.int = 2021
 *     for i in range(1, 13):             # <<<<<<<<<<<<<<
 *         val = days_bf_month(year, i)  # type: ignore
 *         cmp = _days_before_month(year, i)
 */
  for (__pyx_t_3 = 1; __pyx_t_3 < 13; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "cytimes/utils.py":434
 *     year: cython.int = 2021
 *     for i in range(1, 13):
 *         val = days_bf_month(year, i)  # type: ignore             # <<<<<<<<<<<<<<
 *         cmp = _days_before_month(year, i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 */
    __pyx_t_4 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_year, __pyx_v_i); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 434, __pyx_L1_error)
    __pyx_v_val = __pyx_t_4;

    /* "cytimes/utils.py":435
 *     for i in range(1, 13):
 *         val = days_bf_month(year, i)  # type: ignore
 *         cmp = _days_before_month(year, i)             # <<<<<<<<<<<<<<
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     # leap
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v__days_before_month);
    __pyx_t_6 = __pyx_v__days_before_month; __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 435, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_cmp, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/utils.py":436
 *         val = days_bf_month(year, i)  # type: ignore
 *         cmp = _days_before_month(year, i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"             # <<<<<<<<<<<<<<
 *     # leap
 *     year = 2024
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 436, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_cmp, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 436, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 436, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_9)) {
        __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 436, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_10 = 0;
        __pyx_t_11 = 127;
        __pyx_t_2 = __Pyx_PyUnicode_From_long(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 436, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_INCREF(__pyx_kp_u__40);
        __pyx_t_10 += 2;
        __Pyx_GIVEREF(__pyx_kp_u__40);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_u__40);
        __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_val, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 436, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_INCREF(__pyx_kp_u__38);
        __pyx_t_10 += 4;
        __Pyx_GIVEREF(__pyx_kp_u__38);
        PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_kp_u__38);
        __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_cmp, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 436, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_11;
        __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_6, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 436, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(1, 436, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 436, __pyx_L1_error)
    #endif
  }

  /* "cytimes/utils.py":438
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     # leap
 *     year = 2024             # <<<<<<<<<<<<<<
 *     for i in range(1, 13):
 *         val = days_bf_month(year, i)  # type: ignore
 */
  __pyx_v_year = 0x7E8;

  /* "cytimes/utils.py":439
 *     # leap
 *     year = 2024
 *     for i in range(1, 13):             # <<<<<<<<<<<<<<
 *         val = days_bf_month(year, i)  # type: ignore
 *         cmp = _days_before_month(year, i)
 */
  for (__pyx_t_3 = 1; __pyx_t_3 < 13; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "cytimes/utils.py":440
 *     year = 2024
 *     for i in range(1, 13):
 *         val = days_bf_month(year, i)  # type: ignore             # <<<<<<<<<<<<<<
 *         cmp = _days_before_month(year, i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 */
    __pyx_t_4 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_year, __pyx_v_i); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 440, __pyx_L1_error)
    __pyx_v_val = __pyx_t_4;

    /* "cytimes/utils.py":441
 *     for i in range(1, 13):
 *         val = days_bf_month(year, i)  # type: ignore
 *         cmp = _days_before_month(year, i)             # <<<<<<<<<<<<<<
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     print("Passed: days_bf_month")
 */
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v__days_before_month);
    __pyx_t_1 = __pyx_v__days_before_month; __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 441, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_cmp, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/utils.py":442
 *         val = days_bf_month(year, i)  # type: ignore
 *         cmp = _days_before_month(year, i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"             # <<<<<<<<<<<<<<
 *     print("Passed: days_bf_month")
 * 
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 442, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_cmp, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 442, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_9)) {
        __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_10 = 0;
        __pyx_t_11 = 127;
        __pyx_t_2 = __Pyx_PyUnicode_From_long(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 442, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_INCREF(__pyx_kp_u__40);
        __pyx_t_10 += 2;
        __Pyx_GIVEREF(__pyx_kp_u__40);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__40);
        __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_val, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 442, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_INCREF(__pyx_kp_u__38);
        __pyx_t_10 += 4;
        __Pyx_GIVEREF(__pyx_kp_u__38);
        PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__38);
        __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_cmp, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 442, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_11;
        __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 442, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(1, 442, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 442, __pyx_L1_error)
    #endif
  }

  /* "cytimes/utils.py":443
 *         cmp = _days_before_month(year, i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     print("Passed: days_bf_month")             # <<<<<<<<<<<<<<
 * 
 *     del _days_before_month
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":445
 *     print("Passed: days_bf_month")
 * 
 *     del _days_before_month             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v__days_before_month); __pyx_v__days_before_month = 0;

  /* "cytimes/utils.py":428
 * 
 * 
 * def _test_days_bf_month() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _days_before_month  # type: ignore
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.utils._test_days_bf_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__days_before_month);
  __Pyx_XDECREF(__pyx_v_cmp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":448
 * 
 * 
 * def _test_weekday() -> None:             # <<<<<<<<<<<<<<
 *     from datetime import date
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_19_test_weekday(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_19_test_weekday = {"_test_weekday", (PyCFunction)__pyx_pw_7cytimes_5utils_19_test_weekday, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_19_test_weekday(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_weekday (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_18_test_weekday(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_18_test_weekday(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_date = NULL;
  int __pyx_v_year;
  int __pyx_v_month;
  int __pyx_v_day;
  int __pyx_v_val;
  PyObject *__pyx_v_cmp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  unsigned int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_UCS4 __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_weekday", 1);

  /* "cytimes/utils.py":449
 * 
 * def _test_weekday() -> None:
 *     from datetime import date             # <<<<<<<<<<<<<<
 * 
 *     year: cython.int
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_date);
  __Pyx_GIVEREF(__pyx_n_s_date);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_date)) __PYX_ERR(1, 449, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_date = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":454
 *     month: cython.int
 *     day: cython.int
 *     for year in range(1, 10000):             # <<<<<<<<<<<<<<
 *         for month in range(1, 13):
 *             for day in range(1, 32):
 */
  for (__pyx_t_3 = 1; __pyx_t_3 < 0x2710; __pyx_t_3+=1) {
    __pyx_v_year = __pyx_t_3;

    /* "cytimes/utils.py":455
 *     day: cython.int
 *     for year in range(1, 10000):
 *         for month in range(1, 13):             # <<<<<<<<<<<<<<
 *             for day in range(1, 32):
 *                 if day > 28:
 */
    for (__pyx_t_4 = 1; __pyx_t_4 < 13; __pyx_t_4+=1) {
      __pyx_v_month = __pyx_t_4;

      /* "cytimes/utils.py":456
 *     for year in range(1, 10000):
 *         for month in range(1, 13):
 *             for day in range(1, 32):             # <<<<<<<<<<<<<<
 *                 if day > 28:
 *                     day = min(day, days_in_month(year, month))  # type: ignore
 */
      for (__pyx_t_5 = 1; __pyx_t_5 < 32; __pyx_t_5+=1) {
        __pyx_v_day = __pyx_t_5;

        /* "cytimes/utils.py":457
 *         for month in range(1, 13):
 *             for day in range(1, 32):
 *                 if day > 28:             # <<<<<<<<<<<<<<
 *                     day = min(day, days_in_month(year, month))  # type: ignore
 *                 val = ymd_weekday(year, month, day)  # type: ignore
 */
        __pyx_t_6 = (__pyx_v_day > 28);
        if (__pyx_t_6) {

          /* "cytimes/utils.py":458
 *             for day in range(1, 32):
 *                 if day > 28:
 *                     day = min(day, days_in_month(year, month))  # type: ignore             # <<<<<<<<<<<<<<
 *                 val = ymd_weekday(year, month, day)  # type: ignore
 *                 cmp = date(year, month, day).weekday()
 */
          __pyx_t_7 = __pyx_f_7cytimes_5utils_days_in_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 458, __pyx_L1_error)
          __pyx_t_8 = __pyx_v_day;
          __pyx_t_6 = (__pyx_t_7 < __pyx_t_8);
          if (__pyx_t_6) {
            __pyx_t_9 = __pyx_t_7;
          } else {
            __pyx_t_9 = __pyx_t_8;
          }
          __pyx_v_day = __pyx_t_9;

          /* "cytimes/utils.py":457
 *         for month in range(1, 13):
 *             for day in range(1, 32):
 *                 if day > 28:             # <<<<<<<<<<<<<<
 *                     day = min(day, days_in_month(year, month))  # type: ignore
 *                 val = ymd_weekday(year, month, day)  # type: ignore
 */
        }

        /* "cytimes/utils.py":459
 *                 if day > 28:
 *                     day = min(day, days_in_month(year, month))  # type: ignore
 *                 val = ymd_weekday(year, month, day)  # type: ignore             # <<<<<<<<<<<<<<
 *                 cmp = date(year, month, day).weekday()
 *                 assert val == cmp, f"{year}-{month}-{day}: {val} != {cmp}"
 */
        __pyx_t_9 = __pyx_f_7cytimes_5utils_ymd_weekday(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 459, __pyx_L1_error)
        __pyx_v_val = __pyx_t_9;

        /* "cytimes/utils.py":460
 *                     day = min(day, days_in_month(year, month))  # type: ignore
 *                 val = ymd_weekday(year, month, day)  # type: ignore
 *                 cmp = date(year, month, day).weekday()             # <<<<<<<<<<<<<<
 *                 assert val == cmp, f"{year}-{month}-{day}: {val} != {cmp}"
 *     print("Passed: weekday")
 */
        __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 460, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_month); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 460, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 460, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_v_date);
        __pyx_t_13 = __pyx_v_date; __pyx_t_14 = NULL;
        __pyx_t_15 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
            __pyx_t_15 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_14, __pyx_t_10, __pyx_t_11, __pyx_t_12};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_15, 3+__pyx_t_15);
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 460, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_weekday); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 460, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = NULL;
        __pyx_t_15 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
            __pyx_t_15 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_15, 0+__pyx_t_15);
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 460, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
        __Pyx_XDECREF_SET(__pyx_v_cmp, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "cytimes/utils.py":461
 *                 val = ymd_weekday(year, month, day)  # type: ignore
 *                 cmp = date(year, month, day).weekday()
 *                 assert val == cmp, f"{year}-{month}-{day}: {val} != {cmp}"             # <<<<<<<<<<<<<<
 *     print("Passed: weekday")
 * 
 */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {
          __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 461, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_13 = PyObject_RichCompare(__pyx_t_2, __pyx_v_cmp, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 461, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 461, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_6)) {
            __pyx_t_13 = PyTuple_New(9); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 461, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_16 = 0;
            __pyx_t_17 = 127;
            __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_year, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 461, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_16 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2);
            __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_kp_u__9);
            __pyx_t_16 += 1;
            __Pyx_GIVEREF(__pyx_kp_u__9);
            PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_kp_u__9);
            __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_month, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 461, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_16 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_2);
            __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_kp_u__9);
            __pyx_t_16 += 1;
            __Pyx_GIVEREF(__pyx_kp_u__9);
            PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_kp_u__9);
            __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_day, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 461, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_16 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_2);
            __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_kp_u__40);
            __pyx_t_16 += 2;
            __Pyx_GIVEREF(__pyx_kp_u__40);
            PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_kp_u__40);
            __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_val, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 461, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_16 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_2);
            __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_kp_u__38);
            __pyx_t_16 += 4;
            __Pyx_GIVEREF(__pyx_kp_u__38);
            PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_kp_u__38);
            __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_cmp, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 461, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_17 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_17) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_17;
            __pyx_t_16 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_13, 8, __pyx_t_2);
            __pyx_t_2 = 0;
            __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_13, 9, __pyx_t_16, __pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 461, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(1, 461, __pyx_L1_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(1, 461, __pyx_L1_error)
        #endif
      }
    }
  }

  /* "cytimes/utils.py":462
 *                 cmp = date(year, month, day).weekday()
 *                 assert val == cmp, f"{year}-{month}-{day}: {val} != {cmp}"
 *     print("Passed: weekday")             # <<<<<<<<<<<<<<
 * 
 *     del date
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":464
 *     print("Passed: weekday")
 * 
 *     del date             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_date); __pyx_v_date = 0;

  /* "cytimes/utils.py":448
 * 
 * 
 * def _test_weekday() -> None:             # <<<<<<<<<<<<<<
 *     from datetime import date
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("cytimes.utils._test_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_date);
  __Pyx_XDECREF(__pyx_v_cmp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":467
 * 
 * 
 * def _test_isocalendar() -> None:             # <<<<<<<<<<<<<<
 *     from datetime import date
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_21_test_isocalendar(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_21_test_isocalendar = {"_test_isocalendar", (PyCFunction)__pyx_pw_7cytimes_5utils_21_test_isocalendar, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_21_test_isocalendar(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_isocalendar (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_20_test_isocalendar(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_20_test_isocalendar(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_date = NULL;
  int __pyx_v_year;
  int __pyx_v_month;
  int __pyx_v_day;
  __pyx_t_7cytimes_5utils_iso __pyx_v_iso_calr;
  int __pyx_v_iso_week;
  int __pyx_v_iso_year;
  PyObject *__pyx_v_cmp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_7cytimes_5utils_iso __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  unsigned int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_UCS4 __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_isocalendar", 1);

  /* "cytimes/utils.py":468
 * 
 * def _test_isocalendar() -> None:
 *     from datetime import date             # <<<<<<<<<<<<<<
 * 
 *     year: cython.int
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_date);
  __Pyx_GIVEREF(__pyx_n_s_date);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_date)) __PYX_ERR(1, 468, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_date = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":473
 *     month: cython.int
 *     day: cython.int
 *     for year in range(1, 10000):             # <<<<<<<<<<<<<<
 *         for month in range(1, 13):
 *             for day in range(1, 32):
 */
  for (__pyx_t_3 = 1; __pyx_t_3 < 0x2710; __pyx_t_3+=1) {
    __pyx_v_year = __pyx_t_3;

    /* "cytimes/utils.py":474
 *     day: cython.int
 *     for year in range(1, 10000):
 *         for month in range(1, 13):             # <<<<<<<<<<<<<<
 *             for day in range(1, 32):
 *                 if day > 28:
 */
    for (__pyx_t_4 = 1; __pyx_t_4 < 13; __pyx_t_4+=1) {
      __pyx_v_month = __pyx_t_4;

      /* "cytimes/utils.py":475
 *     for year in range(1, 10000):
 *         for month in range(1, 13):
 *             for day in range(1, 32):             # <<<<<<<<<<<<<<
 *                 if day > 28:
 *                     day = min(day, days_in_month(year, month))  # type: ignore
 */
      for (__pyx_t_5 = 1; __pyx_t_5 < 32; __pyx_t_5+=1) {
        __pyx_v_day = __pyx_t_5;

        /* "cytimes/utils.py":476
 *         for month in range(1, 13):
 *             for day in range(1, 32):
 *                 if day > 28:             # <<<<<<<<<<<<<<
 *                     day = min(day, days_in_month(year, month))  # type: ignore
 *                 iso_calr = ymd_isocalendar(year, month, day)  # type: ignore
 */
        __pyx_t_6 = (__pyx_v_day > 28);
        if (__pyx_t_6) {

          /* "cytimes/utils.py":477
 *             for day in range(1, 32):
 *                 if day > 28:
 *                     day = min(day, days_in_month(year, month))  # type: ignore             # <<<<<<<<<<<<<<
 *                 iso_calr = ymd_isocalendar(year, month, day)  # type: ignore
 *                 iso_week = ymd_isoweek(year, month, day)  # type: ignore
 */
          __pyx_t_7 = __pyx_f_7cytimes_5utils_days_in_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 477, __pyx_L1_error)
          __pyx_t_8 = __pyx_v_day;
          __pyx_t_6 = (__pyx_t_7 < __pyx_t_8);
          if (__pyx_t_6) {
            __pyx_t_9 = __pyx_t_7;
          } else {
            __pyx_t_9 = __pyx_t_8;
          }
          __pyx_v_day = __pyx_t_9;

          /* "cytimes/utils.py":476
 *         for month in range(1, 13):
 *             for day in range(1, 32):
 *                 if day > 28:             # <<<<<<<<<<<<<<
 *                     day = min(day, days_in_month(year, month))  # type: ignore
 *                 iso_calr = ymd_isocalendar(year, month, day)  # type: ignore
 */
        }

        /* "cytimes/utils.py":478
 *                 if day > 28:
 *                     day = min(day, days_in_month(year, month))  # type: ignore
 *                 iso_calr = ymd_isocalendar(year, month, day)  # type: ignore             # <<<<<<<<<<<<<<
 *                 iso_week = ymd_isoweek(year, month, day)  # type: ignore
 *                 iso_year = ymd_isoyear(year, month, day)  # type: ignore
 */
        __pyx_t_10 = __pyx_f_7cytimes_5utils_ymd_isocalendar(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 478, __pyx_L1_error)
        __pyx_v_iso_calr = __pyx_t_10;

        /* "cytimes/utils.py":479
 *                     day = min(day, days_in_month(year, month))  # type: ignore
 *                 iso_calr = ymd_isocalendar(year, month, day)  # type: ignore
 *                 iso_week = ymd_isoweek(year, month, day)  # type: ignore             # <<<<<<<<<<<<<<
 *                 iso_year = ymd_isoyear(year, month, day)  # type: ignore
 *                 cmp = date(year, month, day).isocalendar()
 */
        __pyx_t_9 = __pyx_f_7cytimes_5utils_ymd_isoweek(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 479, __pyx_L1_error)
        __pyx_v_iso_week = __pyx_t_9;

        /* "cytimes/utils.py":480
 *                 iso_calr = ymd_isocalendar(year, month, day)  # type: ignore
 *                 iso_week = ymd_isoweek(year, month, day)  # type: ignore
 *                 iso_year = ymd_isoyear(year, month, day)  # type: ignore             # <<<<<<<<<<<<<<
 *                 cmp = date(year, month, day).isocalendar()
 *                 assert (
 */
        __pyx_t_9 = __pyx_f_7cytimes_5utils_ymd_isoyear(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 480, __pyx_L1_error)
        __pyx_v_iso_year = __pyx_t_9;

        /* "cytimes/utils.py":481
 *                 iso_week = ymd_isoweek(year, month, day)  # type: ignore
 *                 iso_year = ymd_isoyear(year, month, day)  # type: ignore
 *                 cmp = date(year, month, day).isocalendar()             # <<<<<<<<<<<<<<
 *                 assert (
 *                     iso_calr.year == cmp.year == iso_year
 */
        __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 481, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_month); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 481, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 481, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_INCREF(__pyx_v_date);
        __pyx_t_14 = __pyx_v_date; __pyx_t_15 = NULL;
        __pyx_t_16 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
          if (likely(__pyx_t_15)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_14, function);
            __pyx_t_16 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_15, __pyx_t_11, __pyx_t_12, __pyx_t_13};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_16, 3+__pyx_t_16);
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 481, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        }
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_isocalendar); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 481, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = NULL;
        __pyx_t_16 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_14, function);
            __pyx_t_16 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_16, 0+__pyx_t_16);
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 481, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        }
        __Pyx_XDECREF_SET(__pyx_v_cmp, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "cytimes/utils.py":482
 *                 iso_year = ymd_isoyear(year, month, day)  # type: ignore
 *                 cmp = date(year, month, day).isocalendar()
 *                 assert (             # <<<<<<<<<<<<<<
 *                     iso_calr.year == cmp.year == iso_year
 *                 ), f"{year}-{month}-{day}: {iso_calr.year} != {cmp.year} != {iso_year}"
 */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {

          /* "cytimes/utils.py":483
 *                 cmp = date(year, month, day).isocalendar()
 *                 assert (
 *                     iso_calr.year == cmp.year == iso_year             # <<<<<<<<<<<<<<
 *                 ), f"{year}-{month}-{day}: {iso_calr.year} != {cmp.year} != {iso_year}"
 *                 assert (
 */
          __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_iso_calr.year); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_year); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 483, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_14, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L1_error)
          if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
            __Pyx_DECREF(__pyx_t_1);
            __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_iso_year); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 483, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_1 = PyObject_RichCompare(__pyx_t_14, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 483, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_6)) {

            /* "cytimes/utils.py":484
 *                 assert (
 *                     iso_calr.year == cmp.year == iso_year
 *                 ), f"{year}-{month}-{day}: {iso_calr.year} != {cmp.year} != {iso_year}"             # <<<<<<<<<<<<<<
 *                 assert (
 *                     iso_calr.week == cmp.week == iso_week
 */
            __pyx_t_1 = PyTuple_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 484, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_17 = 0;
            __pyx_t_18 = 127;
            __pyx_t_14 = __Pyx_PyUnicode_From_int(__pyx_v_year, 0, ' ', 'd'); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 484, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14);
            __Pyx_GIVEREF(__pyx_t_14);
            PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_14);
            __pyx_t_14 = 0;
            __Pyx_INCREF(__pyx_kp_u__9);
            __pyx_t_17 += 1;
            __Pyx_GIVEREF(__pyx_kp_u__9);
            PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__9);
            __pyx_t_14 = __Pyx_PyUnicode_From_int(__pyx_v_month, 0, ' ', 'd'); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 484, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14);
            __Pyx_GIVEREF(__pyx_t_14);
            PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_14);
            __pyx_t_14 = 0;
            __Pyx_INCREF(__pyx_kp_u__9);
            __pyx_t_17 += 1;
            __Pyx_GIVEREF(__pyx_kp_u__9);
            PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__9);
            __pyx_t_14 = __Pyx_PyUnicode_From_int(__pyx_v_day, 0, ' ', 'd'); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 484, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14);
            __Pyx_GIVEREF(__pyx_t_14);
            PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_14);
            __pyx_t_14 = 0;
            __Pyx_INCREF(__pyx_kp_u__40);
            __pyx_t_17 += 2;
            __Pyx_GIVEREF(__pyx_kp_u__40);
            PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u__40);
            __pyx_t_14 = __Pyx_PyUnicode_From_int(__pyx_v_iso_calr.year, 0, ' ', 'd'); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 484, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14);
            __Pyx_GIVEREF(__pyx_t_14);
            PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_14);
            __pyx_t_14 = 0;
            __Pyx_INCREF(__pyx_kp_u__38);
            __pyx_t_17 += 4;
            __Pyx_GIVEREF(__pyx_kp_u__38);
            PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_kp_u__38);
            __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_year); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 484, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_14, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 484, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_18;
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_t_2);
            __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_kp_u__38);
            __pyx_t_17 += 4;
            __Pyx_GIVEREF(__pyx_kp_u__38);
            PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_kp_u__38);
            __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_iso_year, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 484, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_t_2);
            __pyx_t_2 = 0;
            __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 11, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 484, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(1, 482, __pyx_L1_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(1, 482, __pyx_L1_error)
        #endif

        /* "cytimes/utils.py":485
 *                     iso_calr.year == cmp.year == iso_year
 *                 ), f"{year}-{month}-{day}: {iso_calr.year} != {cmp.year} != {iso_year}"
 *                 assert (             # <<<<<<<<<<<<<<
 *                     iso_calr.week == cmp.week == iso_week
 *                 ), f"{year}-{month}-{day}: {iso_calr.week} != {cmp.week} != {iso_week}"
 */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {

          /* "cytimes/utils.py":486
 *                 ), f"{year}-{month}-{day}: {iso_calr.year} != {cmp.year} != {iso_year}"
 *                 assert (
 *                     iso_calr.week == cmp.week == iso_week             # <<<<<<<<<<<<<<
 *                 ), f"{year}-{month}-{day}: {iso_calr.week} != {cmp.week} != {iso_week}"
 *                 assert (
 */
          __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_iso_calr.week); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 486, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_week); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 486, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_14 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 486, __pyx_L1_error)
          if (__Pyx_PyObject_IsTrue(__pyx_t_14)) {
            __Pyx_DECREF(__pyx_t_14);
            __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_iso_week); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 486, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_14 = PyObject_RichCompare(__pyx_t_1, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 486, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 486, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_6)) {

            /* "cytimes/utils.py":487
 *                 assert (
 *                     iso_calr.week == cmp.week == iso_week
 *                 ), f"{year}-{month}-{day}: {iso_calr.week} != {cmp.week} != {iso_week}"             # <<<<<<<<<<<<<<
 *                 assert (
 *                     iso_calr.weekday == cmp.weekday
 */
            __pyx_t_14 = PyTuple_New(11); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 487, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_17 = 0;
            __pyx_t_18 = 127;
            __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_year, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1);
            __pyx_t_1 = 0;
            __Pyx_INCREF(__pyx_kp_u__9);
            __pyx_t_17 += 1;
            __Pyx_GIVEREF(__pyx_kp_u__9);
            PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_kp_u__9);
            __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_month, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_1);
            __pyx_t_1 = 0;
            __Pyx_INCREF(__pyx_kp_u__9);
            __pyx_t_17 += 1;
            __Pyx_GIVEREF(__pyx_kp_u__9);
            PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_kp_u__9);
            __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_day, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_1);
            __pyx_t_1 = 0;
            __Pyx_INCREF(__pyx_kp_u__40);
            __pyx_t_17 += 2;
            __Pyx_GIVEREF(__pyx_kp_u__40);
            PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_kp_u__40);
            __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_iso_calr.week, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_14, 6, __pyx_t_1);
            __pyx_t_1 = 0;
            __Pyx_INCREF(__pyx_kp_u__38);
            __pyx_t_17 += 4;
            __Pyx_GIVEREF(__pyx_kp_u__38);
            PyTuple_SET_ITEM(__pyx_t_14, 7, __pyx_kp_u__38);
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_week); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 487, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_18;
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_14, 8, __pyx_t_2);
            __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_kp_u__38);
            __pyx_t_17 += 4;
            __Pyx_GIVEREF(__pyx_kp_u__38);
            PyTuple_SET_ITEM(__pyx_t_14, 9, __pyx_kp_u__38);
            __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_iso_week, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 487, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_14, 10, __pyx_t_2);
            __pyx_t_2 = 0;
            __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_14, 11, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 487, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(1, 485, __pyx_L1_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(1, 485, __pyx_L1_error)
        #endif

        /* "cytimes/utils.py":488
 *                     iso_calr.week == cmp.week == iso_week
 *                 ), f"{year}-{month}-{day}: {iso_calr.week} != {cmp.week} != {iso_week}"
 *                 assert (             # <<<<<<<<<<<<<<
 *                     iso_calr.weekday == cmp.weekday
 *                 ), f"{year}-{month}-{day}: {iso_calr.weekday} != {cmp.weekday}"
 */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {

          /* "cytimes/utils.py":489
 *                 ), f"{year}-{month}-{day}: {iso_calr.week} != {cmp.week} != {iso_week}"
 *                 assert (
 *                     iso_calr.weekday == cmp.weekday             # <<<<<<<<<<<<<<
 *                 ), f"{year}-{month}-{day}: {iso_calr.weekday} != {cmp.weekday}"
 *     print("Passed: isocalendar")
 */
          __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_iso_calr.weekday); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 489, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_weekday); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 489, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_14, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 489, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 489, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_6)) {

            /* "cytimes/utils.py":490
 *                 assert (
 *                     iso_calr.weekday == cmp.weekday
 *                 ), f"{year}-{month}-{day}: {iso_calr.weekday} != {cmp.weekday}"             # <<<<<<<<<<<<<<
 *     print("Passed: isocalendar")
 * 
 */
            __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 490, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_17 = 0;
            __pyx_t_18 = 127;
            __pyx_t_14 = __Pyx_PyUnicode_From_int(__pyx_v_year, 0, ' ', 'd'); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 490, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14);
            __Pyx_GIVEREF(__pyx_t_14);
            PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_14);
            __pyx_t_14 = 0;
            __Pyx_INCREF(__pyx_kp_u__9);
            __pyx_t_17 += 1;
            __Pyx_GIVEREF(__pyx_kp_u__9);
            PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__9);
            __pyx_t_14 = __Pyx_PyUnicode_From_int(__pyx_v_month, 0, ' ', 'd'); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 490, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14);
            __Pyx_GIVEREF(__pyx_t_14);
            PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_14);
            __pyx_t_14 = 0;
            __Pyx_INCREF(__pyx_kp_u__9);
            __pyx_t_17 += 1;
            __Pyx_GIVEREF(__pyx_kp_u__9);
            PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__9);
            __pyx_t_14 = __Pyx_PyUnicode_From_int(__pyx_v_day, 0, ' ', 'd'); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 490, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14);
            __Pyx_GIVEREF(__pyx_t_14);
            PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_14);
            __pyx_t_14 = 0;
            __Pyx_INCREF(__pyx_kp_u__40);
            __pyx_t_17 += 2;
            __Pyx_GIVEREF(__pyx_kp_u__40);
            PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u__40);
            __pyx_t_14 = __Pyx_PyUnicode_From_int(__pyx_v_iso_calr.weekday, 0, ' ', 'd'); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 490, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14);
            __Pyx_GIVEREF(__pyx_t_14);
            PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_14);
            __pyx_t_14 = 0;
            __Pyx_INCREF(__pyx_kp_u__38);
            __pyx_t_17 += 4;
            __Pyx_GIVEREF(__pyx_kp_u__38);
            PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_kp_u__38);
            __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmp, __pyx_n_s_weekday); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 490, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_14, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 490, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_18;
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_t_2);
            __pyx_t_2 = 0;
            __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 9, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 490, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(1, 488, __pyx_L1_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(1, 488, __pyx_L1_error)
        #endif
      }
    }
  }

  /* "cytimes/utils.py":491
 *                     iso_calr.weekday == cmp.weekday
 *                 ), f"{year}-{month}-{day}: {iso_calr.weekday} != {cmp.weekday}"
 *     print("Passed: isocalendar")             # <<<<<<<<<<<<<<
 * 
 *     del date
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":493
 *     print("Passed: isocalendar")
 * 
 *     del date             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_date); __pyx_v_date = 0;

  /* "cytimes/utils.py":467
 * 
 * 
 * def _test_isocalendar() -> None:             # <<<<<<<<<<<<<<
 *     from datetime import date
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("cytimes.utils._test_isocalendar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_date);
  __Pyx_XDECREF(__pyx_v_cmp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":496
 * 
 * 
 * def _test_iso_1st_monday() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _isoweek1monday  # type: ignore
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_23_test_iso_1st_monday(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_23_test_iso_1st_monday = {"_test_iso_1st_monday", (PyCFunction)__pyx_pw_7cytimes_5utils_23_test_iso_1st_monday, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_23_test_iso_1st_monday(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_iso_1st_monday (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_22_test_iso_1st_monday(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_22_test_iso_1st_monday(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v__isoweek1monday = NULL;
  long __pyx_v_year;
  int __pyx_v_val;
  PyObject *__pyx_v_cmp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_UCS4 __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_iso_1st_monday", 1);

  /* "cytimes/utils.py":497
 * 
 * def _test_iso_1st_monday() -> None:
 *     from _pydatetime import _isoweek1monday  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     for year in range(1, 10000):
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_isoweek1monday);
  __Pyx_GIVEREF(__pyx_n_s_isoweek1monday);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_isoweek1monday)) __PYX_ERR(1, 497, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pydatetime, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isoweek1monday); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v__isoweek1monday = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":499
 *     from _pydatetime import _isoweek1monday  # type: ignore
 * 
 *     for year in range(1, 10000):             # <<<<<<<<<<<<<<
 *         val = _iso_1st_monday(year)  # type: ignore
 *         cmp = _isoweek1monday(year)
 */
  for (__pyx_t_3 = 1; __pyx_t_3 < 0x2710; __pyx_t_3+=1) {
    __pyx_v_year = __pyx_t_3;

    /* "cytimes/utils.py":500
 * 
 *     for year in range(1, 10000):
 *         val = _iso_1st_monday(year)  # type: ignore             # <<<<<<<<<<<<<<
 *         cmp = _isoweek1monday(year)
 *         assert val == cmp, f"{year}: {val} != {cmp}"
 */
    __pyx_t_4 = __pyx_f_7cytimes_5utils__iso_1st_monday(__pyx_v_year); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 500, __pyx_L1_error)
    __pyx_v_val = __pyx_t_4;

    /* "cytimes/utils.py":501
 *     for year in range(1, 10000):
 *         val = _iso_1st_monday(year)  # type: ignore
 *         cmp = _isoweek1monday(year)             # <<<<<<<<<<<<<<
 *         assert val == cmp, f"{year}: {val} != {cmp}"
 *     print("Passed: iso_1st_monday")
 */
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__isoweek1monday);
    __pyx_t_5 = __pyx_v__isoweek1monday; __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_1};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 501, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_cmp, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/utils.py":502
 *         val = _iso_1st_monday(year)  # type: ignore
 *         cmp = _isoweek1monday(year)
 *         assert val == cmp, f"{year}: {val} != {cmp}"             # <<<<<<<<<<<<<<
 *     print("Passed: iso_1st_monday")
 * 
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 502, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_v_cmp, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 502, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 502, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_8)) {
        __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 502, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_9 = 0;
        __pyx_t_10 = 127;
        __pyx_t_2 = __Pyx_PyUnicode_From_long(__pyx_v_year, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 502, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_9 += __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__40);
        __pyx_t_9 += 2;
        __Pyx_GIVEREF(__pyx_kp_u__40);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_u__40);
        __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_val, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 502, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_9 += __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__38);
        __pyx_t_9 += 4;
        __Pyx_GIVEREF(__pyx_kp_u__38);
        PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_kp_u__38);
        __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_cmp, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 502, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_10;
        __pyx_t_9 += __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_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 502, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(1, 502, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 502, __pyx_L1_error)
    #endif
  }

  /* "cytimes/utils.py":503
 *         cmp = _isoweek1monday(year)
 *         assert val == cmp, f"{year}: {val} != {cmp}"
 *     print("Passed: iso_1st_monday")             # <<<<<<<<<<<<<<
 * 
 *     del _isoweek1monday
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":505
 *     print("Passed: iso_1st_monday")
 * 
 *     del _isoweek1monday             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v__isoweek1monday); __pyx_v__isoweek1monday = 0;

  /* "cytimes/utils.py":496
 * 
 * 
 * def _test_iso_1st_monday() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _isoweek1monday  # type: ignore
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytimes.utils._test_iso_1st_monday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__isoweek1monday);
  __Pyx_XDECREF(__pyx_v_cmp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":508
 * 
 * 
 * def _test_ymd_to_ordinal() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _ymd2ord  # type: ignore
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_25_test_ymd_to_ordinal(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_25_test_ymd_to_ordinal = {"_test_ymd_to_ordinal", (PyCFunction)__pyx_pw_7cytimes_5utils_25_test_ymd_to_ordinal, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_25_test_ymd_to_ordinal(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_ymd_to_ordinal (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_24_test_ymd_to_ordinal(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_24_test_ymd_to_ordinal(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v__ymd2ord = NULL;
  int __pyx_v_year;
  int __pyx_v_month;
  int __pyx_v_day;
  int __pyx_v_val;
  PyObject *__pyx_v_cmp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  unsigned int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_UCS4 __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_ymd_to_ordinal", 1);

  /* "cytimes/utils.py":509
 * 
 * def _test_ymd_to_ordinal() -> None:
 *     from _pydatetime import _ymd2ord  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     year: cython.int
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_ymd2ord);
  __Pyx_GIVEREF(__pyx_n_s_ymd2ord);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ymd2ord)) __PYX_ERR(1, 509, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pydatetime, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ymd2ord); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v__ymd2ord = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":514
 *     month: cython.int
 *     day: cython.int
 *     for year in range(1, 10000):             # <<<<<<<<<<<<<<
 *         for month in range(1, 13):
 *             for day in range(1, 32):
 */
  for (__pyx_t_3 = 1; __pyx_t_3 < 0x2710; __pyx_t_3+=1) {
    __pyx_v_year = __pyx_t_3;

    /* "cytimes/utils.py":515
 *     day: cython.int
 *     for year in range(1, 10000):
 *         for month in range(1, 13):             # <<<<<<<<<<<<<<
 *             for day in range(1, 32):
 *                 if day > 28:
 */
    for (__pyx_t_4 = 1; __pyx_t_4 < 13; __pyx_t_4+=1) {
      __pyx_v_month = __pyx_t_4;

      /* "cytimes/utils.py":516
 *     for year in range(1, 10000):
 *         for month in range(1, 13):
 *             for day in range(1, 32):             # <<<<<<<<<<<<<<
 *                 if day > 28:
 *                     day = min(day, days_in_month(year, month))  # type: ignore
 */
      for (__pyx_t_5 = 1; __pyx_t_5 < 32; __pyx_t_5+=1) {
        __pyx_v_day = __pyx_t_5;

        /* "cytimes/utils.py":517
 *         for month in range(1, 13):
 *             for day in range(1, 32):
 *                 if day > 28:             # <<<<<<<<<<<<<<
 *                     day = min(day, days_in_month(year, month))  # type: ignore
 *                 val = ymd_to_ordinal(year, month, day)  # type: ignore
 */
        __pyx_t_6 = (__pyx_v_day > 28);
        if (__pyx_t_6) {

          /* "cytimes/utils.py":518
 *             for day in range(1, 32):
 *                 if day > 28:
 *                     day = min(day, days_in_month(year, month))  # type: ignore             # <<<<<<<<<<<<<<
 *                 val = ymd_to_ordinal(year, month, day)  # type: ignore
 *                 cmp = _ymd2ord(year, month, day)
 */
          __pyx_t_7 = __pyx_f_7cytimes_5utils_days_in_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 518, __pyx_L1_error)
          __pyx_t_8 = __pyx_v_day;
          __pyx_t_6 = (__pyx_t_7 < __pyx_t_8);
          if (__pyx_t_6) {
            __pyx_t_9 = __pyx_t_7;
          } else {
            __pyx_t_9 = __pyx_t_8;
          }
          __pyx_v_day = __pyx_t_9;

          /* "cytimes/utils.py":517
 *         for month in range(1, 13):
 *             for day in range(1, 32):
 *                 if day > 28:             # <<<<<<<<<<<<<<
 *                     day = min(day, days_in_month(year, month))  # type: ignore
 *                 val = ymd_to_ordinal(year, month, day)  # type: ignore
 */
        }

        /* "cytimes/utils.py":519
 *                 if day > 28:
 *                     day = min(day, days_in_month(year, month))  # type: ignore
 *                 val = ymd_to_ordinal(year, month, day)  # type: ignore             # <<<<<<<<<<<<<<
 *                 cmp = _ymd2ord(year, month, day)
 *                 assert val == cmp, f"{year}-{month}-{day}: {val} != {cmp}"
 */
        __pyx_t_9 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 519, __pyx_L1_error)
        __pyx_v_val = __pyx_t_9;

        /* "cytimes/utils.py":520
 *                     day = min(day, days_in_month(year, month))  # type: ignore
 *                 val = ymd_to_ordinal(year, month, day)  # type: ignore
 *                 cmp = _ymd2ord(year, month, day)             # <<<<<<<<<<<<<<
 *                 assert val == cmp, f"{year}-{month}-{day}: {val} != {cmp}"
 *     print("Passed: ymd_to_ordinal")
 */
        __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 520, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_month); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 520, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 520, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_v__ymd2ord);
        __pyx_t_12 = __pyx_v__ymd2ord; __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
            __pyx_t_14 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_13, __pyx_t_1, __pyx_t_10, __pyx_t_11};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_14, 3+__pyx_t_14);
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 520, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_XDECREF_SET(__pyx_v_cmp, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "cytimes/utils.py":521
 *                 val = ymd_to_ordinal(year, month, day)  # type: ignore
 *                 cmp = _ymd2ord(year, month, day)
 *                 assert val == cmp, f"{year}-{month}-{day}: {val} != {cmp}"             # <<<<<<<<<<<<<<
 *     print("Passed: ymd_to_ordinal")
 * 
 */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {
          __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 521, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_12 = PyObject_RichCompare(__pyx_t_2, __pyx_v_cmp, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 521, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 521, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_6)) {
            __pyx_t_12 = PyTuple_New(9); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 521, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_15 = 0;
            __pyx_t_16 = 127;
            __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_year, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 521, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2);
            __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_kp_u__9);
            __pyx_t_15 += 1;
            __Pyx_GIVEREF(__pyx_kp_u__9);
            PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_kp_u__9);
            __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_month, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 521, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_2);
            __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_kp_u__9);
            __pyx_t_15 += 1;
            __Pyx_GIVEREF(__pyx_kp_u__9);
            PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_kp_u__9);
            __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_day, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 521, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_2);
            __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_kp_u__40);
            __pyx_t_15 += 2;
            __Pyx_GIVEREF(__pyx_kp_u__40);
            PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_kp_u__40);
            __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_val, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 521, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_2);
            __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_kp_u__38);
            __pyx_t_15 += 4;
            __Pyx_GIVEREF(__pyx_kp_u__38);
            PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_kp_u__38);
            __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_cmp, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 521, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_16;
            __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_12, 8, __pyx_t_2);
            __pyx_t_2 = 0;
            __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_12, 9, __pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 521, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(1, 521, __pyx_L1_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(1, 521, __pyx_L1_error)
        #endif
      }
    }
  }

  /* "cytimes/utils.py":522
 *                 cmp = _ymd2ord(year, month, day)
 *                 assert val == cmp, f"{year}-{month}-{day}: {val} != {cmp}"
 *     print("Passed: ymd_to_ordinal")             # <<<<<<<<<<<<<<
 * 
 *     del _ymd2ord
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":524
 *     print("Passed: ymd_to_ordinal")
 * 
 *     del _ymd2ord             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v__ymd2ord); __pyx_v__ymd2ord = 0;

  /* "cytimes/utils.py":508
 * 
 * 
 * def _test_ymd_to_ordinal() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _ymd2ord  # type: ignore
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("cytimes.utils._test_ymd_to_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__ymd2ord);
  __Pyx_XDECREF(__pyx_v_cmp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":527
 * 
 * 
 * def _test_ymd_fr_ordinal() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _ord2ymd, _MAXORDINAL  # type: ignore
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_27_test_ymd_fr_ordinal(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_27_test_ymd_fr_ordinal = {"_test_ymd_fr_ordinal", (PyCFunction)__pyx_pw_7cytimes_5utils_27_test_ymd_fr_ordinal, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_27_test_ymd_fr_ordinal(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_ymd_fr_ordinal (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_26_test_ymd_fr_ordinal(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_26_test_ymd_fr_ordinal(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v__ord2ymd = NULL;
  PyObject *__pyx_v__MAXORDINAL = NULL;
  PyObject *__pyx_v_i = NULL;
  __pyx_t_7cytimes_5utils_ymd __pyx_v_val;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_UCS4 __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_ymd_fr_ordinal", 1);

  /* "cytimes/utils.py":528
 * 
 * def _test_ymd_fr_ordinal() -> None:
 *     from _pydatetime import _ord2ymd, _MAXORDINAL  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     for i in range(1, _MAXORDINAL + 1):
 */
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_ord2ymd);
  __Pyx_GIVEREF(__pyx_n_s_ord2ymd);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ord2ymd)) __PYX_ERR(1, 528, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_s_MAXORDINAL);
  __Pyx_GIVEREF(__pyx_n_s_MAXORDINAL);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_MAXORDINAL)) __PYX_ERR(1, 528, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pydatetime, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ord2ymd); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v__ord2ymd = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MAXORDINAL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v__MAXORDINAL = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":530
 *     from _pydatetime import _ord2ymd, _MAXORDINAL  # type: ignore
 * 
 *     for i in range(1, _MAXORDINAL + 1):             # <<<<<<<<<<<<<<
 *         val = ymd_fr_ordinal(i)  # type: ignore
 *         (y, m, d) = _ord2ymd(i)
 */
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v__MAXORDINAL, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_1)) __PYX_ERR(1, 530, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(1, 530, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 530, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 530, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 530, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 530, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 530, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 530, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 530, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 530, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/utils.py":531
 * 
 *     for i in range(1, _MAXORDINAL + 1):
 *         val = ymd_fr_ordinal(i)  # type: ignore             # <<<<<<<<<<<<<<
 *         (y, m, d) = _ord2ymd(i)
 *         assert (
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 531, __pyx_L1_error)
    __pyx_t_6 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 531, __pyx_L1_error)
    __pyx_v_val = __pyx_t_6;

    /* "cytimes/utils.py":532
 *     for i in range(1, _MAXORDINAL + 1):
 *         val = ymd_fr_ordinal(i)  # type: ignore
 *         (y, m, d) = _ord2ymd(i)             # <<<<<<<<<<<<<<
 *         assert (
 *             val.year == y and val.month == m and val.day == d
 */
    __Pyx_INCREF(__pyx_v__ord2ymd);
    __pyx_t_7 = __pyx_v__ord2ymd; __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_i};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 532, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(1, 532, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_10 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_10);
      #else
      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 532, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 532, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 532, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_11 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 532, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11);
      index = 0; __pyx_t_7 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      index = 1; __pyx_t_8 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      index = 2; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 3) < 0) __PYX_ERR(1, 532, __pyx_L1_error)
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(1, 532, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "cytimes/utils.py":533
 *         val = ymd_fr_ordinal(i)  # type: ignore
 *         (y, m, d) = _ord2ymd(i)
 *         assert (             # <<<<<<<<<<<<<<
 *             val.year == y and val.month == m and val.day == d
 *         ), f"{i}: {val} != {y}-{m}-{d}"
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {

      /* "cytimes/utils.py":534
 *         (y, m, d) = _ord2ymd(i)
 *         assert (
 *             val.year == y and val.month == m and val.day == d             # <<<<<<<<<<<<<<
 *         ), f"{i}: {val} != {y}-{m}-{d}"
 *     print("Passed: ymd_fr_ordinal")
 */
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_val.year); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = PyObject_RichCompare(__pyx_t_2, __pyx_v_y, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 534, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(1, 534, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (__pyx_t_14) {
      } else {
        __pyx_t_13 = __pyx_t_14;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_val.month); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_2 = PyObject_RichCompare(__pyx_t_10, __pyx_v_m, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 534, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(1, 534, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_14) {
      } else {
        __pyx_t_13 = __pyx_t_14;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_val.day); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = PyObject_RichCompare(__pyx_t_2, __pyx_v_d, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 534, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(1, 534, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_13 = __pyx_t_14;
      __pyx_L7_bool_binop_done:;
      if (unlikely(!__pyx_t_13)) {

        /* "cytimes/utils.py":535
 *         assert (
 *             val.year == y and val.month == m and val.day == d
 *         ), f"{i}: {val} != {y}-{m}-{d}"             # <<<<<<<<<<<<<<
 *     print("Passed: ymd_fr_ordinal")
 * 
 */
        __pyx_t_10 = PyTuple_New(9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 535, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_15 = 0;
        __pyx_t_16 = 127;
        __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_i, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 535, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_16;
        __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_INCREF(__pyx_kp_u__40);
        __pyx_t_15 += 2;
        __Pyx_GIVEREF(__pyx_kp_u__40);
        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_kp_u__40);
        __pyx_t_2 = __pyx_convert__to_py___pyx_t_7cytimes_5utils_ymd(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 535, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 535, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_16;
        __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_8);
        __pyx_t_8 = 0;
        __Pyx_INCREF(__pyx_kp_u__38);
        __pyx_t_15 += 4;
        __Pyx_GIVEREF(__pyx_kp_u__38);
        PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_kp_u__38);
        __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_y, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 535, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_16;
        __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_8);
        __pyx_t_8 = 0;
        __Pyx_INCREF(__pyx_kp_u__9);
        __pyx_t_15 += 1;
        __Pyx_GIVEREF(__pyx_kp_u__9);
        PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_kp_u__9);
        __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_m, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 535, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_16;
        __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_8);
        __pyx_t_8 = 0;
        __Pyx_INCREF(__pyx_kp_u__9);
        __pyx_t_15 += 1;
        __Pyx_GIVEREF(__pyx_kp_u__9);
        PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_kp_u__9);
        __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_d, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 535, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_16;
        __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_10, 9, __pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 535, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_8, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 533, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 533, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":530
 *     from _pydatetime import _ord2ymd, _MAXORDINAL  # type: ignore
 * 
 *     for i in range(1, _MAXORDINAL + 1):             # <<<<<<<<<<<<<<
 *         val = ymd_fr_ordinal(i)  # type: ignore
 *         (y, m, d) = _ord2ymd(i)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":536
 *             val.year == y and val.month == m and val.day == d
 *         ), f"{i}: {val} != {y}-{m}-{d}"
 *     print("Passed: ymd_fr_ordinal")             # <<<<<<<<<<<<<<
 * 
 *     del _ord2ymd, _MAXORDINAL
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":538
 *     print("Passed: ymd_fr_ordinal")
 * 
 *     del _ord2ymd, _MAXORDINAL             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v__ord2ymd); __pyx_v__ord2ymd = 0;
  __Pyx_DECREF(__pyx_v__MAXORDINAL); __pyx_v__MAXORDINAL = 0;

  /* "cytimes/utils.py":527
 * 
 * 
 * def _test_ymd_fr_ordinal() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _ord2ymd, _MAXORDINAL  # type: ignore
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.utils._test_ymd_fr_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__ord2ymd);
  __Pyx_XDECREF(__pyx_v__MAXORDINAL);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":541
 * 
 * 
 * def _test_ymd_fr_isocalendar() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _isoweek_to_gregorian  # type: ignore
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_29_test_ymd_fr_isocalendar(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_29_test_ymd_fr_isocalendar = {"_test_ymd_fr_isocalendar", (PyCFunction)__pyx_pw_7cytimes_5utils_29_test_ymd_fr_isocalendar, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_29_test_ymd_fr_isocalendar(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_ymd_fr_isocalendar (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_28_test_ymd_fr_isocalendar(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_28_test_ymd_fr_isocalendar(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v__isoweek_to_gregorian = NULL;
  int __pyx_v_year;
  int __pyx_v_week;
  int __pyx_v_weekday;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_d = NULL;
  __pyx_t_7cytimes_5utils_ymd __pyx_v_val;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  unsigned int __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_16;
  int __pyx_t_17;
  int __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_UCS4 __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_ymd_fr_isocalendar", 1);

  /* "cytimes/utils.py":542
 * 
 * def _test_ymd_fr_isocalendar() -> None:
 *     from _pydatetime import _isoweek_to_gregorian  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     year: cython.int
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_isoweek_to_gregorian);
  __Pyx_GIVEREF(__pyx_n_s_isoweek_to_gregorian);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_isoweek_to_gregorian)) __PYX_ERR(1, 542, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pydatetime, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isoweek_to_gregorian); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v__isoweek_to_gregorian = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":547
 *     week: cython.int
 *     weekday: cython.int
 *     for year in range(1, 10000):             # <<<<<<<<<<<<<<
 *         for week in range(1, 54):
 *             for weekday in range(1, 8):
 */
  for (__pyx_t_3 = 1; __pyx_t_3 < 0x2710; __pyx_t_3+=1) {
    __pyx_v_year = __pyx_t_3;

    /* "cytimes/utils.py":548
 *     weekday: cython.int
 *     for year in range(1, 10000):
 *         for week in range(1, 54):             # <<<<<<<<<<<<<<
 *             for weekday in range(1, 8):
 *                 try:
 */
    for (__pyx_t_4 = 1; __pyx_t_4 < 54; __pyx_t_4+=1) {
      __pyx_v_week = __pyx_t_4;

      /* "cytimes/utils.py":549
 *     for year in range(1, 10000):
 *         for week in range(1, 54):
 *             for weekday in range(1, 8):             # <<<<<<<<<<<<<<
 *                 try:
 *                     (y, m, d) = _isoweek_to_gregorian(year, week, weekday)
 */
      for (__pyx_t_5 = 1; __pyx_t_5 < 8; __pyx_t_5+=1) {
        __pyx_v_weekday = __pyx_t_5;

        /* "cytimes/utils.py":550
 *         for week in range(1, 54):
 *             for weekday in range(1, 8):
 *                 try:             # <<<<<<<<<<<<<<
 *                     (y, m, d) = _isoweek_to_gregorian(year, week, weekday)
 *                 except ValueError:
 */
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_8);
          /*try:*/ {

            /* "cytimes/utils.py":551
 *             for weekday in range(1, 8):
 *                 try:
 *                     (y, m, d) = _isoweek_to_gregorian(year, week, weekday)             # <<<<<<<<<<<<<<
 *                 except ValueError:
 *                     continue
 */
            __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 551, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_week); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 551, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_9);
            __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_weekday); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 551, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_INCREF(__pyx_v__isoweek_to_gregorian);
            __pyx_t_11 = __pyx_v__isoweek_to_gregorian; __pyx_t_12 = NULL;
            __pyx_t_13 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_11))) {
              __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
              if (likely(__pyx_t_12)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
                __Pyx_INCREF(__pyx_t_12);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_11, function);
                __pyx_t_13 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[4] = {__pyx_t_12, __pyx_t_1, __pyx_t_9, __pyx_t_10};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_13, 3+__pyx_t_13);
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 551, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            }
            if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
              PyObject* sequence = __pyx_t_2;
              Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
              if (unlikely(size != 3)) {
                if (size > 3) __Pyx_RaiseTooManyValuesError(3);
                else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                __PYX_ERR(1, 551, __pyx_L9_error)
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              if (likely(PyTuple_CheckExact(sequence))) {
                __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); 
                __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
                __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); 
              } else {
                __pyx_t_11 = PyList_GET_ITEM(sequence, 0); 
                __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
                __pyx_t_9 = PyList_GET_ITEM(sequence, 2); 
              }
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(__pyx_t_9);
              #else
              __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 551, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 551, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 551, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_9);
              #endif
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            } else {
              Py_ssize_t index = -1;
              __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 551, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1);
              index = 0; __pyx_t_11 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_11)) goto __pyx_L17_unpacking_failed;
              __Pyx_GOTREF(__pyx_t_11);
              index = 1; __pyx_t_10 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_10)) goto __pyx_L17_unpacking_failed;
              __Pyx_GOTREF(__pyx_t_10);
              index = 2; __pyx_t_9 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_9)) goto __pyx_L17_unpacking_failed;
              __Pyx_GOTREF(__pyx_t_9);
              if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_1), 3) < 0) __PYX_ERR(1, 551, __pyx_L9_error)
              __pyx_t_14 = NULL;
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              goto __pyx_L18_unpacking_done;
              __pyx_L17_unpacking_failed:;
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_14 = NULL;
              if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
              __PYX_ERR(1, 551, __pyx_L9_error)
              __pyx_L18_unpacking_done:;
            }
            __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_11);
            __pyx_t_11 = 0;
            __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_10);
            __pyx_t_10 = 0;
            __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_9);
            __pyx_t_9 = 0;

            /* "cytimes/utils.py":550
 *         for week in range(1, 54):
 *             for weekday in range(1, 8):
 *                 try:             # <<<<<<<<<<<<<<
 *                     (y, m, d) = _isoweek_to_gregorian(year, week, weekday)
 *                 except ValueError:
 */
          }
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L16_try_end;
          __pyx_L9_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "cytimes/utils.py":552
 *                 try:
 *                     (y, m, d) = _isoweek_to_gregorian(year, week, weekday)
 *                 except ValueError:             # <<<<<<<<<<<<<<
 *                     continue
 *                 val = ymd_fr_isocalendar(year, week, weekday)  # type: ignore
 */
          __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
          if (__pyx_t_15) {
            __Pyx_AddTraceback("cytimes.utils._test_ymd_fr_isocalendar", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(1, 552, __pyx_L11_except_error)
            __Pyx_XGOTREF(__pyx_t_2);
            __Pyx_XGOTREF(__pyx_t_9);
            __Pyx_XGOTREF(__pyx_t_10);

            /* "cytimes/utils.py":553
 *                     (y, m, d) = _isoweek_to_gregorian(year, week, weekday)
 *                 except ValueError:
 *                     continue             # <<<<<<<<<<<<<<
 *                 val = ymd_fr_isocalendar(year, week, weekday)  # type: ignore
 *                 if y == 10_000 or val.year == 10_000:
 */
            goto __pyx_L19_except_continue;
            __pyx_L19_except_continue:;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            goto __pyx_L15_try_continue;
          }
          goto __pyx_L11_except_error;

          /* "cytimes/utils.py":550
 *         for week in range(1, 54):
 *             for weekday in range(1, 8):
 *                 try:             # <<<<<<<<<<<<<<
 *                     (y, m, d) = _isoweek_to_gregorian(year, week, weekday)
 *                 except ValueError:
 */
          __pyx_L11_except_error:;
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
          goto __pyx_L1_error;
          __pyx_L15_try_continue:;
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
          goto __pyx_L7_continue;
          __pyx_L16_try_end:;
        }

        /* "cytimes/utils.py":554
 *                 except ValueError:
 *                     continue
 *                 val = ymd_fr_isocalendar(year, week, weekday)  # type: ignore             # <<<<<<<<<<<<<<
 *                 if y == 10_000 or val.year == 10_000:
 *                     continue
 */
        __pyx_t_16 = __pyx_f_7cytimes_5utils_ymd_fr_isocalendar(__pyx_v_year, __pyx_v_week, __pyx_v_weekday); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 554, __pyx_L1_error)
        __pyx_v_val = __pyx_t_16;

        /* "cytimes/utils.py":555
 *                     continue
 *                 val = ymd_fr_isocalendar(year, week, weekday)  # type: ignore
 *                 if y == 10_000 or val.year == 10_000:             # <<<<<<<<<<<<<<
 *                     continue
 *                 assert (
 */
        __pyx_t_18 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_y, __pyx_int_10000, 0x2710, 0)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(1, 555, __pyx_L1_error)
        if (!__pyx_t_18) {
        } else {
          __pyx_t_17 = __pyx_t_18;
          goto __pyx_L22_bool_binop_done;
        }
        __pyx_t_18 = (__pyx_v_val.year == 0x2710);
        __pyx_t_17 = __pyx_t_18;
        __pyx_L22_bool_binop_done:;
        if (__pyx_t_17) {

          /* "cytimes/utils.py":556
 *                 val = ymd_fr_isocalendar(year, week, weekday)  # type: ignore
 *                 if y == 10_000 or val.year == 10_000:
 *                     continue             # <<<<<<<<<<<<<<
 *                 assert (
 *                     val.year == y and val.month == m and val.day == d
 */
          goto __pyx_L7_continue;

          /* "cytimes/utils.py":555
 *                     continue
 *                 val = ymd_fr_isocalendar(year, week, weekday)  # type: ignore
 *                 if y == 10_000 or val.year == 10_000:             # <<<<<<<<<<<<<<
 *                     continue
 *                 assert (
 */
        }

        /* "cytimes/utils.py":557
 *                 if y == 10_000 or val.year == 10_000:
 *                     continue
 *                 assert (             # <<<<<<<<<<<<<<
 *                     val.year == y and val.month == m and val.day == d
 *                 ), f"{year}-{week}-{weekday}: {val} != {y}-{m}-{d}"
 */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {

          /* "cytimes/utils.py":558
 *                     continue
 *                 assert (
 *                     val.year == y and val.month == m and val.day == d             # <<<<<<<<<<<<<<
 *                 ), f"{year}-{week}-{weekday}: {val} != {y}-{m}-{d}"
 * 
 */
          __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_val.year); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 558, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_9 = PyObject_RichCompare(__pyx_t_10, __pyx_v_y, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 558, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(1, 558, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (__pyx_t_18) {
          } else {
            __pyx_t_17 = __pyx_t_18;
            goto __pyx_L24_bool_binop_done;
          }
          __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_val.month); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 558, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = PyObject_RichCompare(__pyx_t_9, __pyx_v_m, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 558, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(1, 558, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (__pyx_t_18) {
          } else {
            __pyx_t_17 = __pyx_t_18;
            goto __pyx_L24_bool_binop_done;
          }
          __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_val.day); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 558, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_9 = PyObject_RichCompare(__pyx_t_10, __pyx_v_d, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 558, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(1, 558, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_17 = __pyx_t_18;
          __pyx_L24_bool_binop_done:;
          if (unlikely(!__pyx_t_17)) {

            /* "cytimes/utils.py":559
 *                 assert (
 *                     val.year == y and val.month == m and val.day == d
 *                 ), f"{year}-{week}-{weekday}: {val} != {y}-{m}-{d}"             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: ymd_fr_isocalendar")
 */
            __pyx_t_9 = PyTuple_New(13); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 559, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            __pyx_t_19 = 0;
            __pyx_t_20 = 127;
            __pyx_t_10 = __Pyx_PyUnicode_From_int(__pyx_v_year, 0, ' ', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 559, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_19 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
            __Pyx_GIVEREF(__pyx_t_10);
            PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10);
            __pyx_t_10 = 0;
            __Pyx_INCREF(__pyx_kp_u__9);
            __pyx_t_19 += 1;
            __Pyx_GIVEREF(__pyx_kp_u__9);
            PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_kp_u__9);
            __pyx_t_10 = __Pyx_PyUnicode_From_int(__pyx_v_week, 0, ' ', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 559, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_19 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
            __Pyx_GIVEREF(__pyx_t_10);
            PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_10);
            __pyx_t_10 = 0;
            __Pyx_INCREF(__pyx_kp_u__9);
            __pyx_t_19 += 1;
            __Pyx_GIVEREF(__pyx_kp_u__9);
            PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_kp_u__9);
            __pyx_t_10 = __Pyx_PyUnicode_From_int(__pyx_v_weekday, 0, ' ', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 559, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_19 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
            __Pyx_GIVEREF(__pyx_t_10);
            PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_10);
            __pyx_t_10 = 0;
            __Pyx_INCREF(__pyx_kp_u__40);
            __pyx_t_19 += 2;
            __Pyx_GIVEREF(__pyx_kp_u__40);
            PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_kp_u__40);
            __pyx_t_10 = __pyx_convert__to_py___pyx_t_7cytimes_5utils_ymd(__pyx_v_val); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 559, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 559, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __pyx_t_20 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_20) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_20;
            __pyx_t_19 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_2);
            __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_kp_u__38);
            __pyx_t_19 += 4;
            __Pyx_GIVEREF(__pyx_kp_u__38);
            PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_kp_u__38);
            __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_y, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 559, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_20 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_20) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_20;
            __pyx_t_19 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_9, 8, __pyx_t_2);
            __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_kp_u__9);
            __pyx_t_19 += 1;
            __Pyx_GIVEREF(__pyx_kp_u__9);
            PyTuple_SET_ITEM(__pyx_t_9, 9, __pyx_kp_u__9);
            __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_m, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 559, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_20 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_20) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_20;
            __pyx_t_19 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_9, 10, __pyx_t_2);
            __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_kp_u__9);
            __pyx_t_19 += 1;
            __Pyx_GIVEREF(__pyx_kp_u__9);
            PyTuple_SET_ITEM(__pyx_t_9, 11, __pyx_kp_u__9);
            __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_d, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 559, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_20 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_20) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_20;
            __pyx_t_19 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_9, 12, __pyx_t_2);
            __pyx_t_2 = 0;
            __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_9, 13, __pyx_t_19, __pyx_t_20); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 559, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(1, 557, __pyx_L1_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(1, 557, __pyx_L1_error)
        #endif
        __pyx_L7_continue:;
      }
    }
  }

  /* "cytimes/utils.py":561
 *                 ), f"{year}-{week}-{weekday}: {val} != {y}-{m}-{d}"
 * 
 *     print("Passed: ymd_fr_isocalendar")             # <<<<<<<<<<<<<<
 * 
 *     del _isoweek_to_gregorian
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":563
 *     print("Passed: ymd_fr_isocalendar")
 * 
 *     del _isoweek_to_gregorian             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v__isoweek_to_gregorian); __pyx_v__isoweek_to_gregorian = 0;

  /* "cytimes/utils.py":541
 * 
 * 
 * def _test_ymd_fr_isocalendar() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _isoweek_to_gregorian  # type: ignore
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cytimes.utils._test_ymd_fr_isocalendar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__isoweek_to_gregorian);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":567
 * 
 * # datetime.date
 * def _test_date_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_31_test_date_generate(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_31_test_date_generate = {"_test_date_generate", (PyCFunction)__pyx_pw_7cytimes_5utils_31_test_date_generate, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_31_test_date_generate(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_date_generate (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_30_test_date_generate(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_30_test_date_generate(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_tz = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_date_new __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_date_now __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_date_generate", 1);

  /* "cytimes/utils.py":568
 * # datetime.date
 * def _test_date_generate() -> None:
 *     import datetime             # <<<<<<<<<<<<<<
 * 
 *     tz = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":570
 *     import datetime
 * 
 *     tz = datetime.timezone(datetime.timedelta(hours=23, minutes=59))             # <<<<<<<<<<<<<<
 * 
 *     # New
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hours, __pyx_int_23) < 0) __PYX_ERR(1, 570, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_minutes, __pyx_int_59) < 0) __PYX_ERR(1, 570, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":573
 * 
 *     # New
 *     assert datetime.date(1, 1, 1) == date_new()  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.date(1, 1, 1) == date_new(1)  # type: ignore
 *     assert datetime.date(1, 1, 1) == date_new(1, 1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_date_new(NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 573, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 573, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 573, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 573, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":574
 *     # New
 *     assert datetime.date(1, 1, 1) == date_new()  # type: ignore
 *     assert datetime.date(1, 1, 1) == date_new(1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.date(1, 1, 1) == date_new(1, 1)  # type: ignore
 *     assert datetime.date(1, 1, 1) == date_new(1, 1, 1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_date); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.year = 1;
    __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_date_new(&__pyx_t_8)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 574, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 574, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 574, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":575
 *     assert datetime.date(1, 1, 1) == date_new()  # type: ignore
 *     assert datetime.date(1, 1, 1) == date_new(1)  # type: ignore
 *     assert datetime.date(1, 1, 1) == date_new(1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.date(1, 1, 1) == date_new(1, 1, 1)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_date); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 575, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 575, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.year = 1;
    __pyx_t_8.month = 1;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_date_new(&__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 575, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 575, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 575, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 575, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 575, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":576
 *     assert datetime.date(1, 1, 1) == date_new(1)  # type: ignore
 *     assert datetime.date(1, 1, 1) == date_new(1, 1)  # type: ignore
 *     assert datetime.date(1, 1, 1) == date_new(1, 1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     # Now
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8.__pyx_n = 3;
    __pyx_t_8.year = 1;
    __pyx_t_8.month = 1;
    __pyx_t_8.day = 1;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_date_new(&__pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 576, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 576, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 576, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 576, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":579
 * 
 *     # Now
 *     assert datetime.date.today() == date_now()  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.date.today() == date_now(None)  # type: ignore
 *     assert datetime.datetime.now(UTC).date() == date_now(UTC)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_today); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __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_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 579, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_date_now(NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 579, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 579, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 579, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 579, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":580
 *     # Now
 *     assert datetime.date.today() == date_now()  # type: ignore
 *     assert datetime.date.today() == date_now(None)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime.now(UTC).date() == date_now(UTC)  # type: ignore
 *     assert datetime.datetime.now(tz).date() == date_now(tz)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_date); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_today); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 580, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_9.__pyx_n = 1;
    __pyx_t_9.tz = Py_None;
    __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_date_now(&__pyx_t_9)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 580, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 580, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 580, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 580, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":581
 *     assert datetime.date.today() == date_now()  # type: ignore
 *     assert datetime.date.today() == date_now(None)  # type: ignore
 *     assert datetime.datetime.now(UTC).date() == date_now(UTC)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime.now(tz).date() == date_now(tz)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_now); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __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_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_7cytimes_5utils_UTC)};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 581, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_date); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_4 = ((PyObject *)__pyx_v_7cytimes_5utils_UTC);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_9.__pyx_n = 1;
    __pyx_t_9.tz = __pyx_t_4;
    __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_date_now(&__pyx_t_9)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 581, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 581, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 581, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 581, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":582
 *     assert datetime.date.today() == date_now(None)  # type: ignore
 *     assert datetime.datetime.now(UTC).date() == date_now(UTC)  # type: ignore
 *     assert datetime.datetime.now(tz).date() == date_now(tz)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: date_generate")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_now); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_tz};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __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, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_t_9.__pyx_n = 1;
    __pyx_t_9.tz = __pyx_v_tz;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_date_now(&__pyx_t_9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 582, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 582, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 582, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 582, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":584
 *     assert datetime.datetime.now(tz).date() == date_now(tz)  # type: ignore
 * 
 *     print("Passed: date_generate")             # <<<<<<<<<<<<<<
 * 
 *     del datetime
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cytimes/utils.py":586
 *     print("Passed: date_generate")
 * 
 *     del datetime             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;

  /* "cytimes/utils.py":567
 * 
 * # datetime.date
 * def _test_date_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils._test_date_generate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":589
 * 
 * 
 * def _test_date_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_33_test_date_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_33_test_date_type_check = {"_test_date_type_check", (PyCFunction)__pyx_pw_7cytimes_5utils_33_test_date_type_check, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_33_test_date_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_date_type_check (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_32_test_date_type_check(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_32_test_date_type_check(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_CustomDate = NULL;
  PyObject *__pyx_v_date = 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;
  unsigned int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_date_type_check", 1);

  /* "cytimes/utils.py":590
 * 
 * def _test_date_type_check() -> None:
 *     import datetime             # <<<<<<<<<<<<<<
 * 
 *     class CustomDate(datetime.date):
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":592
 *     import datetime
 * 
 *     class CustomDate(datetime.date):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(1, 592, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_CustomDate, __pyx_n_s_test_date_type_check_locals_Cus, (PyObject *) NULL, __pyx_n_s_cytimes_utils, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_1 != __pyx_t_2) {
    if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(1, 592, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_CustomDate, __pyx_t_1, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_CustomDate = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":595
 *         pass
 * 
 *     date = datetime.date.today()             # <<<<<<<<<<<<<<
 *     assert is_date(date)  # type: ignore
 *     assert is_date_exact(date)  # type: ignore
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_date); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_today); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_v_date = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":596
 * 
 *     date = datetime.date.today()
 *     assert is_date(date)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert is_date_exact(date)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_6 = __pyx_f_7cytimes_5utils_is_date(__pyx_v_date); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 596, __pyx_L1_error)
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 596, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 596, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":597
 *     date = datetime.date.today()
 *     assert is_date(date)  # type: ignore
 *     assert is_date_exact(date)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     date = CustomDate(1, 1, 1)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_6 = __pyx_f_7cytimes_5utils_is_date_exact(__pyx_v_date); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 597, __pyx_L1_error)
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 597, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 597, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":599
 *     assert is_date_exact(date)  # type: ignore
 * 
 *     date = CustomDate(1, 1, 1)             # <<<<<<<<<<<<<<
 *     assert is_date(date)  # type: ignore
 *     assert not is_date_exact(date)  # type: ignore
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_CustomDate, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_date, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":600
 * 
 *     date = CustomDate(1, 1, 1)
 *     assert is_date(date)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert not is_date_exact(date)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_6 = __pyx_f_7cytimes_5utils_is_date(__pyx_v_date); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 600, __pyx_L1_error)
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 600, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 600, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":601
 *     date = CustomDate(1, 1, 1)
 *     assert is_date(date)  # type: ignore
 *     assert not is_date_exact(date)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: date_type_check")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_6 = __pyx_f_7cytimes_5utils_is_date_exact(__pyx_v_date); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 601, __pyx_L1_error)
    __pyx_t_7 = (!__pyx_t_6);
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 601, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 601, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":603
 *     assert not is_date_exact(date)  # type: ignore
 * 
 *     print("Passed: date_type_check")             # <<<<<<<<<<<<<<
 * 
 *     del CustomDate, datetime
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":605
 *     print("Passed: date_type_check")
 * 
 *     del CustomDate, datetime             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_CustomDate); __pyx_v_CustomDate = 0;
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;

  /* "cytimes/utils.py":589
 * 
 * 
 * def _test_date_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils._test_date_type_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_CustomDate);
  __Pyx_XDECREF(__pyx_v_date);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":608
 * 
 * 
 * def _test_date_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_35_test_date_conversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_35_test_date_conversion = {"_test_date_conversion", (PyCFunction)__pyx_pw_7cytimes_5utils_35_test_date_conversion, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_35_test_date_conversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_date_conversion (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_34_test_date_conversion(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_34_test_date_conversion(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_date = NULL;
  PyObject *__pyx_v_dt = NULL;
  struct tm __pyx_v__tm;
  PyObject *__pyx_v_CustomDate = NULL;
  PyDateTime_Date *__pyx_v_tmp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct tm __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  double __pyx_t_16;
  PY_LONG_LONG __pyx_t_17;
  int __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_date_conversion", 1);

  /* "cytimes/utils.py":609
 * 
 * def _test_date_conversion() -> None:
 *     import datetime             # <<<<<<<<<<<<<<
 * 
 *     date = datetime.date(2021, 1, 2)
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":611
 *     import datetime
 * 
 *     date = datetime.date(2021, 1, 2)             # <<<<<<<<<<<<<<
 *     dt = datetime.datetime(2021, 1, 2)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_date = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":612
 * 
 *     date = datetime.date(2021, 1, 2)
 *     dt = datetime.datetime(2021, 1, 2)             # <<<<<<<<<<<<<<
 * 
 *     _tm = date_to_tm(date)  # type: ignore
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_dt = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":614
 *     dt = datetime.datetime(2021, 1, 2)
 * 
 *     _tm = date_to_tm(date)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert tuple(date.timetuple()) == (
 *         _tm.tm_year,
 */
  if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_7cpython_8datetime_date))))) __PYX_ERR(1, 614, __pyx_L1_error)
  __pyx_t_3 = __pyx_f_7cytimes_5utils_date_to_tm(((PyDateTime_Date *)__pyx_v_date)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 614, __pyx_L1_error)
  __pyx_v__tm = __pyx_t_3;

  /* "cytimes/utils.py":615
 * 
 *     _tm = date_to_tm(date)  # type: ignore
 *     assert tuple(date.timetuple()) == (             # <<<<<<<<<<<<<<
 *         _tm.tm_year,
 *         _tm.tm_mon,
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_timetuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/utils.py":616
 *     _tm = date_to_tm(date)  # type: ignore
 *     assert tuple(date.timetuple()) == (
 *         _tm.tm_year,             # <<<<<<<<<<<<<<
 *         _tm.tm_mon,
 *         _tm.tm_mday,
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cytimes/utils.py":617
 *     assert tuple(date.timetuple()) == (
 *         _tm.tm_year,
 *         _tm.tm_mon,             # <<<<<<<<<<<<<<
 *         _tm.tm_mday,
 *         _tm.tm_hour,
 */
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_mon); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "cytimes/utils.py":618
 *         _tm.tm_year,
 *         _tm.tm_mon,
 *         _tm.tm_mday,             # <<<<<<<<<<<<<<
 *         _tm.tm_hour,
 *         _tm.tm_min,
 */
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_mday); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "cytimes/utils.py":619
 *         _tm.tm_mon,
 *         _tm.tm_mday,
 *         _tm.tm_hour,             # <<<<<<<<<<<<<<
 *         _tm.tm_min,
 *         _tm.tm_sec,
 */
    __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_hour); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 619, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);

    /* "cytimes/utils.py":620
 *         _tm.tm_mday,
 *         _tm.tm_hour,
 *         _tm.tm_min,             # <<<<<<<<<<<<<<
 *         _tm.tm_sec,
 *         _tm.tm_wday,
 */
    __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_min); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);

    /* "cytimes/utils.py":621
 *         _tm.tm_hour,
 *         _tm.tm_min,
 *         _tm.tm_sec,             # <<<<<<<<<<<<<<
 *         _tm.tm_wday,
 *         _tm.tm_yday,
 */
    __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_sec); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 621, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);

    /* "cytimes/utils.py":622
 *         _tm.tm_min,
 *         _tm.tm_sec,
 *         _tm.tm_wday,             # <<<<<<<<<<<<<<
 *         _tm.tm_yday,
 *         _tm.tm_isdst,
 */
    __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_wday); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 622, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);

    /* "cytimes/utils.py":623
 *         _tm.tm_sec,
 *         _tm.tm_wday,
 *         _tm.tm_yday,             # <<<<<<<<<<<<<<
 *         _tm.tm_isdst,
 *     )
 */
    __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_yday); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);

    /* "cytimes/utils.py":624
 *         _tm.tm_wday,
 *         _tm.tm_yday,
 *         _tm.tm_isdst,             # <<<<<<<<<<<<<<
 *     )
 *     assert "01/02/2021" == date_to_strformat(date, "%m/%d/%Y")  # type: ignore
 */
    __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_isdst); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);

    /* "cytimes/utils.py":616
 *     _tm = date_to_tm(date)  # type: ignore
 *     assert tuple(date.timetuple()) == (
 *         _tm.tm_year,             # <<<<<<<<<<<<<<
 *         _tm.tm_mon,
 *         _tm.tm_mday,
 */
    __pyx_t_13 = PyTuple_New(9); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_4)) __PYX_ERR(1, 616, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_6)) __PYX_ERR(1, 616, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_7)) __PYX_ERR(1, 616, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_8)) __PYX_ERR(1, 616, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_9);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_9)) __PYX_ERR(1, 616, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_10);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_10)) __PYX_ERR(1, 616, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_11);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_11)) __PYX_ERR(1, 616, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_12);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 8, __pyx_t_12)) __PYX_ERR(1, 616, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_4 = 0;
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_8 = 0;
    __pyx_t_9 = 0;
    __pyx_t_10 = 0;
    __pyx_t_11 = 0;
    __pyx_t_12 = 0;
    __pyx_t_12 = PyObject_RichCompare(__pyx_t_2, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 615, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

    /* "cytimes/utils.py":615
 * 
 *     _tm = date_to_tm(date)  # type: ignore
 *     assert tuple(date.timetuple()) == (             # <<<<<<<<<<<<<<
 *         _tm.tm_year,
 *         _tm.tm_mon,
 */
    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(1, 615, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_14)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 615, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 615, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":626
 *         _tm.tm_isdst,
 *     )
 *     assert "01/02/2021" == date_to_strformat(date, "%m/%d/%Y")  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "2021-01-02" == date_to_isoformat(date)  # type: ignore
 *     assert date.toordinal() == date_to_ordinal(date)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_7cpython_8datetime_date))))) __PYX_ERR(1, 626, __pyx_L1_error)
    __pyx_t_12 = __pyx_f_7cytimes_5utils_date_to_strformat(((PyDateTime_Date *)__pyx_v_date), __pyx_kp_u_m_d_Y); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 626, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_01_02_2021, __pyx_t_12, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(1, 626, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_14)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 626, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 626, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":627
 *     )
 *     assert "01/02/2021" == date_to_strformat(date, "%m/%d/%Y")  # type: ignore
 *     assert "2021-01-02" == date_to_isoformat(date)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert date.toordinal() == date_to_ordinal(date)  # type: ignore
 *     assert (date.toordinal() - EPOCH_DAY) * 86400 == date_to_seconds(date)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_7cpython_8datetime_date))))) __PYX_ERR(1, 627, __pyx_L1_error)
    __pyx_t_12 = __pyx_f_7cytimes_5utils_date_to_isoformat(((PyDateTime_Date *)__pyx_v_date)); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_14 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_2021_01_02, __pyx_t_12, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(1, 627, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_14)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 627, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 627, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":628
 *     assert "01/02/2021" == date_to_strformat(date, "%m/%d/%Y")  # type: ignore
 *     assert "2021-01-02" == date_to_isoformat(date)  # type: ignore
 *     assert date.toordinal() == date_to_ordinal(date)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert (date.toordinal() - EPOCH_DAY) * 86400 == date_to_seconds(date)  # type: ignore
 *     assert (date.toordinal() - EPOCH_DAY) * 86400_000000 == date_to_us(date)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_2 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_13))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_13);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_13, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 628, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    }
    if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_7cpython_8datetime_date))))) __PYX_ERR(1, 628, __pyx_L1_error)
    __pyx_t_15 = __pyx_f_7cytimes_5utils_date_to_ordinal(((PyDateTime_Date *)__pyx_v_date)); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(1, 628, __pyx_L1_error)
    __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_t_15); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_12, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 628, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(1, 628, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_14)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 628, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 628, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":629
 *     assert "2021-01-02" == date_to_isoformat(date)  # type: ignore
 *     assert date.toordinal() == date_to_ordinal(date)  # type: ignore
 *     assert (date.toordinal() - EPOCH_DAY) * 86400 == date_to_seconds(date)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert (date.toordinal() - EPOCH_DAY) * 86400_000000 == date_to_us(date)  # type: ignore
 *     assert int(dt.timestamp()) == date_to_ts(date)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_12 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_13))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_13, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    }
    __pyx_t_13 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_7cytimes_5utils_EPOCH_DAY); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_12 = PyNumber_Subtract(__pyx_t_2, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = __Pyx_PyInt_MultiplyObjC(__pyx_t_12, __pyx_int_86400, 0x15180, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_7cpython_8datetime_date))))) __PYX_ERR(1, 629, __pyx_L1_error)
    __pyx_t_16 = __pyx_f_7cytimes_5utils_date_to_seconds(((PyDateTime_Date *)__pyx_v_date)); if (unlikely(__pyx_t_16 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(1, 629, __pyx_L1_error)
    __pyx_t_12 = PyFloat_FromDouble(__pyx_t_16); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_13, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(1, 629, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_14)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 629, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 629, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":630
 *     assert date.toordinal() == date_to_ordinal(date)  # type: ignore
 *     assert (date.toordinal() - EPOCH_DAY) * 86400 == date_to_seconds(date)  # type: ignore
 *     assert (date.toordinal() - EPOCH_DAY) * 86400_000000 == date_to_us(date)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert int(dt.timestamp()) == date_to_ts(date)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 630, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 630, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __pyx_t_12 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_7cytimes_5utils_EPOCH_DAY); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 630, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = PyNumber_Subtract(__pyx_t_2, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 630, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_Multiply(__pyx_t_13, __pyx_int_86400000000); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 630, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_7cpython_8datetime_date))))) __PYX_ERR(1, 630, __pyx_L1_error)
    __pyx_t_17 = __pyx_f_7cytimes_5utils_date_to_us(((PyDateTime_Date *)__pyx_v_date)); if (unlikely(__pyx_t_17 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 630, __pyx_L1_error)
    __pyx_t_13 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_t_17); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 630, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_12, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 630, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(1, 630, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_14)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 630, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 630, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":631
 *     assert (date.toordinal() - EPOCH_DAY) * 86400 == date_to_seconds(date)  # type: ignore
 *     assert (date.toordinal() - EPOCH_DAY) * 86400_000000 == date_to_us(date)  # type: ignore
 *     assert int(dt.timestamp()) == date_to_ts(date)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     class CustomDate(datetime.date):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_12 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_13))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_13, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 631, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    }
    __pyx_t_13 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_7cpython_8datetime_date))))) __PYX_ERR(1, 631, __pyx_L1_error)
    __pyx_t_16 = __pyx_f_7cytimes_5utils_date_to_ts(((PyDateTime_Date *)__pyx_v_date)); if (unlikely(__pyx_t_16 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(1, 631, __pyx_L1_error)
    __pyx_t_2 = PyFloat_FromDouble(__pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_12 = PyObject_RichCompare(__pyx_t_13, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 631, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(1, 631, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_14)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 631, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 631, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":633
 *     assert int(dt.timestamp()) == date_to_ts(date)  # type: ignore
 * 
 *     class CustomDate(datetime.date):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_date); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_12)) __PYX_ERR(1, 633, __pyx_L1_error);
  __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_CalculateMetaclass(NULL, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_13, __pyx_t_12, __pyx_n_s_CustomDate, __pyx_n_s_test_date_conversion_locals_Cus, (PyObject *) NULL, __pyx_n_s_cytimes_utils, (PyObject *) NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__pyx_t_12 != __pyx_t_2) {
    if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(1, 633, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_13, __pyx_n_s_CustomDate, __pyx_t_12, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_CustomDate = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "cytimes/utils.py":636
 *         pass
 * 
 *     tmp = date_fr_date(CustomDate(2021, 1, 2))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert date == tmp and type(tmp) is datetime.date  # type: ignore
 * 
 */
  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_v_CustomDate, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_7cpython_8datetime_date))))) __PYX_ERR(1, 636, __pyx_L1_error)
  __pyx_t_13 = ((PyObject *)__pyx_f_7cytimes_5utils_date_fr_date(((PyDateTime_Date *)__pyx_t_12))); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_v_tmp = ((PyDateTime_Date *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "cytimes/utils.py":637
 * 
 *     tmp = date_fr_date(CustomDate(2021, 1, 2))  # type: ignore
 *     assert date == tmp and type(tmp) is datetime.date  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     tmp = date_fr_dt(dt)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_13 = PyObject_RichCompare(__pyx_v_date, ((PyObject *)__pyx_v_tmp), Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 637, __pyx_L1_error)
    __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(1, 637, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (__pyx_t_18) {
    } else {
      __pyx_t_14 = __pyx_t_18;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_date); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 637, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_18 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_tmp))) == __pyx_t_13);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = __pyx_t_18;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_14)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 637, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 637, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":639
 *     assert date == tmp and type(tmp) is datetime.date  # type: ignore
 * 
 *     tmp = date_fr_dt(dt)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert date == tmp and type(tmp) is datetime.date
 * 
 */
  if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 639, __pyx_L1_error)
  __pyx_t_13 = ((PyObject *)__pyx_f_7cytimes_5utils_date_fr_dt(((PyDateTime_DateTime *)__pyx_v_dt))); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF_SET(__pyx_v_tmp, ((PyDateTime_Date *)__pyx_t_13));
  __pyx_t_13 = 0;

  /* "cytimes/utils.py":640
 * 
 *     tmp = date_fr_dt(dt)  # type: ignore
 *     assert date == tmp and type(tmp) is datetime.date             # <<<<<<<<<<<<<<
 * 
 *     tmp = date_fr_ordinal(date.toordinal())  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_13 = PyObject_RichCompare(__pyx_v_date, ((PyObject *)__pyx_v_tmp), Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 640, __pyx_L1_error)
    __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(1, 640, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (__pyx_t_18) {
    } else {
      __pyx_t_14 = __pyx_t_18;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_date); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_18 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_tmp))) == __pyx_t_13);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = __pyx_t_18;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!__pyx_t_14)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 640, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 640, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":642
 *     assert date == tmp and type(tmp) is datetime.date
 * 
 *     tmp = date_fr_ordinal(date.toordinal())  # type: ignore             # <<<<<<<<<<<<<<
 *     assert date == tmp and type(tmp) is datetime.date
 * 
 */
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_11 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
    __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_13); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 642, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = ((PyObject *)__pyx_f_7cytimes_5utils_date_fr_ordinal(__pyx_t_15)); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF_SET(__pyx_v_tmp, ((PyDateTime_Date *)__pyx_t_13));
  __pyx_t_13 = 0;

  /* "cytimes/utils.py":643
 * 
 *     tmp = date_fr_ordinal(date.toordinal())  # type: ignore
 *     assert date == tmp and type(tmp) is datetime.date             # <<<<<<<<<<<<<<
 * 
 *     tmp = date_fr_seconds((date.toordinal() - EPOCH_DAY) * 86400)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_13 = PyObject_RichCompare(__pyx_v_date, ((PyObject *)__pyx_v_tmp), Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 643, __pyx_L1_error)
    __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(1, 643, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (__pyx_t_18) {
    } else {
      __pyx_t_14 = __pyx_t_18;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_date); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_18 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_tmp))) == __pyx_t_13);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = __pyx_t_18;
    __pyx_L7_bool_binop_done:;
    if (unlikely(!__pyx_t_14)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 643, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 643, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":645
 *     assert date == tmp and type(tmp) is datetime.date
 * 
 *     tmp = date_fr_seconds((date.toordinal() - EPOCH_DAY) * 86400)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert date == tmp and type(tmp) is datetime.date
 * 
 */
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_11 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
    __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __pyx_t_12 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_7cytimes_5utils_EPOCH_DAY); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_11 = PyNumber_Subtract(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyInt_MultiplyObjC(__pyx_t_11, __pyx_int_86400, 0x15180, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 645, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = ((PyObject *)__pyx_f_7cytimes_5utils_date_fr_seconds(__pyx_t_16)); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF_SET(__pyx_v_tmp, ((PyDateTime_Date *)__pyx_t_12));
  __pyx_t_12 = 0;

  /* "cytimes/utils.py":646
 * 
 *     tmp = date_fr_seconds((date.toordinal() - EPOCH_DAY) * 86400)  # type: ignore
 *     assert date == tmp and type(tmp) is datetime.date             # <<<<<<<<<<<<<<
 * 
 *     tmp = date_fr_us((date.toordinal() - EPOCH_DAY) * 86400_000000)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_12 = PyObject_RichCompare(__pyx_v_date, ((PyObject *)__pyx_v_tmp), Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 646, __pyx_L1_error)
    __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(1, 646, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (__pyx_t_18) {
    } else {
      __pyx_t_14 = __pyx_t_18;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_date); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_18 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_tmp))) == __pyx_t_12);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_14 = __pyx_t_18;
    __pyx_L9_bool_binop_done:;
    if (unlikely(!__pyx_t_14)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 646, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 646, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":648
 *     assert date == tmp and type(tmp) is datetime.date
 * 
 *     tmp = date_fr_us((date.toordinal() - EPOCH_DAY) * 86400_000000)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert date == tmp and type(tmp) is datetime.date
 * 
 */
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_date, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_13 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_11))) {
    __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
    if (likely(__pyx_t_13)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_11, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
    __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __pyx_t_11 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_7cytimes_5utils_EPOCH_DAY); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_13 = PyNumber_Subtract(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyNumber_Multiply(__pyx_t_13, __pyx_int_86400000000); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_17 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_11); if (unlikely((__pyx_t_17 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_date_fr_us(__pyx_t_17)); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF_SET(__pyx_v_tmp, ((PyDateTime_Date *)__pyx_t_11));
  __pyx_t_11 = 0;

  /* "cytimes/utils.py":649
 * 
 *     tmp = date_fr_us((date.toordinal() - EPOCH_DAY) * 86400_000000)  # type: ignore
 *     assert date == tmp and type(tmp) is datetime.date             # <<<<<<<<<<<<<<
 * 
 *     tmp = date_fr_ts(dt.timestamp())  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_11 = PyObject_RichCompare(__pyx_v_date, ((PyObject *)__pyx_v_tmp), Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 649, __pyx_L1_error)
    __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(1, 649, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (__pyx_t_18) {
    } else {
      __pyx_t_14 = __pyx_t_18;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_date); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_18 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_tmp))) == __pyx_t_11);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_14 = __pyx_t_18;
    __pyx_L11_bool_binop_done:;
    if (unlikely(!__pyx_t_14)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 649, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 649, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":651
 *     assert date == tmp and type(tmp) is datetime.date
 * 
 *     tmp = date_fr_ts(dt.timestamp())  # type: ignore             # <<<<<<<<<<<<<<
 *     assert date == tmp and type(tmp) is datetime.date
 * 
 */
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_12 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_13))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_13, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
    __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  }
  __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_date_fr_ts(__pyx_t_16)); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF_SET(__pyx_v_tmp, ((PyDateTime_Date *)__pyx_t_11));
  __pyx_t_11 = 0;

  /* "cytimes/utils.py":652
 * 
 *     tmp = date_fr_ts(dt.timestamp())  # type: ignore
 *     assert date == tmp and type(tmp) is datetime.date             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: date_conversion")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_11 = PyObject_RichCompare(__pyx_v_date, ((PyObject *)__pyx_v_tmp), Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 652, __pyx_L1_error)
    __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(1, 652, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (__pyx_t_18) {
    } else {
      __pyx_t_14 = __pyx_t_18;
      goto __pyx_L13_bool_binop_done;
    }
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_date); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_18 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_tmp))) == __pyx_t_11);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_14 = __pyx_t_18;
    __pyx_L13_bool_binop_done:;
    if (unlikely(!__pyx_t_14)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 652, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 652, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":654
 *     assert date == tmp and type(tmp) is datetime.date
 * 
 *     print("Passed: date_conversion")             # <<<<<<<<<<<<<<
 * 
 *     del CustomDate, datetime
 */
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cytimes/utils.py":656
 *     print("Passed: date_conversion")
 * 
 *     del CustomDate, datetime             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_CustomDate); __pyx_v_CustomDate = 0;
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;

  /* "cytimes/utils.py":608
 * 
 * 
 * def _test_date_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("cytimes.utils._test_date_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_date);
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XDECREF(__pyx_v_CustomDate);
  __Pyx_XDECREF((PyObject *)__pyx_v_tmp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":660
 * 
 * # datetime.datetime
 * def _test_dt_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_37_test_dt_generate(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_37_test_dt_generate = {"_test_dt_generate", (PyCFunction)__pyx_pw_7cytimes_5utils_37_test_dt_generate, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_37_test_dt_generate(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_dt_generate (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_36_test_dt_generate(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_36_test_dt_generate(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_tz = NULL;
  PyObject *__pyx_v_dt_n = NULL;
  PyObject *__pyx_v_dt_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_dt_new __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_dt_now __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_UCS4 __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_dt_generate", 1);

  /* "cytimes/utils.py":661
 * # datetime.datetime
 * def _test_dt_generate() -> None:
 *     import datetime             # <<<<<<<<<<<<<<
 * 
 *     tz = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":663
 *     import datetime
 * 
 *     tz = datetime.timezone(datetime.timedelta(hours=23, minutes=59))             # <<<<<<<<<<<<<<
 * 
 *     # New
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hours, __pyx_int_23) < 0) __PYX_ERR(1, 663, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_minutes, __pyx_int_59) < 0) __PYX_ERR(1, 663, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":666
 * 
 *     # New
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new()  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1, 1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_new(NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 666, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 666, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 666, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 666, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":667
 *     # New
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new()  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1, 1, 1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.year = 1;
    __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_new(&__pyx_t_8)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 667, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 667, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 667, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 667, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":668
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new()  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 0, 0, 0) == dt_new(1, 1, 1, 1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.year = 1;
    __pyx_t_8.month = 1;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_new(&__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 668, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 668, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 668, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 668, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":669
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1, 1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(1, 1, 1, 1, 0, 0, 0) == dt_new(1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 0, 0) == dt_new(1, 1, 1, 1, 1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8.__pyx_n = 3;
    __pyx_t_8.year = 1;
    __pyx_t_8.month = 1;
    __pyx_t_8.day = 1;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_new(&__pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 669, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 669, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 669, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 669, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":670
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 0, 0, 0) == dt_new(1, 1, 1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(1, 1, 1, 1, 1, 0, 0) == dt_new(1, 1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 0) == dt_new(1, 1, 1, 1, 1, 1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8.__pyx_n = 4;
    __pyx_t_8.year = 1;
    __pyx_t_8.month = 1;
    __pyx_t_8.day = 1;
    __pyx_t_8.hour = 1;
    __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_new(&__pyx_t_8)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 670, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 670, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 670, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 670, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":671
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 0, 0, 0) == dt_new(1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 0, 0) == dt_new(1, 1, 1, 1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 0) == dt_new(1, 1, 1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 1) == dt_new(1, 1, 1, 1, 1, 1, 1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8.__pyx_n = 5;
    __pyx_t_8.year = 1;
    __pyx_t_8.month = 1;
    __pyx_t_8.day = 1;
    __pyx_t_8.hour = 1;
    __pyx_t_8.minute = 1;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_new(&__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 671, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 671, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 671, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 671, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":672
 *     assert datetime.datetime(1, 1, 1, 1, 0, 0, 0) == dt_new(1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 0, 0) == dt_new(1, 1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 0) == dt_new(1, 1, 1, 1, 1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 1) == dt_new(1, 1, 1, 1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 1, tz) == dt_new(1, 1, 1, 1, 1, 1, 1, tz)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 672, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 672, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8.__pyx_n = 6;
    __pyx_t_8.year = 1;
    __pyx_t_8.month = 1;
    __pyx_t_8.day = 1;
    __pyx_t_8.hour = 1;
    __pyx_t_8.minute = 1;
    __pyx_t_8.second = 1;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_new(&__pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 672, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 672, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 672, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 672, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 672, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":673
 *     assert datetime.datetime(1, 1, 1, 1, 1, 0, 0) == dt_new(1, 1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 0) == dt_new(1, 1, 1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 1) == dt_new(1, 1, 1, 1, 1, 1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 1, tz) == dt_new(1, 1, 1, 1, 1, 1, 1, tz)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8.__pyx_n = 7;
    __pyx_t_8.year = 1;
    __pyx_t_8.month = 1;
    __pyx_t_8.day = 1;
    __pyx_t_8.hour = 1;
    __pyx_t_8.minute = 1;
    __pyx_t_8.second = 1;
    __pyx_t_8.microsecond = 1;
    __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_new(&__pyx_t_8)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 673, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 673, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 673, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 673, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":674
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 0) == dt_new(1, 1, 1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 1) == dt_new(1, 1, 1, 1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 1, tz) == dt_new(1, 1, 1, 1, 1, 1, 1, tz)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     # Now
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __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[9] = {__pyx_t_1, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_v_tz};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 8+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 674, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_8.__pyx_n = 8;
    __pyx_t_8.year = 1;
    __pyx_t_8.month = 1;
    __pyx_t_8.day = 1;
    __pyx_t_8.hour = 1;
    __pyx_t_8.minute = 1;
    __pyx_t_8.second = 1;
    __pyx_t_8.microsecond = 1;
    __pyx_t_8.tz = __pyx_v_tz;
    __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_new(&__pyx_t_8)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 674, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 674, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 674, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 674, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":678
 *     # Now
 *     for dt_n, dt_c in (
 *         (datetime.datetime.now(), dt_now()),  # type: ignore             # <<<<<<<<<<<<<<
 *         (datetime.datetime.now(), dt_now(None)),  # type: ignore
 *         (datetime.datetime.now(UTC), dt_now(UTC)),  # type: ignore
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_now); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_now(NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(1, 678, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(1, 678, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":679
 *     for dt_n, dt_c in (
 *         (datetime.datetime.now(), dt_now()),  # type: ignore
 *         (datetime.datetime.now(), dt_now(None)),  # type: ignore             # <<<<<<<<<<<<<<
 *         (datetime.datetime.now(UTC), dt_now(UTC)),  # type: ignore
 *         (datetime.datetime.now(tz), dt_now(tz)),  # type: ignore
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_now); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __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_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.tz = Py_None;
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_now(&__pyx_t_9)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(1, 679, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":680
 *         (datetime.datetime.now(), dt_now()),  # type: ignore
 *         (datetime.datetime.now(), dt_now(None)),  # type: ignore
 *         (datetime.datetime.now(UTC), dt_now(UTC)),  # type: ignore             # <<<<<<<<<<<<<<
 *         (datetime.datetime.now(tz), dt_now(tz)),  # type: ignore
 *     ):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_now); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_7cytimes_5utils_UTC)};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 680, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_3 = ((PyObject *)__pyx_v_7cytimes_5utils_UTC);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.tz = __pyx_t_3;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_now(&__pyx_t_9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 680, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(1, 680, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":681
 *         (datetime.datetime.now(), dt_now(None)),  # type: ignore
 *         (datetime.datetime.now(UTC), dt_now(UTC)),  # type: ignore
 *         (datetime.datetime.now(tz), dt_now(tz)),  # type: ignore             # <<<<<<<<<<<<<<
 *     ):
 *         assert (
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_now); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_tz};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.tz = __pyx_v_tz;
  __pyx_t_10 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_now(&__pyx_t_9)); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(1, 681, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10)) __PYX_ERR(1, 681, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_10 = 0;

  /* "cytimes/utils.py":678
 *     # Now
 *     for dt_n, dt_c in (
 *         (datetime.datetime.now(), dt_now()),  # type: ignore             # <<<<<<<<<<<<<<
 *         (datetime.datetime.now(), dt_now(None)),  # type: ignore
 *         (datetime.datetime.now(UTC), dt_now(UTC)),  # type: ignore
 */
  __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5)) __PYX_ERR(1, 678, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1)) __PYX_ERR(1, 678, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_3)) __PYX_ERR(1, 678, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_4)) __PYX_ERR(1, 678, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":677
 * 
 *     # Now
 *     for dt_n, dt_c in (             # <<<<<<<<<<<<<<
 *         (datetime.datetime.now(), dt_now()),  # type: ignore
 *         (datetime.datetime.now(), dt_now(None)),  # type: ignore
 */
  __pyx_t_4 = __pyx_t_10; __Pyx_INCREF(__pyx_t_4);
  __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  for (;;) {
    if (__pyx_t_11 >= 4) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_10); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(1, 677, __pyx_L1_error)
    #else
    __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    #endif
    if (likely(__pyx_t_10 != Py_None)) {
      PyObject* sequence = __pyx_t_10;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(1, 677, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 677, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 677, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    } else {
      __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 677, __pyx_L1_error)
    }
    __Pyx_XDECREF_SET(__pyx_v_dt_n, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_dt_c, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/utils.py":683
 *         (datetime.datetime.now(tz), dt_now(tz)),  # type: ignore
 *     ):
 *         assert (             # <<<<<<<<<<<<<<
 *             (dt_n.year == dt_c.year)
 *             and (dt_n.month == dt_c.month)
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {

      /* "cytimes/utils.py":684
 *     ):
 *         assert (
 *             (dt_n.year == dt_c.year)             # <<<<<<<<<<<<<<
 *             and (dt_n.month == dt_c.month)
 *             and (dt_n.day == dt_c.day)
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_n, __pyx_n_s_year); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 684, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_c, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 684, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_10, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 684, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(1, 684, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_12) {
      } else {
        __pyx_t_7 = __pyx_t_12;
        goto __pyx_L5_bool_binop_done;
      }

      /* "cytimes/utils.py":685
 *         assert (
 *             (dt_n.year == dt_c.year)
 *             and (dt_n.month == dt_c.month)             # <<<<<<<<<<<<<<
 *             and (dt_n.day == dt_c.day)
 *             and (dt_n.hour == dt_c.hour)
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_n, __pyx_n_s_month); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 685, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_c, __pyx_n_s_month); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 685, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 685, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(1, 685, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (__pyx_t_12) {
      } else {
        __pyx_t_7 = __pyx_t_12;
        goto __pyx_L5_bool_binop_done;
      }

      /* "cytimes/utils.py":686
 *             (dt_n.year == dt_c.year)
 *             and (dt_n.month == dt_c.month)
 *             and (dt_n.day == dt_c.day)             # <<<<<<<<<<<<<<
 *             and (dt_n.hour == dt_c.hour)
 *             and (dt_n.minute == dt_c.minute)
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_n, __pyx_n_s_day); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_c, __pyx_n_s_day); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_10, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 686, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(1, 686, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_12) {
      } else {
        __pyx_t_7 = __pyx_t_12;
        goto __pyx_L5_bool_binop_done;
      }

      /* "cytimes/utils.py":687
 *             and (dt_n.month == dt_c.month)
 *             and (dt_n.day == dt_c.day)
 *             and (dt_n.hour == dt_c.hour)             # <<<<<<<<<<<<<<
 *             and (dt_n.minute == dt_c.minute)
 *             and (dt_n.second == dt_c.second)
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_n, __pyx_n_s_hour); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_c, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 687, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(1, 687, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (__pyx_t_12) {
      } else {
        __pyx_t_7 = __pyx_t_12;
        goto __pyx_L5_bool_binop_done;
      }

      /* "cytimes/utils.py":688
 *             and (dt_n.day == dt_c.day)
 *             and (dt_n.hour == dt_c.hour)
 *             and (dt_n.minute == dt_c.minute)             # <<<<<<<<<<<<<<
 *             and (dt_n.second == dt_c.second)
 *             and (-1000 < dt_n.microsecond - dt_c.microsecond < 1000)
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_n, __pyx_n_s_minute); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_c, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_10, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 688, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(1, 688, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_12) {
      } else {
        __pyx_t_7 = __pyx_t_12;
        goto __pyx_L5_bool_binop_done;
      }

      /* "cytimes/utils.py":689
 *             and (dt_n.hour == dt_c.hour)
 *             and (dt_n.minute == dt_c.minute)
 *             and (dt_n.second == dt_c.second)             # <<<<<<<<<<<<<<
 *             and (-1000 < dt_n.microsecond - dt_c.microsecond < 1000)
 *             and (dt_n.tzinfo == dt_c.tzinfo)
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_n, __pyx_n_s_second); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 689, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_c, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 689, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 689, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(1, 689, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (__pyx_t_12) {
      } else {
        __pyx_t_7 = __pyx_t_12;
        goto __pyx_L5_bool_binop_done;
      }

      /* "cytimes/utils.py":690
 *             and (dt_n.minute == dt_c.minute)
 *             and (dt_n.second == dt_c.second)
 *             and (-1000 < dt_n.microsecond - dt_c.microsecond < 1000)             # <<<<<<<<<<<<<<
 *             and (dt_n.tzinfo == dt_c.tzinfo)
 *         ), f"{dt_n} != {dt_c}"
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_n, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 690, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_c, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 690, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyNumber_Subtract(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 690, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_RichCompare(__pyx_int_neg_1000, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 690, __pyx_L1_error)
      if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
        __Pyx_DECREF(__pyx_t_1);
        __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_int_1000, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 690, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(1, 690, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_12) {
      } else {
        __pyx_t_7 = __pyx_t_12;
        goto __pyx_L5_bool_binop_done;
      }

      /* "cytimes/utils.py":691
 *             and (dt_n.second == dt_c.second)
 *             and (-1000 < dt_n.microsecond - dt_c.microsecond < 1000)
 *             and (dt_n.tzinfo == dt_c.tzinfo)             # <<<<<<<<<<<<<<
 *         ), f"{dt_n} != {dt_c}"
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_n, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_c, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 691, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(1, 691, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_7 = __pyx_t_12;
      __pyx_L5_bool_binop_done:;
      if (unlikely(!__pyx_t_7)) {

        /* "cytimes/utils.py":692
 *             and (-1000 < dt_n.microsecond - dt_c.microsecond < 1000)
 *             and (dt_n.tzinfo == dt_c.tzinfo)
 *         ), f"{dt_n} != {dt_c}"             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: dt_generate")
 */
        __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 692, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_13 = 0;
        __pyx_t_14 = 127;
        __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_dt_n, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 692, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_14;
        __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
        __pyx_t_3 = 0;
        __Pyx_INCREF(__pyx_kp_u__38);
        __pyx_t_13 += 4;
        __Pyx_GIVEREF(__pyx_kp_u__38);
        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_kp_u__38);
        __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_dt_c, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 692, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_14;
        __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 692, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_3, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(1, 683, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 683, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":677
 * 
 *     # Now
 *     for dt_n, dt_c in (             # <<<<<<<<<<<<<<
 *         (datetime.datetime.now(), dt_now()),  # type: ignore
 *         (datetime.datetime.now(), dt_now(None)),  # type: ignore
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":694
 *         ), f"{dt_n} != {dt_c}"
 * 
 *     print("Passed: dt_generate")             # <<<<<<<<<<<<<<
 * 
 *     del datetime
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":696
 *     print("Passed: dt_generate")
 * 
 *     del datetime             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;

  /* "cytimes/utils.py":660
 * 
 * # datetime.datetime
 * def _test_dt_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytimes.utils._test_dt_generate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XDECREF(__pyx_v_dt_n);
  __Pyx_XDECREF(__pyx_v_dt_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":699
 * 
 * 
 * def _test_dt_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_39_test_dt_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_39_test_dt_type_check = {"_test_dt_type_check", (PyCFunction)__pyx_pw_7cytimes_5utils_39_test_dt_type_check, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_39_test_dt_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_dt_type_check (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_38_test_dt_type_check(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_38_test_dt_type_check(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_CustomDateTime = NULL;
  PyObject *__pyx_v_dt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_dt_type_check", 1);

  /* "cytimes/utils.py":700
 * 
 * def _test_dt_type_check() -> None:
 *     import datetime             # <<<<<<<<<<<<<<
 * 
 *     class CustomDateTime(datetime.datetime):
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":702
 *     import datetime
 * 
 *     class CustomDateTime(datetime.datetime):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(1, 702, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_CustomDateTime, __pyx_n_s_test_dt_type_check_locals_Custo, (PyObject *) NULL, __pyx_n_s_cytimes_utils, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_1 != __pyx_t_2) {
    if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(1, 702, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_CustomDateTime, __pyx_t_1, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_CustomDateTime = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":705
 *         pass
 * 
 *     dt = datetime.datetime.now()             # <<<<<<<<<<<<<<
 *     assert is_dt(dt)  # type: ignore
 *     assert is_dt_exact(dt)  # type: ignore
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_now); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 705, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_v_dt = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":706
 * 
 *     dt = datetime.datetime.now()
 *     assert is_dt(dt)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert is_dt_exact(dt)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_6 = __pyx_f_7cytimes_5utils_is_dt(__pyx_v_dt); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 706, __pyx_L1_error)
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 706, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 706, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":707
 *     dt = datetime.datetime.now()
 *     assert is_dt(dt)  # type: ignore
 *     assert is_dt_exact(dt)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     dt = CustomDateTime(1, 1, 1)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_6 = __pyx_f_7cytimes_5utils_is_dt_exact(__pyx_v_dt); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 707, __pyx_L1_error)
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 707, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 707, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":709
 *     assert is_dt_exact(dt)  # type: ignore
 * 
 *     dt = CustomDateTime(1, 1, 1)             # <<<<<<<<<<<<<<
 *     assert is_dt(dt)  # type: ignore
 *     assert not is_dt_exact(dt)  # type: ignore
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_CustomDateTime, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":710
 * 
 *     dt = CustomDateTime(1, 1, 1)
 *     assert is_dt(dt)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert not is_dt_exact(dt)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_6 = __pyx_f_7cytimes_5utils_is_dt(__pyx_v_dt); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 710, __pyx_L1_error)
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 710, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 710, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":711
 *     dt = CustomDateTime(1, 1, 1)
 *     assert is_dt(dt)  # type: ignore
 *     assert not is_dt_exact(dt)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: dt_type_check")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_6 = __pyx_f_7cytimes_5utils_is_dt_exact(__pyx_v_dt); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 711, __pyx_L1_error)
    __pyx_t_7 = (!__pyx_t_6);
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 711, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 711, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":713
 *     assert not is_dt_exact(dt)  # type: ignore
 * 
 *     print("Passed: dt_type_check")             # <<<<<<<<<<<<<<
 * 
 *     del CustomDateTime, datetime
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":715
 *     print("Passed: dt_type_check")
 * 
 *     del CustomDateTime, datetime             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_CustomDateTime); __pyx_v_CustomDateTime = 0;
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;

  /* "cytimes/utils.py":699
 * 
 * 
 * def _test_dt_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils._test_dt_type_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_CustomDateTime);
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":718
 * 
 * 
 * def _test_dt_tzinfo() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_41_test_dt_tzinfo(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_41_test_dt_tzinfo = {"_test_dt_tzinfo", (PyCFunction)__pyx_pw_7cytimes_5utils_41_test_dt_tzinfo, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_41_test_dt_tzinfo(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_dt_tzinfo (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_40_test_dt_tzinfo(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_40_test_dt_tzinfo(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_ZoneInfo = NULL;
  PyObject *__pyx_v_dt = NULL;
  PyObject *__pyx_v_tz = NULL;
  PyObject *__pyx_v_dt_tz1 = NULL;
  PyObject *__pyx_v_dt_tz2 = NULL;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_dt_tzinfo", 1);

  /* "cytimes/utils.py":719
 * 
 * def _test_dt_tzinfo() -> None:
 *     import datetime             # <<<<<<<<<<<<<<
 *     from zoneinfo import ZoneInfo
 * 
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":720
 * def _test_dt_tzinfo() -> None:
 *     import datetime
 *     from zoneinfo import ZoneInfo             # <<<<<<<<<<<<<<
 * 
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_ZoneInfo);
  __Pyx_GIVEREF(__pyx_n_s_ZoneInfo);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ZoneInfo)) __PYX_ERR(1, 720, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_zoneinfo, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ZoneInfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_ZoneInfo = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":722
 *     from zoneinfo import ZoneInfo
 * 
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)             # <<<<<<<<<<<<<<
 *     tz = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     dt_tz1 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_dt = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":723
 * 
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)
 *     tz = datetime.timezone(datetime.timedelta(hours=1, minutes=1))             # <<<<<<<<<<<<<<
 *     dt_tz1 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz)
 *     dt_tz2 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, ZoneInfo("CET"))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hours, __pyx_int_1) < 0) __PYX_ERR(1, 723, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_minutes, __pyx_int_1) < 0) __PYX_ERR(1, 723, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":724
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)
 *     tz = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     dt_tz1 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz)             # <<<<<<<<<<<<<<
 *     dt_tz2 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, ZoneInfo("CET"))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[9] = {__pyx_t_5, __pyx_int_2021, __pyx_int_1, __pyx_int_2, __pyx_int_3, __pyx_int_4, __pyx_int_5, __pyx_int_6, __pyx_v_tz};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 8+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_dt_tz1 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":725
 *     tz = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     dt_tz1 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz)
 *     dt_tz2 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, ZoneInfo("CET"))             # <<<<<<<<<<<<<<
 * 
 *     for t in (dt, dt_tz1, dt_tz2):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_ZoneInfo);
  __pyx_t_4 = __pyx_v_ZoneInfo; __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_u_CET};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[9] = {__pyx_t_4, __pyx_int_2021, __pyx_int_1, __pyx_int_2, __pyx_int_3, __pyx_int_4, __pyx_int_5, __pyx_int_6, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 8+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_dt_tz2 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":727
 *     dt_tz2 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, ZoneInfo("CET"))
 * 
 *     for t in (dt, dt_tz1, dt_tz2):             # <<<<<<<<<<<<<<
 *         assert t.tzname() == dt_tzname(t)  # type: ignore
 *         assert t.dst() == dt_dst(t)  # type: ignore
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_dt);
  __Pyx_GIVEREF(__pyx_v_dt);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dt)) __PYX_ERR(1, 727, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_dt_tz1);
  __Pyx_GIVEREF(__pyx_v_dt_tz1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_dt_tz1)) __PYX_ERR(1, 727, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_dt_tz2);
  __Pyx_GIVEREF(__pyx_v_dt_tz2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_dt_tz2)) __PYX_ERR(1, 727, __pyx_L1_error);
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
  __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_7 >= 3) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(1, 727, __pyx_L1_error)
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/utils.py":728
 * 
 *     for t in (dt, dt_tz1, dt_tz2):
 *         assert t.tzname() == dt_tzname(t)  # type: ignore             # <<<<<<<<<<<<<<
 *         assert t.dst() == dt_dst(t)  # type: ignore
 *         assert t.utcoffset() == dt_utcoffset(t)  # type: ignore
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_tzname); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 728, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 728, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      if (!(likely(((__pyx_v_t) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 728, __pyx_L1_error)
      __pyx_t_5 = __pyx_f_7cytimes_5utils_dt_tzname(((PyDateTime_DateTime *)__pyx_v_t)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 728, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_t_5, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 728, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_8)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 728, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 728, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":729
 *     for t in (dt, dt_tz1, dt_tz2):
 *         assert t.tzname() == dt_tzname(t)  # type: ignore
 *         assert t.dst() == dt_dst(t)  # type: ignore             # <<<<<<<<<<<<<<
 *         assert t.utcoffset() == dt_utcoffset(t)  # type: ignore
 * 
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_dst); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 729, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 729, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      if (!(likely(((__pyx_v_t) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 729, __pyx_L1_error)
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_dst(((PyDateTime_DateTime *)__pyx_v_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 729, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 729, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 729, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_8)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 729, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 729, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":730
 *         assert t.tzname() == dt_tzname(t)  # type: ignore
 *         assert t.dst() == dt_dst(t)  # type: ignore
 *         assert t.utcoffset() == dt_utcoffset(t)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: dt_tzinfo")
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 730, __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, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 730, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      if (!(likely(((__pyx_v_t) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 730, __pyx_L1_error)
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_utcoffset(((PyDateTime_DateTime *)__pyx_v_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 730, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 730, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_8)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 730, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 730, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":727
 *     dt_tz2 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, ZoneInfo("CET"))
 * 
 *     for t in (dt, dt_tz1, dt_tz2):             # <<<<<<<<<<<<<<
 *         assert t.tzname() == dt_tzname(t)  # type: ignore
 *         assert t.dst() == dt_dst(t)  # type: ignore
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":732
 *         assert t.utcoffset() == dt_utcoffset(t)  # type: ignore
 * 
 *     print("Passed: dt_tzinfo")             # <<<<<<<<<<<<<<
 * 
 *     del datetime, ZoneInfo
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":734
 *     print("Passed: dt_tzinfo")
 * 
 *     del datetime, ZoneInfo             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;
  __Pyx_DECREF(__pyx_v_ZoneInfo); __pyx_v_ZoneInfo = 0;

  /* "cytimes/utils.py":718
 * 
 * 
 * def _test_dt_tzinfo() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils._test_dt_tzinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_ZoneInfo);
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XDECREF(__pyx_v_dt_tz1);
  __Pyx_XDECREF(__pyx_v_dt_tz2);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":737
 * 
 * 
 * def _test_dt_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_43_test_dt_conversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_43_test_dt_conversion = {"_test_dt_conversion", (PyCFunction)__pyx_pw_7cytimes_5utils_43_test_dt_conversion, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_43_test_dt_conversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_dt_conversion (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_42_test_dt_conversion(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_42_test_dt_conversion(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_ZoneInfo = NULL;
  PyObject *__pyx_v_Timestamp = NULL;
  PyObject *__pyx_v_dt = NULL;
  PyObject *__pyx_v_tz1 = NULL;
  PyObject *__pyx_v_dt_tz1 = NULL;
  PyObject *__pyx_v_tz2 = NULL;
  PyObject *__pyx_v_dt_tz2 = NULL;
  PyObject *__pyx_v_tz3 = NULL;
  PyObject *__pyx_v_dt_tz3 = NULL;
  PyObject *__pyx_v_dt_tz4 = NULL;
  PyObject *__pyx_v_d = NULL;
  struct tm __pyx_v__tm;
  PyObject *__pyx_v_secs = NULL;
  PyObject *__pyx_v_offset = NULL;
  PyObject *__pyx_v_us = NULL;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_v_date = NULL;
  PyObject *__pyx_v_time1 = NULL;
  PyObject *__pyx_v_time2 = NULL;
  PyObject *__pyx_v_tmp = NULL;
  PyObject *__pyx_v_tmp1 = NULL;
  PyObject *__pyx_v_tmp2 = NULL;
  PyObject *__pyx_v_tmp3 = NULL;
  PyObject *__pyx_v_tz4 = NULL;
  PyObject *__pyx_v_tz = NULL;
  PyObject *__pyx_v_dt_ = NULL;
  PyObject *__pyx_v_ts = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  struct tm __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_tm __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_isoformat __pyx_t_18;
  int __pyx_t_19;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal __pyx_t_20;
  double __pyx_t_21;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_seconds __pyx_t_22;
  PY_LONG_LONG __pyx_t_23;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_us __pyx_t_24;
  struct __pyx_opt_args_7cytimes_5utils_dt_combine __pyx_t_25;
  struct __pyx_opt_args_7cytimes_5utils_dt_fr_date __pyx_t_26;
  struct __pyx_opt_args_7cytimes_5utils_dt_fr_seconds __pyx_t_27;
  struct __pyx_opt_args_7cytimes_5utils_dt_fr_us __pyx_t_28;
  struct __pyx_opt_args_7cytimes_5utils_dt_fr_ts __pyx_t_29;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_dt_conversion", 1);

  /* "cytimes/utils.py":738
 * 
 * def _test_dt_conversion() -> None:
 *     import datetime             # <<<<<<<<<<<<<<
 *     from zoneinfo import ZoneInfo
 *     from pandas import Timestamp
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":739
 * def _test_dt_conversion() -> None:
 *     import datetime
 *     from zoneinfo import ZoneInfo             # <<<<<<<<<<<<<<
 *     from pandas import Timestamp
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_ZoneInfo);
  __Pyx_GIVEREF(__pyx_n_s_ZoneInfo);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ZoneInfo)) __PYX_ERR(1, 739, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_zoneinfo, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ZoneInfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_ZoneInfo = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":740
 *     import datetime
 *     from zoneinfo import ZoneInfo
 *     from pandas import Timestamp             # <<<<<<<<<<<<<<
 * 
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_Timestamp);
  __Pyx_GIVEREF(__pyx_n_s_Timestamp);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Timestamp)) __PYX_ERR(1, 740, __pyx_L1_error);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_Timestamp = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":742
 *     from pandas import Timestamp
 * 
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)             # <<<<<<<<<<<<<<
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     dt_tz1 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz1)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dt = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":743
 * 
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))             # <<<<<<<<<<<<<<
 *     dt_tz1 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz1)
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hours, __pyx_int_1) < 0) __PYX_ERR(1, 743, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_minutes, __pyx_int_1) < 0) __PYX_ERR(1, 743, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_tz1 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":744
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     dt_tz1 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz1)             # <<<<<<<<<<<<<<
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 *     dt_tz2 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz2)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 744, __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[9] = {__pyx_t_5, __pyx_int_2021, __pyx_int_1, __pyx_int_2, __pyx_int_3, __pyx_int_4, __pyx_int_5, __pyx_int_6, __pyx_v_tz1};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 8+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_dt_tz1 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":745
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     dt_tz1 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz1)
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))             # <<<<<<<<<<<<<<
 *     dt_tz2 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz2)
 *     tz3 = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hours, __pyx_int_23) < 0) __PYX_ERR(1, 745, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_minutes, __pyx_int_59) < 0) __PYX_ERR(1, 745, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_tz2 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":746
 *     dt_tz1 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz1)
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 *     dt_tz2 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz2)             # <<<<<<<<<<<<<<
 *     tz3 = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))
 *     dt_tz3 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz3)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[9] = {__pyx_t_3, __pyx_int_2021, __pyx_int_1, __pyx_int_2, __pyx_int_3, __pyx_int_4, __pyx_int_5, __pyx_int_6, __pyx_v_tz2};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 8+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_dt_tz2 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":747
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 *     dt_tz2 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz2)
 *     tz3 = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))             # <<<<<<<<<<<<<<
 *     dt_tz3 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz3)
 *     dt_tz4 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, ZoneInfo("CET"))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hours, __pyx_int_neg_23) < 0) __PYX_ERR(1, 747, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_minutes, __pyx_int_neg_59) < 0) __PYX_ERR(1, 747, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 747, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_tz3 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":748
 *     dt_tz2 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz2)
 *     tz3 = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))
 *     dt_tz3 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz3)             # <<<<<<<<<<<<<<
 *     dt_tz4 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, ZoneInfo("CET"))
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __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[9] = {__pyx_t_5, __pyx_int_2021, __pyx_int_1, __pyx_int_2, __pyx_int_3, __pyx_int_4, __pyx_int_5, __pyx_int_6, __pyx_v_tz3};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 8+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_dt_tz3 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":749
 *     tz3 = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))
 *     dt_tz3 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz3)
 *     dt_tz4 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, ZoneInfo("CET"))             # <<<<<<<<<<<<<<
 * 
 *     for d in (dt, dt_tz1, dt_tz2, dt_tz3, dt_tz4):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_ZoneInfo);
  __pyx_t_4 = __pyx_v_ZoneInfo; __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_u_CET};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[9] = {__pyx_t_4, __pyx_int_2021, __pyx_int_1, __pyx_int_2, __pyx_int_3, __pyx_int_4, __pyx_int_5, __pyx_int_6, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 8+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_dt_tz4 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":751
 *     dt_tz4 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, ZoneInfo("CET"))
 * 
 *     for d in (dt, dt_tz1, dt_tz2, dt_tz3, dt_tz4):             # <<<<<<<<<<<<<<
 *         _tm = dt_to_tm(d, False)  # type: ignore
 *         assert tuple(d.timetuple()) == (
 */
  __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_dt);
  __Pyx_GIVEREF(__pyx_v_dt);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_dt)) __PYX_ERR(1, 751, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_dt_tz1);
  __Pyx_GIVEREF(__pyx_v_dt_tz1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_dt_tz1)) __PYX_ERR(1, 751, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_dt_tz2);
  __Pyx_GIVEREF(__pyx_v_dt_tz2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_dt_tz2)) __PYX_ERR(1, 751, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_dt_tz3);
  __Pyx_GIVEREF(__pyx_v_dt_tz3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_dt_tz3)) __PYX_ERR(1, 751, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_dt_tz4);
  __Pyx_GIVEREF(__pyx_v_dt_tz4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_dt_tz4)) __PYX_ERR(1, 751, __pyx_L1_error);
  __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_7 >= 5) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(1, 751, __pyx_L1_error)
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/utils.py":752
 * 
 *     for d in (dt, dt_tz1, dt_tz2, dt_tz3, dt_tz4):
 *         _tm = dt_to_tm(d, False)  # type: ignore             # <<<<<<<<<<<<<<
 *         assert tuple(d.timetuple()) == (
 *             _tm.tm_year,
 */
    if (!(likely(((__pyx_v_d) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_d, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 752, __pyx_L1_error)
    __pyx_t_9.__pyx_n = 1;
    __pyx_t_9.utc = 0;
    __pyx_t_8 = __pyx_f_7cytimes_5utils_dt_to_tm(((PyDateTime_DateTime *)__pyx_v_d), &__pyx_t_9); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 752, __pyx_L1_error)
    __pyx_v__tm = __pyx_t_8;

    /* "cytimes/utils.py":753
 *     for d in (dt, dt_tz1, dt_tz2, dt_tz3, dt_tz4):
 *         _tm = dt_to_tm(d, False)  # type: ignore
 *         assert tuple(d.timetuple()) == (             # <<<<<<<<<<<<<<
 *             _tm.tm_year,
 *             _tm.tm_mon,
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_timetuple); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 753, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 753, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 753, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cytimes/utils.py":754
 *         _tm = dt_to_tm(d, False)  # type: ignore
 *         assert tuple(d.timetuple()) == (
 *             _tm.tm_year,             # <<<<<<<<<<<<<<
 *             _tm.tm_mon,
 *             _tm.tm_mday,
 */
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_year); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 754, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "cytimes/utils.py":755
 *         assert tuple(d.timetuple()) == (
 *             _tm.tm_year,
 *             _tm.tm_mon,             # <<<<<<<<<<<<<<
 *             _tm.tm_mday,
 *             _tm.tm_hour,
 */
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_mon); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 755, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "cytimes/utils.py":756
 *             _tm.tm_year,
 *             _tm.tm_mon,
 *             _tm.tm_mday,             # <<<<<<<<<<<<<<
 *             _tm.tm_hour,
 *             _tm.tm_min,
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_mday); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 756, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "cytimes/utils.py":757
 *             _tm.tm_mon,
 *             _tm.tm_mday,
 *             _tm.tm_hour,             # <<<<<<<<<<<<<<
 *             _tm.tm_min,
 *             _tm.tm_sec,
 */
      __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_hour); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 757, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);

      /* "cytimes/utils.py":758
 *             _tm.tm_mday,
 *             _tm.tm_hour,
 *             _tm.tm_min,             # <<<<<<<<<<<<<<
 *             _tm.tm_sec,
 *             _tm.tm_wday,
 */
      __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_min); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 758, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);

      /* "cytimes/utils.py":759
 *             _tm.tm_hour,
 *             _tm.tm_min,
 *             _tm.tm_sec,             # <<<<<<<<<<<<<<
 *             _tm.tm_wday,
 *             _tm.tm_yday,
 */
      __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_sec); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);

      /* "cytimes/utils.py":760
 *             _tm.tm_min,
 *             _tm.tm_sec,
 *             _tm.tm_wday,             # <<<<<<<<<<<<<<
 *             _tm.tm_yday,
 *             _tm.tm_isdst,
 */
      __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_wday); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);

      /* "cytimes/utils.py":761
 *             _tm.tm_sec,
 *             _tm.tm_wday,
 *             _tm.tm_yday,             # <<<<<<<<<<<<<<
 *             _tm.tm_isdst,
 *         )
 */
      __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_yday); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);

      /* "cytimes/utils.py":762
 *             _tm.tm_wday,
 *             _tm.tm_yday,
 *             _tm.tm_isdst,             # <<<<<<<<<<<<<<
 *         )
 *         _tm = dt_to_tm(d, True)  # type: ignore
 */
      __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_isdst); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 762, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);

      /* "cytimes/utils.py":754
 *         _tm = dt_to_tm(d, False)  # type: ignore
 *         assert tuple(d.timetuple()) == (
 *             _tm.tm_year,             # <<<<<<<<<<<<<<
 *             _tm.tm_mon,
 *             _tm.tm_mday,
 */
      __pyx_t_16 = PyTuple_New(9); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 754, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_2);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_2)) __PYX_ERR(1, 754, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_4)) __PYX_ERR(1, 754, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_3);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_3)) __PYX_ERR(1, 754, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_10);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_10)) __PYX_ERR(1, 754, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_11);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_11)) __PYX_ERR(1, 754, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_12);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_12)) __PYX_ERR(1, 754, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_13);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_13)) __PYX_ERR(1, 754, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_14);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_14)) __PYX_ERR(1, 754, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_15);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 8, __pyx_t_15)) __PYX_ERR(1, 754, __pyx_L1_error);
      __pyx_t_2 = 0;
      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_t_10 = 0;
      __pyx_t_11 = 0;
      __pyx_t_12 = 0;
      __pyx_t_13 = 0;
      __pyx_t_14 = 0;
      __pyx_t_15 = 0;
      __pyx_t_15 = PyObject_RichCompare(__pyx_t_5, __pyx_t_16, Py_EQ); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 753, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

      /* "cytimes/utils.py":753
 *     for d in (dt, dt_tz1, dt_tz2, dt_tz3, dt_tz4):
 *         _tm = dt_to_tm(d, False)  # type: ignore
 *         assert tuple(d.timetuple()) == (             # <<<<<<<<<<<<<<
 *             _tm.tm_year,
 *             _tm.tm_mon,
 */
      __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 753, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (unlikely(!__pyx_t_17)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 753, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 753, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":764
 *             _tm.tm_isdst,
 *         )
 *         _tm = dt_to_tm(d, True)  # type: ignore             # <<<<<<<<<<<<<<
 *         assert tuple(d.utctimetuple()) == (
 *             _tm.tm_year,
 */
    if (!(likely(((__pyx_v_d) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_d, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 764, __pyx_L1_error)
    __pyx_t_9.__pyx_n = 1;
    __pyx_t_9.utc = 1;
    __pyx_t_8 = __pyx_f_7cytimes_5utils_dt_to_tm(((PyDateTime_DateTime *)__pyx_v_d), &__pyx_t_9); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
    __pyx_v__tm = __pyx_t_8;

    /* "cytimes/utils.py":765
 *         )
 *         _tm = dt_to_tm(d, True)  # type: ignore
 *         assert tuple(d.utctimetuple()) == (             # <<<<<<<<<<<<<<
 *             _tm.tm_year,
 *             _tm.tm_mon,
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_utctimetuple); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_16))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_16);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_16, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 765, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      }
      __pyx_t_16 = __Pyx_PySequence_Tuple(__pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

      /* "cytimes/utils.py":766
 *         _tm = dt_to_tm(d, True)  # type: ignore
 *         assert tuple(d.utctimetuple()) == (
 *             _tm.tm_year,             # <<<<<<<<<<<<<<
 *             _tm.tm_mon,
 *             _tm.tm_mday,
 */
      __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_year); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 766, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);

      /* "cytimes/utils.py":767
 *         assert tuple(d.utctimetuple()) == (
 *             _tm.tm_year,
 *             _tm.tm_mon,             # <<<<<<<<<<<<<<
 *             _tm.tm_mday,
 *             _tm.tm_hour,
 */
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_mon); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 767, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "cytimes/utils.py":768
 *             _tm.tm_year,
 *             _tm.tm_mon,
 *             _tm.tm_mday,             # <<<<<<<<<<<<<<
 *             _tm.tm_hour,
 *             _tm.tm_min,
 */
      __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_mday); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 768, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);

      /* "cytimes/utils.py":769
 *             _tm.tm_mon,
 *             _tm.tm_mday,
 *             _tm.tm_hour,             # <<<<<<<<<<<<<<
 *             _tm.tm_min,
 *             _tm.tm_sec,
 */
      __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_hour); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 769, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);

      /* "cytimes/utils.py":770
 *             _tm.tm_mday,
 *             _tm.tm_hour,
 *             _tm.tm_min,             # <<<<<<<<<<<<<<
 *             _tm.tm_sec,
 *             _tm.tm_wday,
 */
      __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_min); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 770, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);

      /* "cytimes/utils.py":771
 *             _tm.tm_hour,
 *             _tm.tm_min,
 *             _tm.tm_sec,             # <<<<<<<<<<<<<<
 *             _tm.tm_wday,
 *             _tm.tm_yday,
 */
      __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_sec); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 771, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);

      /* "cytimes/utils.py":772
 *             _tm.tm_min,
 *             _tm.tm_sec,
 *             _tm.tm_wday,             # <<<<<<<<<<<<<<
 *             _tm.tm_yday,
 *             _tm.tm_isdst,
 */
      __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_wday); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 772, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);

      /* "cytimes/utils.py":773
 *             _tm.tm_sec,
 *             _tm.tm_wday,
 *             _tm.tm_yday,             # <<<<<<<<<<<<<<
 *             _tm.tm_isdst,
 *         )
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_yday); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 773, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "cytimes/utils.py":774
 *             _tm.tm_wday,
 *             _tm.tm_yday,
 *             _tm.tm_isdst,             # <<<<<<<<<<<<<<
 *         )
 * 
 */
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v__tm.tm_isdst); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 774, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "cytimes/utils.py":766
 *         _tm = dt_to_tm(d, True)  # type: ignore
 *         assert tuple(d.utctimetuple()) == (
 *             _tm.tm_year,             # <<<<<<<<<<<<<<
 *             _tm.tm_mon,
 *             _tm.tm_mday,
 */
      __pyx_t_2 = PyTuple_New(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 766, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_15);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_15)) __PYX_ERR(1, 766, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5)) __PYX_ERR(1, 766, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_14);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_14)) __PYX_ERR(1, 766, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_13);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_13)) __PYX_ERR(1, 766, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_12);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_12)) __PYX_ERR(1, 766, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_11);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_11)) __PYX_ERR(1, 766, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_10);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_t_10)) __PYX_ERR(1, 766, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_3);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_t_3)) __PYX_ERR(1, 766, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_t_4)) __PYX_ERR(1, 766, __pyx_L1_error);
      __pyx_t_15 = 0;
      __pyx_t_5 = 0;
      __pyx_t_14 = 0;
      __pyx_t_13 = 0;
      __pyx_t_12 = 0;
      __pyx_t_11 = 0;
      __pyx_t_10 = 0;
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_16, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 765, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cytimes/utils.py":765
 *         )
 *         _tm = dt_to_tm(d, True)  # type: ignore
 *         assert tuple(d.utctimetuple()) == (             # <<<<<<<<<<<<<<
 *             _tm.tm_year,
 *             _tm.tm_mon,
 */
      __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 765, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_17)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 765, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 765, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":751
 *     dt_tz4 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, ZoneInfo("CET"))
 * 
 *     for d in (dt, dt_tz1, dt_tz2, dt_tz3, dt_tz4):             # <<<<<<<<<<<<<<
 *         _tm = dt_to_tm(d, False)  # type: ignore
 *         assert tuple(d.timetuple()) == (
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":777
 *         )
 * 
 *     assert "01/02/2021 000006.05-04-03" == dt_to_strformat(dt, "%m/%d/%Y %f.%S-%M-%H")  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "01/02/2021 000006.05-04-03+0101" == dt_to_strformat(dt_tz1, "%m/%d/%Y %f.%S-%M-%H%z")  # type: ignore
 *     assert "01/02/2021 000006.05-04-03UTC+01:01" == dt_to_strformat(dt_tz1, "%m/%d/%Y %f.%S-%M-%H%Z")  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 777, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7cytimes_5utils_dt_to_strformat(((PyDateTime_DateTime *)__pyx_v_dt), __pyx_kp_u_m_d_Y_f_S_M_H); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_17 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_01_02_2021_000006_05_04_03, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 777, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 777, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 777, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":778
 * 
 *     assert "01/02/2021 000006.05-04-03" == dt_to_strformat(dt, "%m/%d/%Y %f.%S-%M-%H")  # type: ignore
 *     assert "01/02/2021 000006.05-04-03+0101" == dt_to_strformat(dt_tz1, "%m/%d/%Y %f.%S-%M-%H%z")  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "01/02/2021 000006.05-04-03UTC+01:01" == dt_to_strformat(dt_tz1, "%m/%d/%Y %f.%S-%M-%H%Z")  # type: ignore
 *     assert "2021-01-02T03:04:05.000006" == dt_to_isoformat(dt_tz1, "T", False)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt_tz1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz1, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 778, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7cytimes_5utils_dt_to_strformat(((PyDateTime_DateTime *)__pyx_v_dt_tz1), __pyx_kp_u_m_d_Y_f_S_M_H_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_17 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_01_02_2021_000006_05_04_03_0101, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 778, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 778, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 778, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":779
 *     assert "01/02/2021 000006.05-04-03" == dt_to_strformat(dt, "%m/%d/%Y %f.%S-%M-%H")  # type: ignore
 *     assert "01/02/2021 000006.05-04-03+0101" == dt_to_strformat(dt_tz1, "%m/%d/%Y %f.%S-%M-%H%z")  # type: ignore
 *     assert "01/02/2021 000006.05-04-03UTC+01:01" == dt_to_strformat(dt_tz1, "%m/%d/%Y %f.%S-%M-%H%Z")  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "2021-01-02T03:04:05.000006" == dt_to_isoformat(dt_tz1, "T", False)  # type: ignore
 *     assert "2021-01-02T03:04:05" == dt_to_isoformat(dt_tz1.replace(microsecond=0), "T", False)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt_tz1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz1, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 779, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7cytimes_5utils_dt_to_strformat(((PyDateTime_DateTime *)__pyx_v_dt_tz1), __pyx_kp_u_m_d_Y_f_S_M_H_Z); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_17 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_01_02_2021_000006_05_04_03UTC_01, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 779, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 779, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 779, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":780
 *     assert "01/02/2021 000006.05-04-03+0101" == dt_to_strformat(dt_tz1, "%m/%d/%Y %f.%S-%M-%H%z")  # type: ignore
 *     assert "01/02/2021 000006.05-04-03UTC+01:01" == dt_to_strformat(dt_tz1, "%m/%d/%Y %f.%S-%M-%H%Z")  # type: ignore
 *     assert "2021-01-02T03:04:05.000006" == dt_to_isoformat(dt_tz1, "T", False)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "2021-01-02T03:04:05" == dt_to_isoformat(dt_tz1.replace(microsecond=0), "T", False)  # type: ignore
 *     assert "2021-01-02 03:04:05.000006+0101" == dt_to_isoformat(dt_tz1, " ", True)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt_tz1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz1, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 780, __pyx_L1_error)
    __pyx_t_18.__pyx_n = 2;
    __pyx_t_18.sep = __pyx_n_u_T;
    __pyx_t_18.utc = 0;
    __pyx_t_1 = __pyx_f_7cytimes_5utils_dt_to_isoformat(((PyDateTime_DateTime *)__pyx_v_dt_tz1), &__pyx_t_18); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_17 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_2021_01_02T03_04_05_000006, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 780, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 780, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 780, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":781
 *     assert "01/02/2021 000006.05-04-03UTC+01:01" == dt_to_strformat(dt_tz1, "%m/%d/%Y %f.%S-%M-%H%Z")  # type: ignore
 *     assert "2021-01-02T03:04:05.000006" == dt_to_isoformat(dt_tz1, "T", False)  # type: ignore
 *     assert "2021-01-02T03:04:05" == dt_to_isoformat(dt_tz1.replace(microsecond=0), "T", False)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "2021-01-02 03:04:05.000006+0101" == dt_to_isoformat(dt_tz1, " ", True)  # type: ignore
 *     assert "2021-01-02 03:04:05+0101" == dt_to_isoformat(dt_tz1.replace(microsecond=0), " ", True)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_tz1, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 781, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 781, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_microsecond, __pyx_int_0) < 0) __PYX_ERR(1, 781, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 781, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 781, __pyx_L1_error)
    __pyx_t_18.__pyx_n = 2;
    __pyx_t_18.sep = __pyx_n_u_T;
    __pyx_t_18.utc = 0;
    __pyx_t_4 = __pyx_f_7cytimes_5utils_dt_to_isoformat(((PyDateTime_DateTime *)__pyx_t_2), &__pyx_t_18); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 781, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_17 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_2021_01_02T03_04_05, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 781, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 781, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 781, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":782
 *     assert "2021-01-02T03:04:05.000006" == dt_to_isoformat(dt_tz1, "T", False)  # type: ignore
 *     assert "2021-01-02T03:04:05" == dt_to_isoformat(dt_tz1.replace(microsecond=0), "T", False)  # type: ignore
 *     assert "2021-01-02 03:04:05.000006+0101" == dt_to_isoformat(dt_tz1, " ", True)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "2021-01-02 03:04:05+0101" == dt_to_isoformat(dt_tz1.replace(microsecond=0), " ", True)  # type: ignore
 *     assert dt.toordinal() == dt_to_ordinal(dt)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt_tz1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz1, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 782, __pyx_L1_error)
    __pyx_t_18.__pyx_n = 2;
    __pyx_t_18.sep = __pyx_kp_u__10;
    __pyx_t_18.utc = 1;
    __pyx_t_4 = __pyx_f_7cytimes_5utils_dt_to_isoformat(((PyDateTime_DateTime *)__pyx_v_dt_tz1), &__pyx_t_18); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 782, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_17 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_2021_01_02_03_04_05_000006_0101, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 782, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 782, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 782, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":783
 *     assert "2021-01-02T03:04:05" == dt_to_isoformat(dt_tz1.replace(microsecond=0), "T", False)  # type: ignore
 *     assert "2021-01-02 03:04:05.000006+0101" == dt_to_isoformat(dt_tz1, " ", True)  # type: ignore
 *     assert "2021-01-02 03:04:05+0101" == dt_to_isoformat(dt_tz1.replace(microsecond=0), " ", True)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert dt.toordinal() == dt_to_ordinal(dt)  # type: ignore
 *     assert dt_tz2.toordinal() == dt_to_ordinal(dt_tz2, False)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_tz1, __pyx_n_s_replace); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_microsecond, __pyx_int_0) < 0) __PYX_ERR(1, 783, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 783, __pyx_L1_error)
    __pyx_t_18.__pyx_n = 2;
    __pyx_t_18.sep = __pyx_kp_u__10;
    __pyx_t_18.utc = 1;
    __pyx_t_2 = __pyx_f_7cytimes_5utils_dt_to_isoformat(((PyDateTime_DateTime *)__pyx_t_1), &__pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_17 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_2021_01_02_03_04_05_0101, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 783, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 783, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 783, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":784
 *     assert "2021-01-02 03:04:05.000006+0101" == dt_to_isoformat(dt_tz1, " ", True)  # type: ignore
 *     assert "2021-01-02 03:04:05+0101" == dt_to_isoformat(dt_tz1.replace(microsecond=0), " ", True)  # type: ignore
 *     assert dt.toordinal() == dt_to_ordinal(dt)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert dt_tz2.toordinal() == dt_to_ordinal(dt_tz2, False)  # type: ignore
 *     assert dt_tz2.toordinal() - 1 == dt_to_ordinal(dt_tz2, True)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 784, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 784, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 784, __pyx_L1_error)
    __pyx_t_19 = __pyx_f_7cytimes_5utils_dt_to_ordinal(((PyDateTime_DateTime *)__pyx_v_dt), NULL); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(1, 784, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 784, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 784, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 784, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 784, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 784, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":785
 *     assert "2021-01-02 03:04:05+0101" == dt_to_isoformat(dt_tz1.replace(microsecond=0), " ", True)  # type: ignore
 *     assert dt.toordinal() == dt_to_ordinal(dt)  # type: ignore
 *     assert dt_tz2.toordinal() == dt_to_ordinal(dt_tz2, False)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert dt_tz2.toordinal() - 1 == dt_to_ordinal(dt_tz2, True)  # type: ignore
 *     assert dt_tz3.toordinal() == dt_to_ordinal(dt_tz3, False)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_tz2, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 785, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    if (!(likely(((__pyx_v_dt_tz2) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz2, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 785, __pyx_L1_error)
    __pyx_t_20.__pyx_n = 1;
    __pyx_t_20.utc = 0;
    __pyx_t_19 = __pyx_f_7cytimes_5utils_dt_to_ordinal(((PyDateTime_DateTime *)__pyx_v_dt_tz2), &__pyx_t_20); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(1, 785, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 785, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 785, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 785, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 785, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":786
 *     assert dt.toordinal() == dt_to_ordinal(dt)  # type: ignore
 *     assert dt_tz2.toordinal() == dt_to_ordinal(dt_tz2, False)  # type: ignore
 *     assert dt_tz2.toordinal() - 1 == dt_to_ordinal(dt_tz2, True)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert dt_tz3.toordinal() == dt_to_ordinal(dt_tz3, False)  # type: ignore
 *     assert dt_tz3.toordinal() + 1 == dt_to_ordinal(dt_tz3, True)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_tz2, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 786, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_v_dt_tz2) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz2, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 786, __pyx_L1_error)
    __pyx_t_20.__pyx_n = 1;
    __pyx_t_20.utc = 1;
    __pyx_t_19 = __pyx_f_7cytimes_5utils_dt_to_ordinal(((PyDateTime_DateTime *)__pyx_v_dt_tz2), &__pyx_t_20); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(1, 786, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_19); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 786, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 786, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 786, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":787
 *     assert dt_tz2.toordinal() == dt_to_ordinal(dt_tz2, False)  # type: ignore
 *     assert dt_tz2.toordinal() - 1 == dt_to_ordinal(dt_tz2, True)  # type: ignore
 *     assert dt_tz3.toordinal() == dt_to_ordinal(dt_tz3, False)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert dt_tz3.toordinal() + 1 == dt_to_ordinal(dt_tz3, True)  # type: ignore
 *     secs = (
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_tz3, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 787, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 787, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    if (!(likely(((__pyx_v_dt_tz3) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz3, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 787, __pyx_L1_error)
    __pyx_t_20.__pyx_n = 1;
    __pyx_t_20.utc = 0;
    __pyx_t_19 = __pyx_f_7cytimes_5utils_dt_to_ordinal(((PyDateTime_DateTime *)__pyx_v_dt_tz3), &__pyx_t_20); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(1, 787, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_19); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 787, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 787, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 787, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 787, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 787, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":788
 *     assert dt_tz2.toordinal() - 1 == dt_to_ordinal(dt_tz2, True)  # type: ignore
 *     assert dt_tz3.toordinal() == dt_to_ordinal(dt_tz3, False)  # type: ignore
 *     assert dt_tz3.toordinal() + 1 == dt_to_ordinal(dt_tz3, True)  # type: ignore             # <<<<<<<<<<<<<<
 *     secs = (
 *         (dt.toordinal() - EPOCH_DAY) * 86400
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_tz3, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 788, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_v_dt_tz3) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz3, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 788, __pyx_L1_error)
    __pyx_t_20.__pyx_n = 1;
    __pyx_t_20.utc = 1;
    __pyx_t_19 = __pyx_f_7cytimes_5utils_dt_to_ordinal(((PyDateTime_DateTime *)__pyx_v_dt_tz3), &__pyx_t_20); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(1, 788, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 788, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 788, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 788, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 788, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":790
 *     assert dt_tz3.toordinal() + 1 == dt_to_ordinal(dt_tz3, True)  # type: ignore
 *     secs = (
 *         (dt.toordinal() - EPOCH_DAY) * 86400             # <<<<<<<<<<<<<<
 *         + dt.hour * 3600
 *         + dt.minute * 60
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_7cytimes_5utils_EPOCH_DAY); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_MultiplyObjC(__pyx_t_2, __pyx_int_86400, 0x15180, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":791
 *     secs = (
 *         (dt.toordinal() - EPOCH_DAY) * 86400
 *         + dt.hour * 3600             # <<<<<<<<<<<<<<
 *         + dt.minute * 60
 *         + dt.second
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_hour); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_MultiplyObjC(__pyx_t_2, __pyx_int_3600, 0xE10, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":792
 *         (dt.toordinal() - EPOCH_DAY) * 86400
 *         + dt.hour * 3600
 *         + dt.minute * 60             # <<<<<<<<<<<<<<
 *         + dt.second
 *         + dt.microsecond / 1_000_000
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_minute); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyInt_MultiplyObjC(__pyx_t_4, __pyx_int_60, 60, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":793
 *         + dt.hour * 3600
 *         + dt.minute * 60
 *         + dt.second             # <<<<<<<<<<<<<<
 *         + dt.microsecond / 1_000_000
 *     )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":794
 *         + dt.minute * 60
 *         + dt.second
 *         + dt.microsecond / 1_000_000             # <<<<<<<<<<<<<<
 *     )
 *     assert secs == dt_to_seconds(dt)  # type: ignore
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_1, __pyx_int_1000000, 0xF4240, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_secs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":796
 *         + dt.microsecond / 1_000_000
 *     )
 *     assert secs == dt_to_seconds(dt)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert secs == dt_to_seconds(dt_tz1, False)  # type: ignore
 *     offset = datetime.timedelta(hours=1, minutes=1).total_seconds()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 796, __pyx_L1_error)
    __pyx_t_21 = __pyx_f_7cytimes_5utils_dt_to_seconds(((PyDateTime_DateTime *)__pyx_v_dt), NULL); if (unlikely(__pyx_t_21 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(1, 796, __pyx_L1_error)
    __pyx_t_1 = PyFloat_FromDouble(__pyx_t_21); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 796, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_secs, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 796, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 796, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 796, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":797
 *     )
 *     assert secs == dt_to_seconds(dt)  # type: ignore
 *     assert secs == dt_to_seconds(dt_tz1, False)  # type: ignore             # <<<<<<<<<<<<<<
 *     offset = datetime.timedelta(hours=1, minutes=1).total_seconds()
 *     assert secs - offset == dt_to_seconds(dt_tz1, True)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt_tz1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz1, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 797, __pyx_L1_error)
    __pyx_t_22.__pyx_n = 1;
    __pyx_t_22.utc = 0;
    __pyx_t_21 = __pyx_f_7cytimes_5utils_dt_to_seconds(((PyDateTime_DateTime *)__pyx_v_dt_tz1), &__pyx_t_22); if (unlikely(__pyx_t_21 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(1, 797, __pyx_L1_error)
    __pyx_t_4 = PyFloat_FromDouble(__pyx_t_21); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_secs, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 797, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 797, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 797, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 797, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":798
 *     assert secs == dt_to_seconds(dt)  # type: ignore
 *     assert secs == dt_to_seconds(dt_tz1, False)  # type: ignore
 *     offset = datetime.timedelta(hours=1, minutes=1).total_seconds()             # <<<<<<<<<<<<<<
 *     assert secs - offset == dt_to_seconds(dt_tz1, True)  # type: ignore
 *     us = int(secs * 1_000_000)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hours, __pyx_int_1) < 0) __PYX_ERR(1, 798, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_minutes, __pyx_int_1) < 0) __PYX_ERR(1, 798, __pyx_L1_error)
  __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_total_seconds); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_t_16 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_16)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_16);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_16, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 798, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_offset = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":799
 *     assert secs == dt_to_seconds(dt_tz1, False)  # type: ignore
 *     offset = datetime.timedelta(hours=1, minutes=1).total_seconds()
 *     assert secs - offset == dt_to_seconds(dt_tz1, True)  # type: ignore             # <<<<<<<<<<<<<<
 *     us = int(secs * 1_000_000)
 *     assert us == dt_to_us(dt)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = PyNumber_Subtract(__pyx_v_secs, __pyx_v_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_v_dt_tz1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz1, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 799, __pyx_L1_error)
    __pyx_t_22.__pyx_n = 1;
    __pyx_t_22.utc = 1;
    __pyx_t_21 = __pyx_f_7cytimes_5utils_dt_to_seconds(((PyDateTime_DateTime *)__pyx_v_dt_tz1), &__pyx_t_22); if (unlikely(__pyx_t_21 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(1, 799, __pyx_L1_error)
    __pyx_t_2 = PyFloat_FromDouble(__pyx_t_21); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_16 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 799, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 799, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 799, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 799, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":800
 *     offset = datetime.timedelta(hours=1, minutes=1).total_seconds()
 *     assert secs - offset == dt_to_seconds(dt_tz1, True)  # type: ignore
 *     us = int(secs * 1_000_000)             # <<<<<<<<<<<<<<
 *     assert us == dt_to_us(dt)  # type: ignore
 *     assert us == dt_to_us(dt_tz1, False)  # type: ignore
 */
  __pyx_t_16 = __Pyx_PyInt_MultiplyObjC(__pyx_v_secs, __pyx_int_1000000, 0xF4240, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_v_us = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":801
 *     assert secs - offset == dt_to_seconds(dt_tz1, True)  # type: ignore
 *     us = int(secs * 1_000_000)
 *     assert us == dt_to_us(dt)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert us == dt_to_us(dt_tz1, False)  # type: ignore
 *     assert us - (offset * 1_000_000) == dt_to_us(dt_tz1, True)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 801, __pyx_L1_error)
    __pyx_t_23 = __pyx_f_7cytimes_5utils_dt_to_us(((PyDateTime_DateTime *)__pyx_v_dt), NULL); if (unlikely(__pyx_t_23 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 801, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_t_23); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 801, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_16 = PyObject_RichCompare(__pyx_v_us, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 801, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 801, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 801, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 801, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":802
 *     us = int(secs * 1_000_000)
 *     assert us == dt_to_us(dt)  # type: ignore
 *     assert us == dt_to_us(dt_tz1, False)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert us - (offset * 1_000_000) == dt_to_us(dt_tz1, True)  # type: ignore
 *     for t in (dt, dt_tz1, dt_tz2, dt_tz3, dt_tz4):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt_tz1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz1, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 802, __pyx_L1_error)
    __pyx_t_24.__pyx_n = 1;
    __pyx_t_24.utc = 0;
    __pyx_t_23 = __pyx_f_7cytimes_5utils_dt_to_us(((PyDateTime_DateTime *)__pyx_v_dt_tz1), &__pyx_t_24); if (unlikely(__pyx_t_23 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 802, __pyx_L1_error)
    __pyx_t_16 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_t_23); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_us, __pyx_t_16, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 802, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 802, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 802, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 802, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":803
 *     assert us == dt_to_us(dt)  # type: ignore
 *     assert us == dt_to_us(dt_tz1, False)  # type: ignore
 *     assert us - (offset * 1_000_000) == dt_to_us(dt_tz1, True)  # type: ignore             # <<<<<<<<<<<<<<
 *     for t in (dt, dt_tz1, dt_tz2, dt_tz3, dt_tz4):
 *         assert t.timestamp() == dt_to_ts(t)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_v_offset, __pyx_int_1000000, 0xF4240, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_16 = PyNumber_Subtract(__pyx_v_us, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_v_dt_tz1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz1, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 803, __pyx_L1_error)
    __pyx_t_24.__pyx_n = 1;
    __pyx_t_24.utc = 1;
    __pyx_t_23 = __pyx_f_7cytimes_5utils_dt_to_us(((PyDateTime_DateTime *)__pyx_v_dt_tz1), &__pyx_t_24); if (unlikely(__pyx_t_23 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 803, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_t_23); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_16, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 803, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 803, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 803, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 803, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":804
 *     assert us == dt_to_us(dt_tz1, False)  # type: ignore
 *     assert us - (offset * 1_000_000) == dt_to_us(dt_tz1, True)  # type: ignore
 *     for t in (dt, dt_tz1, dt_tz2, dt_tz3, dt_tz4):             # <<<<<<<<<<<<<<
 *         assert t.timestamp() == dt_to_ts(t)  # type: ignore
 * 
 */
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_dt);
  __Pyx_GIVEREF(__pyx_v_dt);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dt)) __PYX_ERR(1, 804, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_dt_tz1);
  __Pyx_GIVEREF(__pyx_v_dt_tz1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_dt_tz1)) __PYX_ERR(1, 804, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_dt_tz2);
  __Pyx_GIVEREF(__pyx_v_dt_tz2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_dt_tz2)) __PYX_ERR(1, 804, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_dt_tz3);
  __Pyx_GIVEREF(__pyx_v_dt_tz3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_dt_tz3)) __PYX_ERR(1, 804, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_dt_tz4);
  __Pyx_GIVEREF(__pyx_v_dt_tz4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_dt_tz4)) __PYX_ERR(1, 804, __pyx_L1_error);
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
  __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_7 >= 5) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(1, 804, __pyx_L1_error)
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/utils.py":805
 *     assert us - (offset * 1_000_000) == dt_to_us(dt_tz1, True)  # type: ignore
 *     for t in (dt, dt_tz1, dt_tz2, dt_tz3, dt_tz4):
 *         assert t.timestamp() == dt_to_ts(t)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     date = datetime.date(2021, 1, 2)
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 805, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_4 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_16))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_16);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_16, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 805, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      }
      if (!(likely(((__pyx_v_t) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 805, __pyx_L1_error)
      __pyx_t_21 = __pyx_f_7cytimes_5utils_dt_to_ts(((PyDateTime_DateTime *)__pyx_v_t)); if (unlikely(__pyx_t_21 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(1, 805, __pyx_L1_error)
      __pyx_t_16 = PyFloat_FromDouble(__pyx_t_21); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 805, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_16, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 805, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 805, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_17)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 805, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 805, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":804
 *     assert us == dt_to_us(dt_tz1, False)  # type: ignore
 *     assert us - (offset * 1_000_000) == dt_to_us(dt_tz1, True)  # type: ignore
 *     for t in (dt, dt_tz1, dt_tz2, dt_tz3, dt_tz4):             # <<<<<<<<<<<<<<
 *         assert t.timestamp() == dt_to_ts(t)  # type: ignore
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":807
 *         assert t.timestamp() == dt_to_ts(t)  # type: ignore
 * 
 *     date = datetime.date(2021, 1, 2)             # <<<<<<<<<<<<<<
 *     time1 = datetime.time(3, 4, 5, 6)
 *     time2 = datetime.time(3, 4, 5, 6, tz1)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_date); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_date = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":808
 * 
 *     date = datetime.date(2021, 1, 2)
 *     time1 = datetime.time(3, 4, 5, 6)             # <<<<<<<<<<<<<<
 *     time2 = datetime.time(3, 4, 5, 6, tz1)
 *     assert dt == dt_combine(date, time1)  # type: ignore
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_time1 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":809
 *     date = datetime.date(2021, 1, 2)
 *     time1 = datetime.time(3, 4, 5, 6)
 *     time2 = datetime.time(3, 4, 5, 6, tz1)             # <<<<<<<<<<<<<<
 *     assert dt == dt_combine(date, time1)  # type: ignore
 *     assert dt_tz1 == dt_combine(date, time2)  # type: ignore
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_16 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_16)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_16);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[6] = {__pyx_t_16, __pyx_int_3, __pyx_int_4, __pyx_int_5, __pyx_int_6, __pyx_v_tz1};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 809, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_v_time2 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":810
 *     time1 = datetime.time(3, 4, 5, 6)
 *     time2 = datetime.time(3, 4, 5, 6, tz1)
 *     assert dt == dt_combine(date, time1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert dt_tz1 == dt_combine(date, time2)  # type: ignore
 *     assert datetime.datetime(2021, 1, 2) == dt_combine(date, None)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_7cpython_8datetime_date))))) __PYX_ERR(1, 810, __pyx_L1_error)
    if (!(likely(((__pyx_v_time1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_time1, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 810, __pyx_L1_error)
    __pyx_t_25.__pyx_n = 2;
    __pyx_t_25.date = ((PyDateTime_Date *)__pyx_v_date);
    __pyx_t_25.time = ((PyDateTime_Time *)__pyx_v_time1);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_combine(&__pyx_t_25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_dt, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 810, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 810, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 810, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 810, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":811
 *     time2 = datetime.time(3, 4, 5, 6, tz1)
 *     assert dt == dt_combine(date, time1)  # type: ignore
 *     assert dt_tz1 == dt_combine(date, time2)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(2021, 1, 2) == dt_combine(date, None)  # type: ignore
 *     tmp = datetime.datetime.now()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_7cpython_8datetime_date))))) __PYX_ERR(1, 811, __pyx_L1_error)
    if (!(likely(((__pyx_v_time2) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_time2, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 811, __pyx_L1_error)
    __pyx_t_25.__pyx_n = 2;
    __pyx_t_25.date = ((PyDateTime_Date *)__pyx_v_date);
    __pyx_t_25.time = ((PyDateTime_Time *)__pyx_v_time2);
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_combine(&__pyx_t_25)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_dt_tz1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 811, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 811, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 811, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 811, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":812
 *     assert dt == dt_combine(date, time1)  # type: ignore
 *     assert dt_tz1 == dt_combine(date, time2)  # type: ignore
 *     assert datetime.datetime(2021, 1, 2) == dt_combine(date, None)  # type: ignore             # <<<<<<<<<<<<<<
 *     tmp = datetime.datetime.now()
 *     tmp1 = tmp.replace(hour=3, minute=4, second=5, microsecond=6)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_7cpython_8datetime_date))))) __PYX_ERR(1, 812, __pyx_L1_error)
    __pyx_t_25.__pyx_n = 2;
    __pyx_t_25.date = ((PyDateTime_Date *)__pyx_v_date);
    __pyx_t_25.time = ((PyDateTime_Time *)Py_None);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_combine(&__pyx_t_25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_16 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 812, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 812, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 812, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 812, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":813
 *     assert dt_tz1 == dt_combine(date, time2)  # type: ignore
 *     assert datetime.datetime(2021, 1, 2) == dt_combine(date, None)  # type: ignore
 *     tmp = datetime.datetime.now()             # <<<<<<<<<<<<<<
 *     tmp1 = tmp.replace(hour=3, minute=4, second=5, microsecond=6)
 *     assert tmp1 == dt_combine(None, time1)  # type: ignore
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_now); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_16 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_v_tmp = __pyx_t_16;
  __pyx_t_16 = 0;

  /* "cytimes/utils.py":814
 *     assert datetime.datetime(2021, 1, 2) == dt_combine(date, None)  # type: ignore
 *     tmp = datetime.datetime.now()
 *     tmp1 = tmp.replace(hour=3, minute=4, second=5, microsecond=6)             # <<<<<<<<<<<<<<
 *     assert tmp1 == dt_combine(None, time1)  # type: ignore
 *     tmp2 = tmp1.replace(tzinfo=tz1)
 */
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_tmp, __pyx_n_s_replace); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hour, __pyx_int_3) < 0) __PYX_ERR(1, 814, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_minute, __pyx_int_4) < 0) __PYX_ERR(1, 814, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_second, __pyx_int_5) < 0) __PYX_ERR(1, 814, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_microsecond, __pyx_int_6) < 0) __PYX_ERR(1, 814, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_tmp1 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":815
 *     tmp = datetime.datetime.now()
 *     tmp1 = tmp.replace(hour=3, minute=4, second=5, microsecond=6)
 *     assert tmp1 == dt_combine(None, time1)  # type: ignore             # <<<<<<<<<<<<<<
 *     tmp2 = tmp1.replace(tzinfo=tz1)
 *     assert tmp2 == dt_combine(None, time2)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_time1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_time1, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 815, __pyx_L1_error)
    __pyx_t_25.__pyx_n = 2;
    __pyx_t_25.date = ((PyDateTime_Date *)Py_None);
    __pyx_t_25.time = ((PyDateTime_Time *)__pyx_v_time1);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_combine(&__pyx_t_25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 815, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_tmp1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 815, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 815, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 815, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 815, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":816
 *     tmp1 = tmp.replace(hour=3, minute=4, second=5, microsecond=6)
 *     assert tmp1 == dt_combine(None, time1)  # type: ignore
 *     tmp2 = tmp1.replace(tzinfo=tz1)             # <<<<<<<<<<<<<<
 *     assert tmp2 == dt_combine(None, time2)  # type: ignore
 *     tmp3 = tmp.replace(hour=0, minute=0, second=0, microsecond=0)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tmp1, __pyx_n_s_replace); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tzinfo, __pyx_v_tz1) < 0) __PYX_ERR(1, 816, __pyx_L1_error)
  __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_tmp2 = __pyx_t_16;
  __pyx_t_16 = 0;

  /* "cytimes/utils.py":817
 *     assert tmp1 == dt_combine(None, time1)  # type: ignore
 *     tmp2 = tmp1.replace(tzinfo=tz1)
 *     assert tmp2 == dt_combine(None, time2)  # type: ignore             # <<<<<<<<<<<<<<
 *     tmp3 = tmp.replace(hour=0, minute=0, second=0, microsecond=0)
 *     assert tmp3 == dt_combine()  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_time2) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_time2, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 817, __pyx_L1_error)
    __pyx_t_25.__pyx_n = 2;
    __pyx_t_25.date = ((PyDateTime_Date *)Py_None);
    __pyx_t_25.time = ((PyDateTime_Time *)__pyx_v_time2);
    __pyx_t_16 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_combine(&__pyx_t_25)); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_tmp2, __pyx_t_16, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 817, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 817, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 817, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 817, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":818
 *     tmp2 = tmp1.replace(tzinfo=tz1)
 *     assert tmp2 == dt_combine(None, time2)  # type: ignore
 *     tmp3 = tmp.replace(hour=0, minute=0, second=0, microsecond=0)             # <<<<<<<<<<<<<<
 *     assert tmp3 == dt_combine()  # type: ignore
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tmp, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_16 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_hour, __pyx_int_0) < 0) __PYX_ERR(1, 818, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_minute, __pyx_int_0) < 0) __PYX_ERR(1, 818, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_second, __pyx_int_0) < 0) __PYX_ERR(1, 818, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_microsecond, __pyx_int_0) < 0) __PYX_ERR(1, 818, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_16); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_v_tmp3 = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":819
 *     assert tmp2 == dt_combine(None, time2)  # type: ignore
 *     tmp3 = tmp.replace(hour=0, minute=0, second=0, microsecond=0)
 *     assert tmp3 == dt_combine()  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_date(date)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_combine(NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_16 = PyObject_RichCompare(__pyx_v_tmp3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 819, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 819, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 819, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 819, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":821
 *     assert tmp3 == dt_combine()  # type: ignore
 * 
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_date(date)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(2021, 1, 2, tzinfo=tz1) == dt_fr_date(date, tz1)  # type: ignore
 *     assert dt == dt_fr_dt(Timestamp(dt))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_7cpython_8datetime_date))))) __PYX_ERR(1, 821, __pyx_L1_error)
    __pyx_t_16 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_date(((PyDateTime_Date *)__pyx_v_date), NULL)); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_16, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 821, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 821, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 821, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 821, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":822
 * 
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_date(date)  # type: ignore
 *     assert datetime.datetime(2021, 1, 2, tzinfo=tz1) == dt_fr_date(date, tz1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert dt == dt_fr_dt(Timestamp(dt))  # type: ignore
 *     assert dt_tz1 == dt_fr_dt(Timestamp(dt_tz1))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_16 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_tzinfo, __pyx_v_tz1) < 0) __PYX_ERR(1, 822, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__56, __pyx_t_16); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_7cpython_8datetime_date))))) __PYX_ERR(1, 822, __pyx_L1_error)
    __pyx_t_26.__pyx_n = 1;
    __pyx_t_26.tz = __pyx_v_tz1;
    __pyx_t_16 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_date(((PyDateTime_Date *)__pyx_v_date), &__pyx_t_26)); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_16, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 822, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 822, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 822, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 822, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":823
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_date(date)  # type: ignore
 *     assert datetime.datetime(2021, 1, 2, tzinfo=tz1) == dt_fr_date(date, tz1)  # type: ignore
 *     assert dt == dt_fr_dt(Timestamp(dt))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert dt_tz1 == dt_fr_dt(Timestamp(dt_tz1))  # type: ignore
 *     assert type(dt_fr_dt(Timestamp(dt_tz1))) is datetime.datetime  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __Pyx_INCREF(__pyx_v_Timestamp);
    __pyx_t_16 = __pyx_v_Timestamp; __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_16))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_16);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_16, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_dt};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 823, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 823, __pyx_L1_error)
    __pyx_t_16 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_dt(((PyDateTime_DateTime *)__pyx_t_2))); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_dt, __pyx_t_16, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 823, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 823, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 823, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 823, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":824
 *     assert datetime.datetime(2021, 1, 2, tzinfo=tz1) == dt_fr_date(date, tz1)  # type: ignore
 *     assert dt == dt_fr_dt(Timestamp(dt))  # type: ignore
 *     assert dt_tz1 == dt_fr_dt(Timestamp(dt_tz1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert type(dt_fr_dt(Timestamp(dt_tz1))) is datetime.datetime  # type: ignore
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt.toordinal())  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __Pyx_INCREF(__pyx_v_Timestamp);
    __pyx_t_16 = __pyx_v_Timestamp; __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_16))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_16);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_16, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_dt_tz1};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 824, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 824, __pyx_L1_error)
    __pyx_t_16 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_dt(((PyDateTime_DateTime *)__pyx_t_2))); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_dt_tz1, __pyx_t_16, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 824, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 824, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 824, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 824, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":825
 *     assert dt == dt_fr_dt(Timestamp(dt))  # type: ignore
 *     assert dt_tz1 == dt_fr_dt(Timestamp(dt_tz1))  # type: ignore
 *     assert type(dt_fr_dt(Timestamp(dt_tz1))) is datetime.datetime  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt.toordinal())  # type: ignore
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt_to_ordinal(dt_tz2, False))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __Pyx_INCREF(__pyx_v_Timestamp);
    __pyx_t_16 = __pyx_v_Timestamp; __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_16))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_16);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_16, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_dt_tz1};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 825, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 825, __pyx_L1_error)
    __pyx_t_16 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_dt(((PyDateTime_DateTime *)__pyx_t_2))); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_17 = (((PyObject *)Py_TYPE(__pyx_t_16)) == __pyx_t_2);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 825, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 825, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":826
 *     assert dt_tz1 == dt_fr_dt(Timestamp(dt_tz1))  # type: ignore
 *     assert type(dt_fr_dt(Timestamp(dt_tz1))) is datetime.datetime  # type: ignore
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt.toordinal())  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt_to_ordinal(dt_tz2, False))  # type: ignore
 *     assert datetime.datetime(2021, 1, 1) == dt_fr_ordinal(dt_to_ordinal(dt_tz2, True))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_19 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 826, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_ordinal(__pyx_t_19, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_16, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 826, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 826, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 826, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":827
 *     assert type(dt_fr_dt(Timestamp(dt_tz1))) is datetime.datetime  # type: ignore
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt.toordinal())  # type: ignore
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt_to_ordinal(dt_tz2, False))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(2021, 1, 1) == dt_fr_ordinal(dt_to_ordinal(dt_tz2, True))  # type: ignore
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt_to_ordinal(dt_tz3, False))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_v_dt_tz2) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz2, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 827, __pyx_L1_error)
    __pyx_t_20.__pyx_n = 1;
    __pyx_t_20.utc = 0;
    __pyx_t_19 = __pyx_f_7cytimes_5utils_dt_to_ordinal(((PyDateTime_DateTime *)__pyx_v_dt_tz2), &__pyx_t_20); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(1, 827, __pyx_L1_error)
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_ordinal(__pyx_t_19, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_16 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 827, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 827, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 827, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":828
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt.toordinal())  # type: ignore
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt_to_ordinal(dt_tz2, False))  # type: ignore
 *     assert datetime.datetime(2021, 1, 1) == dt_fr_ordinal(dt_to_ordinal(dt_tz2, True))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt_to_ordinal(dt_tz3, False))  # type: ignore
 *     assert datetime.datetime(2021, 1, 3) == dt_fr_ordinal(dt_to_ordinal(dt_tz3, True))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (!(likely(((__pyx_v_dt_tz2) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz2, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 828, __pyx_L1_error)
    __pyx_t_20.__pyx_n = 1;
    __pyx_t_20.utc = 1;
    __pyx_t_19 = __pyx_f_7cytimes_5utils_dt_to_ordinal(((PyDateTime_DateTime *)__pyx_v_dt_tz2), &__pyx_t_20); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(1, 828, __pyx_L1_error)
    __pyx_t_16 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_ordinal(__pyx_t_19, NULL)); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_16, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 828, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 828, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 828, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 828, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":829
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt_to_ordinal(dt_tz2, False))  # type: ignore
 *     assert datetime.datetime(2021, 1, 1) == dt_fr_ordinal(dt_to_ordinal(dt_tz2, True))  # type: ignore
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt_to_ordinal(dt_tz3, False))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(2021, 1, 3) == dt_fr_ordinal(dt_to_ordinal(dt_tz3, True))  # type: ignore
 *     assert dt == dt_fr_seconds(dt_to_seconds(dt))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_v_dt_tz3) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz3, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 829, __pyx_L1_error)
    __pyx_t_20.__pyx_n = 1;
    __pyx_t_20.utc = 0;
    __pyx_t_19 = __pyx_f_7cytimes_5utils_dt_to_ordinal(((PyDateTime_DateTime *)__pyx_v_dt_tz3), &__pyx_t_20); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(1, 829, __pyx_L1_error)
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_ordinal(__pyx_t_19, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_16, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 829, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 829, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 829, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":830
 *     assert datetime.datetime(2021, 1, 1) == dt_fr_ordinal(dt_to_ordinal(dt_tz2, True))  # type: ignore
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt_to_ordinal(dt_tz3, False))  # type: ignore
 *     assert datetime.datetime(2021, 1, 3) == dt_fr_ordinal(dt_to_ordinal(dt_tz3, True))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert dt == dt_fr_seconds(dt_to_seconds(dt))  # type: ignore
 *     assert dt_tz1 == dt_fr_seconds(dt_to_seconds(dt_tz1, False), tz1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_v_dt_tz3) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz3, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 830, __pyx_L1_error)
    __pyx_t_20.__pyx_n = 1;
    __pyx_t_20.utc = 1;
    __pyx_t_19 = __pyx_f_7cytimes_5utils_dt_to_ordinal(((PyDateTime_DateTime *)__pyx_v_dt_tz3), &__pyx_t_20); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(1, 830, __pyx_L1_error)
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_ordinal(__pyx_t_19, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_16 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 830, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 830, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 830, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 830, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":831
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt_to_ordinal(dt_tz3, False))  # type: ignore
 *     assert datetime.datetime(2021, 1, 3) == dt_fr_ordinal(dt_to_ordinal(dt_tz3, True))  # type: ignore
 *     assert dt == dt_fr_seconds(dt_to_seconds(dt))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert dt_tz1 == dt_fr_seconds(dt_to_seconds(dt_tz1, False), tz1)  # type: ignore
 *     assert dt == dt_fr_us(dt_to_us(dt))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 831, __pyx_L1_error)
    __pyx_t_21 = __pyx_f_7cytimes_5utils_dt_to_seconds(((PyDateTime_DateTime *)__pyx_v_dt), NULL); if (unlikely(__pyx_t_21 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(1, 831, __pyx_L1_error)
    __pyx_t_16 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_seconds(__pyx_t_21, NULL)); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 831, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_dt, __pyx_t_16, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 831, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 831, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 831, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":832
 *     assert datetime.datetime(2021, 1, 3) == dt_fr_ordinal(dt_to_ordinal(dt_tz3, True))  # type: ignore
 *     assert dt == dt_fr_seconds(dt_to_seconds(dt))  # type: ignore
 *     assert dt_tz1 == dt_fr_seconds(dt_to_seconds(dt_tz1, False), tz1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert dt == dt_fr_us(dt_to_us(dt))  # type: ignore
 *     assert dt_tz1 == dt_fr_us(dt_to_us(dt_tz1, False), tz1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt_tz1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz1, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 832, __pyx_L1_error)
    __pyx_t_22.__pyx_n = 1;
    __pyx_t_22.utc = 0;
    __pyx_t_21 = __pyx_f_7cytimes_5utils_dt_to_seconds(((PyDateTime_DateTime *)__pyx_v_dt_tz1), &__pyx_t_22); if (unlikely(__pyx_t_21 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(1, 832, __pyx_L1_error)
    __pyx_t_27.__pyx_n = 1;
    __pyx_t_27.tz = __pyx_v_tz1;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_seconds(__pyx_t_21, &__pyx_t_27)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_16 = PyObject_RichCompare(__pyx_v_dt_tz1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 832, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 832, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 832, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 832, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":833
 *     assert dt == dt_fr_seconds(dt_to_seconds(dt))  # type: ignore
 *     assert dt_tz1 == dt_fr_seconds(dt_to_seconds(dt_tz1, False), tz1)  # type: ignore
 *     assert dt == dt_fr_us(dt_to_us(dt))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert dt_tz1 == dt_fr_us(dt_to_us(dt_tz1, False), tz1)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 833, __pyx_L1_error)
    __pyx_t_23 = __pyx_f_7cytimes_5utils_dt_to_us(((PyDateTime_DateTime *)__pyx_v_dt), NULL); if (unlikely(__pyx_t_23 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 833, __pyx_L1_error)
    __pyx_t_16 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_us(__pyx_t_23, NULL)); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_dt, __pyx_t_16, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 833, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 833, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 833, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":834
 *     assert dt_tz1 == dt_fr_seconds(dt_to_seconds(dt_tz1, False), tz1)  # type: ignore
 *     assert dt == dt_fr_us(dt_to_us(dt))  # type: ignore
 *     assert dt_tz1 == dt_fr_us(dt_to_us(dt_tz1, False), tz1)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt_tz1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz1, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 834, __pyx_L1_error)
    __pyx_t_24.__pyx_n = 1;
    __pyx_t_24.utc = 0;
    __pyx_t_23 = __pyx_f_7cytimes_5utils_dt_to_us(((PyDateTime_DateTime *)__pyx_v_dt_tz1), &__pyx_t_24); if (unlikely(__pyx_t_23 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 834, __pyx_L1_error)
    __pyx_t_28.__pyx_n = 1;
    __pyx_t_28.tz = __pyx_v_tz1;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_us(__pyx_t_23, &__pyx_t_28)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_16 = PyObject_RichCompare(__pyx_v_dt_tz1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 834, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 834, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_17)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 834, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 834, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":836
 *     assert dt_tz1 == dt_fr_us(dt_to_us(dt_tz1, False), tz1)  # type: ignore
 * 
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)             # <<<<<<<<<<<<<<
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 */
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":837
 * 
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))             # <<<<<<<<<<<<<<
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 *     tz3 = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))
 */
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hours, __pyx_int_1) < 0) __PYX_ERR(1, 837, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_minutes, __pyx_int_1) < 0) __PYX_ERR(1, 837, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_16))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_16);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_16, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_tz1, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":838
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))             # <<<<<<<<<<<<<<
 *     tz3 = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))
 *     tz4 = ZoneInfo("CET")
 */
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hours, __pyx_int_23) < 0) __PYX_ERR(1, 838, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_minutes, __pyx_int_59) < 0) __PYX_ERR(1, 838, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_16))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_16);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_16, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_2};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_tz2, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":839
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 *     tz3 = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))             # <<<<<<<<<<<<<<
 *     tz4 = ZoneInfo("CET")
 *     for tz in (None, tz1, tz2, tz3, tz4):
 */
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hours, __pyx_int_neg_23) < 0) __PYX_ERR(1, 839, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_minutes, __pyx_int_neg_59) < 0) __PYX_ERR(1, 839, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_16))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_16);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_16, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_tz3, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":840
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 *     tz3 = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))
 *     tz4 = ZoneInfo("CET")             # <<<<<<<<<<<<<<
 *     for tz in (None, tz1, tz2, tz3, tz4):
 *         dt_ = dt.replace(tzinfo=tz1)
 */
  __Pyx_INCREF(__pyx_v_ZoneInfo);
  __pyx_t_16 = __pyx_v_ZoneInfo; __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_16))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_16);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_16, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_u_CET};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  }
  __pyx_v_tz4 = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":841
 *     tz3 = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))
 *     tz4 = ZoneInfo("CET")
 *     for tz in (None, tz1, tz2, tz3, tz4):             # <<<<<<<<<<<<<<
 *         dt_ = dt.replace(tzinfo=tz1)
 *         ts = dt_.timestamp()
 */
  __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, Py_None)) __PYX_ERR(1, 841, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_tz1);
  __Pyx_GIVEREF(__pyx_v_tz1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_tz1)) __PYX_ERR(1, 841, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_tz2);
  __Pyx_GIVEREF(__pyx_v_tz2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_tz2)) __PYX_ERR(1, 841, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_tz3);
  __Pyx_GIVEREF(__pyx_v_tz3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_tz3)) __PYX_ERR(1, 841, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_tz4);
  __Pyx_GIVEREF(__pyx_v_tz4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_tz4)) __PYX_ERR(1, 841, __pyx_L1_error);
  __pyx_t_16 = __pyx_t_4; __Pyx_INCREF(__pyx_t_16);
  __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_7 >= 5) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(1, 841, __pyx_L1_error)
    #else
    __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_16, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_tz, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytimes/utils.py":842
 *     tz4 = ZoneInfo("CET")
 *     for tz in (None, tz1, tz2, tz3, tz4):
 *         dt_ = dt.replace(tzinfo=tz1)             # <<<<<<<<<<<<<<
 *         ts = dt_.timestamp()
 *         assert datetime.datetime.fromtimestamp(ts, tz) == dt_fr_ts(ts, tz)  # type: ignore
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_replace); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tzinfo, __pyx_v_tz1) < 0) __PYX_ERR(1, 842, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 842, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_dt_, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/utils.py":843
 *     for tz in (None, tz1, tz2, tz3, tz4):
 *         dt_ = dt.replace(tzinfo=tz1)
 *         ts = dt_.timestamp()             # <<<<<<<<<<<<<<
 *         assert datetime.datetime.fromtimestamp(ts, tz) == dt_fr_ts(ts, tz)  # type: ignore
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt_, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 843, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_ts, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/utils.py":844
 *         dt_ = dt.replace(tzinfo=tz1)
 *         ts = dt_.timestamp()
 *         assert datetime.datetime.fromtimestamp(ts, tz) == dt_fr_ts(ts, tz)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: dt_conversion")
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fromtimestamp); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_ts, __pyx_v_tz};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 844, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_v_ts); if (unlikely((__pyx_t_21 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 844, __pyx_L1_error)
      __pyx_t_29.__pyx_n = 1;
      __pyx_t_29.tz = __pyx_v_tz;
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_ts(__pyx_t_21, &__pyx_t_29)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(1, 844, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_17)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 844, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 844, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":841
 *     tz3 = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))
 *     tz4 = ZoneInfo("CET")
 *     for tz in (None, tz1, tz2, tz3, tz4):             # <<<<<<<<<<<<<<
 *         dt_ = dt.replace(tzinfo=tz1)
 *         ts = dt_.timestamp()
 */
  }
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "cytimes/utils.py":846
 *         assert datetime.datetime.fromtimestamp(ts, tz) == dt_fr_ts(ts, tz)  # type: ignore
 * 
 *     print("Passed: dt_conversion")             # <<<<<<<<<<<<<<
 * 
 *     del datetime, ZoneInfo, Timestamp
 */
  __pyx_t_16 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "cytimes/utils.py":848
 *     print("Passed: dt_conversion")
 * 
 *     del datetime, ZoneInfo, Timestamp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;
  __Pyx_DECREF(__pyx_v_ZoneInfo); __pyx_v_ZoneInfo = 0;
  __Pyx_DECREF(__pyx_v_Timestamp); __pyx_v_Timestamp = 0;

  /* "cytimes/utils.py":737
 * 
 * 
 * def _test_dt_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("cytimes.utils._test_dt_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_ZoneInfo);
  __Pyx_XDECREF(__pyx_v_Timestamp);
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XDECREF(__pyx_v_tz1);
  __Pyx_XDECREF(__pyx_v_dt_tz1);
  __Pyx_XDECREF(__pyx_v_tz2);
  __Pyx_XDECREF(__pyx_v_dt_tz2);
  __Pyx_XDECREF(__pyx_v_tz3);
  __Pyx_XDECREF(__pyx_v_dt_tz3);
  __Pyx_XDECREF(__pyx_v_dt_tz4);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_secs);
  __Pyx_XDECREF(__pyx_v_offset);
  __Pyx_XDECREF(__pyx_v_us);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XDECREF(__pyx_v_date);
  __Pyx_XDECREF(__pyx_v_time1);
  __Pyx_XDECREF(__pyx_v_time2);
  __Pyx_XDECREF(__pyx_v_tmp);
  __Pyx_XDECREF(__pyx_v_tmp1);
  __Pyx_XDECREF(__pyx_v_tmp2);
  __Pyx_XDECREF(__pyx_v_tmp3);
  __Pyx_XDECREF(__pyx_v_tz4);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XDECREF(__pyx_v_dt_);
  __Pyx_XDECREF(__pyx_v_ts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":851
 * 
 * 
 * def _test_dt_mainipulate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_45_test_dt_mainipulate(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_45_test_dt_mainipulate = {"_test_dt_mainipulate", (PyCFunction)__pyx_pw_7cytimes_5utils_45_test_dt_mainipulate, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_45_test_dt_mainipulate(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_dt_mainipulate (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_44_test_dt_mainipulate(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_44_test_dt_mainipulate(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_ZoneInfo = NULL;
  PyObject *__pyx_v_dt = NULL;
  PyObject *__pyx_v_tz1 = NULL;
  PyObject *__pyx_v_tz2 = NULL;
  PyObject *__pyx_v_tz3 = NULL;
  PyObject *__pyx_v_tz4 = NULL;
  PyObject *__pyx_v_tz = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_dt_mainipulate", 1);

  /* "cytimes/utils.py":852
 * 
 * def _test_dt_mainipulate() -> None:
 *     import datetime             # <<<<<<<<<<<<<<
 *     from zoneinfo import ZoneInfo
 * 
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":853
 * def _test_dt_mainipulate() -> None:
 *     import datetime
 *     from zoneinfo import ZoneInfo             # <<<<<<<<<<<<<<
 * 
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_ZoneInfo);
  __Pyx_GIVEREF(__pyx_n_s_ZoneInfo);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ZoneInfo)) __PYX_ERR(1, 853, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_zoneinfo, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ZoneInfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_ZoneInfo = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":855
 *     from zoneinfo import ZoneInfo
 * 
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)             # <<<<<<<<<<<<<<
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_dt = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":856
 * 
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))             # <<<<<<<<<<<<<<
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 *     tz3 = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hours, __pyx_int_1) < 0) __PYX_ERR(1, 856, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_minutes, __pyx_int_1) < 0) __PYX_ERR(1, 856, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_tz1 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":857
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))             # <<<<<<<<<<<<<<
 *     tz3 = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))
 *     tz4 = ZoneInfo("CET")
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hours, __pyx_int_23) < 0) __PYX_ERR(1, 857, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_minutes, __pyx_int_59) < 0) __PYX_ERR(1, 857, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 857, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_tz2 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":858
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 *     tz3 = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))             # <<<<<<<<<<<<<<
 *     tz4 = ZoneInfo("CET")
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hours, __pyx_int_neg_23) < 0) __PYX_ERR(1, 858, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_minutes, __pyx_int_neg_59) < 0) __PYX_ERR(1, 858, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_tz3 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":859
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 *     tz3 = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))
 *     tz4 = ZoneInfo("CET")             # <<<<<<<<<<<<<<
 * 
 *     for tz in (None, tz1, tz2, tz3, tz4):
 */
  __Pyx_INCREF(__pyx_v_ZoneInfo);
  __pyx_t_2 = __pyx_v_ZoneInfo; __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_n_u_CET};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 859, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_tz4 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":861
 *     tz4 = ZoneInfo("CET")
 * 
 *     for tz in (None, tz1, tz2, tz3, tz4):             # <<<<<<<<<<<<<<
 *         assert dt.replace(tzinfo=tz) == dt_replace_tz(dt, tz)  # type: ignore
 *     assert 1 == dt_replace_fold(dt.replace(tzinfo=tz1, fold=0), 1).fold  # type: ignore
 */
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, Py_None)) __PYX_ERR(1, 861, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_tz1);
  __Pyx_GIVEREF(__pyx_v_tz1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_tz1)) __PYX_ERR(1, 861, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_tz2);
  __Pyx_GIVEREF(__pyx_v_tz2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_tz2)) __PYX_ERR(1, 861, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_tz3);
  __Pyx_GIVEREF(__pyx_v_tz3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_tz3)) __PYX_ERR(1, 861, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_tz4);
  __Pyx_GIVEREF(__pyx_v_tz4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_tz4)) __PYX_ERR(1, 861, __pyx_L1_error);
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
  __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_7 >= 5) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(1, 861, __pyx_L1_error)
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_tz, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/utils.py":862
 * 
 *     for tz in (None, tz1, tz2, tz3, tz4):
 *         assert dt.replace(tzinfo=tz) == dt_replace_tz(dt, tz)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert 1 == dt_replace_fold(dt.replace(tzinfo=tz1, fold=0), 1).fold  # type: ignore
 * 
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_tzinfo, __pyx_v_tz) < 0) __PYX_ERR(1, 862, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 862, __pyx_L1_error)
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_replace_tz(((PyDateTime_DateTime *)__pyx_v_dt), __pyx_v_tz)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 862, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 862, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 862, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_8)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 862, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 862, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":861
 *     tz4 = ZoneInfo("CET")
 * 
 *     for tz in (None, tz1, tz2, tz3, tz4):             # <<<<<<<<<<<<<<
 *         assert dt.replace(tzinfo=tz) == dt_replace_tz(dt, tz)  # type: ignore
 *     assert 1 == dt_replace_fold(dt.replace(tzinfo=tz1, fold=0), 1).fold  # type: ignore
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":863
 *     for tz in (None, tz1, tz2, tz3, tz4):
 *         assert dt.replace(tzinfo=tz) == dt_replace_tz(dt, tz)  # type: ignore
 *     assert 1 == dt_replace_fold(dt.replace(tzinfo=tz1, fold=0), 1).fold  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: dt_manipulate")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tzinfo, __pyx_v_tz1) < 0) __PYX_ERR(1, 863, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fold, __pyx_int_0) < 0) __PYX_ERR(1, 863, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 863, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_replace_fold(((PyDateTime_DateTime *)__pyx_t_5), 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = (1 == __pyx_f_7cpython_8datetime_8datetime_4fold_fold(((PyDateTime_DateTime *)__pyx_t_1)));
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 863, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 863, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":865
 *     assert 1 == dt_replace_fold(dt.replace(tzinfo=tz1, fold=0), 1).fold  # type: ignore
 * 
 *     print("Passed: dt_manipulate")             # <<<<<<<<<<<<<<
 * 
 *     del datetime, ZoneInfo
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":867
 *     print("Passed: dt_manipulate")
 * 
 *     del datetime, ZoneInfo             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;
  __Pyx_DECREF(__pyx_v_ZoneInfo); __pyx_v_ZoneInfo = 0;

  /* "cytimes/utils.py":851
 * 
 * 
 * def _test_dt_mainipulate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils._test_dt_mainipulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_ZoneInfo);
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XDECREF(__pyx_v_tz1);
  __Pyx_XDECREF(__pyx_v_tz2);
  __Pyx_XDECREF(__pyx_v_tz3);
  __Pyx_XDECREF(__pyx_v_tz4);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":870
 * 
 * 
 * def _test_dt_arithmetic() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_47_test_dt_arithmetic(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_47_test_dt_arithmetic = {"_test_dt_arithmetic", (PyCFunction)__pyx_pw_7cytimes_5utils_47_test_dt_arithmetic, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_47_test_dt_arithmetic(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_dt_arithmetic (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_46_test_dt_arithmetic(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_46_test_dt_arithmetic(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_dt = NULL;
  PyObject *__pyx_v_td1 = NULL;
  PyObject *__pyx_v_td2 = NULL;
  PyObject *__pyx_v_td3 = NULL;
  PyObject *__pyx_v_td4 = NULL;
  PyObject *__pyx_v_td5 = NULL;
  PyObject *__pyx_v_td6 = NULL;
  PyObject *__pyx_v_td7 = NULL;
  PyObject *__pyx_v_td8 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt_add __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_dt_arithmetic", 1);

  /* "cytimes/utils.py":871
 * 
 * def _test_dt_arithmetic() -> None:
 *     import datetime             # <<<<<<<<<<<<<<
 * 
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":873
 *     import datetime
 * 
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)             # <<<<<<<<<<<<<<
 *     td1 = datetime.timedelta(1, 1, 1)
 *     assert dt_add(dt, 1, 1, 1) == dt + td1  # type: ignore
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dt = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":874
 * 
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)
 *     td1 = datetime.timedelta(1, 1, 1)             # <<<<<<<<<<<<<<
 *     assert dt_add(dt, 1, 1, 1) == dt + td1  # type: ignore
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_td1 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":875
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)
 *     td1 = datetime.timedelta(1, 1, 1)
 *     assert dt_add(dt, 1, 1, 1) == dt + td1  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     td2 = datetime.timedelta(1, 86400, 1)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 875, __pyx_L1_error)
    __pyx_t_3.__pyx_n = 3;
    __pyx_t_3.days = 1;
    __pyx_t_3.seconds = 1;
    __pyx_t_3.microseconds = 1;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_add(((PyDateTime_DateTime *)__pyx_v_dt), &__pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyNumber_Add(__pyx_v_dt, __pyx_v_td1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 875, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 875, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 875, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 875, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":877
 *     assert dt_add(dt, 1, 1, 1) == dt + td1  # type: ignore
 * 
 *     td2 = datetime.timedelta(1, 86400, 1)             # <<<<<<<<<<<<<<
 *     assert dt_add(dt, 1, 86400, 1) == dt + td2  # type: ignore
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_td2 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":878
 * 
 *     td2 = datetime.timedelta(1, 86400, 1)
 *     assert dt_add(dt, 1, 86400, 1) == dt + td2  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     td3 = datetime.timedelta(1, 86399, 1)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 878, __pyx_L1_error)
    __pyx_t_3.__pyx_n = 3;
    __pyx_t_3.days = 1;
    __pyx_t_3.seconds = 0x15180;
    __pyx_t_3.microseconds = 1;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_add(((PyDateTime_DateTime *)__pyx_v_dt), &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 878, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyNumber_Add(__pyx_v_dt, __pyx_v_td2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 878, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 878, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 878, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 878, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 878, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":880
 *     assert dt_add(dt, 1, 86400, 1) == dt + td2  # type: ignore
 * 
 *     td3 = datetime.timedelta(1, 86399, 1)             # <<<<<<<<<<<<<<
 *     assert dt_add(dt, 1, 86399, 1) == dt + td3  # type: ignore
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_td3 = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":881
 * 
 *     td3 = datetime.timedelta(1, 86399, 1)
 *     assert dt_add(dt, 1, 86399, 1) == dt + td3  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     td4 = datetime.timedelta(-1, -1, -1)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 881, __pyx_L1_error)
    __pyx_t_3.__pyx_n = 3;
    __pyx_t_3.days = 1;
    __pyx_t_3.seconds = 0x1517F;
    __pyx_t_3.microseconds = 1;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_add(((PyDateTime_DateTime *)__pyx_v_dt), &__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 881, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyNumber_Add(__pyx_v_dt, __pyx_v_td3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 881, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 881, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 881, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 881, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 881, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":883
 *     assert dt_add(dt, 1, 86399, 1) == dt + td3  # type: ignore
 * 
 *     td4 = datetime.timedelta(-1, -1, -1)             # <<<<<<<<<<<<<<
 *     assert dt_add(dt, -1, -1, -1) == dt + td4  # type: ignore
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_td4 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":884
 * 
 *     td4 = datetime.timedelta(-1, -1, -1)
 *     assert dt_add(dt, -1, -1, -1) == dt + td4  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     td5 = datetime.timedelta(-1, -86400, -1)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 884, __pyx_L1_error)
    __pyx_t_3.__pyx_n = 3;
    __pyx_t_3.days = -1;
    __pyx_t_3.seconds = -1;
    __pyx_t_3.microseconds = -1;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_add(((PyDateTime_DateTime *)__pyx_v_dt), &__pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 884, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyNumber_Add(__pyx_v_dt, __pyx_v_td4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 884, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 884, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 884, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 884, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 884, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":886
 *     assert dt_add(dt, -1, -1, -1) == dt + td4  # type: ignore
 * 
 *     td5 = datetime.timedelta(-1, -86400, -1)             # <<<<<<<<<<<<<<
 *     assert dt_add(dt, -1, -86400, -1) == dt + td5  # type: ignore
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_td5 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":887
 * 
 *     td5 = datetime.timedelta(-1, -86400, -1)
 *     assert dt_add(dt, -1, -86400, -1) == dt + td5  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     td6 = datetime.timedelta(-1, -86399, -1)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 887, __pyx_L1_error)
    __pyx_t_3.__pyx_n = 3;
    __pyx_t_3.days = -1;
    __pyx_t_3.seconds = -86400;
    __pyx_t_3.microseconds = -1;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_add(((PyDateTime_DateTime *)__pyx_v_dt), &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyNumber_Add(__pyx_v_dt, __pyx_v_td5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 887, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 887, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 887, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 887, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":889
 *     assert dt_add(dt, -1, -86400, -1) == dt + td5  # type: ignore
 * 
 *     td6 = datetime.timedelta(-1, -86399, -1)             # <<<<<<<<<<<<<<
 *     assert dt_add(dt, -1, -86399, -1) == dt + td6  # type: ignore
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_td6 = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":890
 * 
 *     td6 = datetime.timedelta(-1, -86399, -1)
 *     assert dt_add(dt, -1, -86399, -1) == dt + td6  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     td7 = datetime.timedelta(1, 60, 100000)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 890, __pyx_L1_error)
    __pyx_t_3.__pyx_n = 3;
    __pyx_t_3.days = -1;
    __pyx_t_3.seconds = -86399;
    __pyx_t_3.microseconds = -1;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_add(((PyDateTime_DateTime *)__pyx_v_dt), &__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyNumber_Add(__pyx_v_dt, __pyx_v_td6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 890, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 890, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 890, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 890, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":892
 *     assert dt_add(dt, -1, -86399, -1) == dt + td6  # type: ignore
 * 
 *     td7 = datetime.timedelta(1, 60, 100000)             # <<<<<<<<<<<<<<
 *     assert dt_add(dt, 1, 60, 100000) == dt + td7  # type: ignore
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_td7 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":893
 * 
 *     td7 = datetime.timedelta(1, 60, 100000)
 *     assert dt_add(dt, 1, 60, 100000) == dt + td7  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     td8 = datetime.timedelta(-1, -60, -100000)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 893, __pyx_L1_error)
    __pyx_t_3.__pyx_n = 3;
    __pyx_t_3.days = 1;
    __pyx_t_3.seconds = 60;
    __pyx_t_3.microseconds = 0x186A0;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_add(((PyDateTime_DateTime *)__pyx_v_dt), &__pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyNumber_Add(__pyx_v_dt, __pyx_v_td7); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 893, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 893, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 893, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 893, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":895
 *     assert dt_add(dt, 1, 60, 100000) == dt + td7  # type: ignore
 * 
 *     td8 = datetime.timedelta(-1, -60, -100000)             # <<<<<<<<<<<<<<
 *     assert dt_add(dt, -1, -60, -100000) == dt + td8  # type: ignore
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_td8 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":896
 * 
 *     td8 = datetime.timedelta(-1, -60, -100000)
 *     assert dt_add(dt, -1, -60, -100000) == dt + td8  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: date_arithmetic")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 896, __pyx_L1_error)
    __pyx_t_3.__pyx_n = 3;
    __pyx_t_3.days = -1;
    __pyx_t_3.seconds = -60;
    __pyx_t_3.microseconds = -100000;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_add(((PyDateTime_DateTime *)__pyx_v_dt), &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 896, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyNumber_Add(__pyx_v_dt, __pyx_v_td8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 896, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 896, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 896, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 896, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 896, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":898
 *     assert dt_add(dt, -1, -60, -100000) == dt + td8  # type: ignore
 * 
 *     print("Passed: date_arithmetic")             # <<<<<<<<<<<<<<
 * 
 *     del datetime
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":900
 *     print("Passed: date_arithmetic")
 * 
 *     del datetime             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;

  /* "cytimes/utils.py":870
 * 
 * 
 * def _test_dt_arithmetic() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils._test_dt_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XDECREF(__pyx_v_td1);
  __Pyx_XDECREF(__pyx_v_td2);
  __Pyx_XDECREF(__pyx_v_td3);
  __Pyx_XDECREF(__pyx_v_td4);
  __Pyx_XDECREF(__pyx_v_td5);
  __Pyx_XDECREF(__pyx_v_td6);
  __Pyx_XDECREF(__pyx_v_td7);
  __Pyx_XDECREF(__pyx_v_td8);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":904
 * 
 * # datetime.time
 * def _test_time_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_49_test_time_generate(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_49_test_time_generate = {"_test_time_generate", (PyCFunction)__pyx_pw_7cytimes_5utils_49_test_time_generate, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_49_test_time_generate(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_time_generate (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_48_test_time_generate(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_48_test_time_generate(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_tz = NULL;
  PyObject *__pyx_v_t_n = NULL;
  PyObject *__pyx_v_t_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_time_new __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_time_now __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_UCS4 __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_time_generate", 1);

  /* "cytimes/utils.py":905
 * # datetime.time
 * def _test_time_generate() -> None:
 *     import datetime             # <<<<<<<<<<<<<<
 * 
 *     tz = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":907
 *     import datetime
 * 
 *     tz = datetime.timezone(datetime.timedelta(hours=23, minutes=59))             # <<<<<<<<<<<<<<
 * 
 *     # New
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hours, __pyx_int_23) < 0) __PYX_ERR(1, 907, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_minutes, __pyx_int_59) < 0) __PYX_ERR(1, 907, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":910
 * 
 *     # New
 *     assert datetime.time(0, 0, 0, 0) == time_new()  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.time(0, 0, 0, 0) == time_new(0)  # type: ignore
 *     assert datetime.time(0, 0, 0, 0) == time_new(0, 0)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_time_new(NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 910, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 910, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 910, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 910, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":911
 *     # New
 *     assert datetime.time(0, 0, 0, 0) == time_new()  # type: ignore
 *     assert datetime.time(0, 0, 0, 0) == time_new(0)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.time(0, 0, 0, 0) == time_new(0, 0)  # type: ignore
 *     assert datetime.time(0, 0, 0, 0) == time_new(0, 0, 0)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 911, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 911, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.hour = 0;
    __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_time_new(&__pyx_t_8)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 911, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 911, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 911, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 911, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 911, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":912
 *     assert datetime.time(0, 0, 0, 0) == time_new()  # type: ignore
 *     assert datetime.time(0, 0, 0, 0) == time_new(0)  # type: ignore
 *     assert datetime.time(0, 0, 0, 0) == time_new(0, 0)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.time(0, 0, 0, 0) == time_new(0, 0, 0)  # type: ignore
 *     assert datetime.time(0, 0, 0, 0) == time_new(0, 0, 0, 0)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 912, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 912, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.hour = 0;
    __pyx_t_8.minute = 0;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_time_new(&__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 912, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 912, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 912, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 912, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 912, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":913
 *     assert datetime.time(0, 0, 0, 0) == time_new(0)  # type: ignore
 *     assert datetime.time(0, 0, 0, 0) == time_new(0, 0)  # type: ignore
 *     assert datetime.time(0, 0, 0, 0) == time_new(0, 0, 0)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.time(0, 0, 0, 0) == time_new(0, 0, 0, 0)  # type: ignore
 *     assert datetime.time(1, 0, 0, 0) == time_new(1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8.__pyx_n = 3;
    __pyx_t_8.hour = 0;
    __pyx_t_8.minute = 0;
    __pyx_t_8.second = 0;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_time_new(&__pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 913, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 913, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 913, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 913, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":914
 *     assert datetime.time(0, 0, 0, 0) == time_new(0, 0)  # type: ignore
 *     assert datetime.time(0, 0, 0, 0) == time_new(0, 0, 0)  # type: ignore
 *     assert datetime.time(0, 0, 0, 0) == time_new(0, 0, 0, 0)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.time(1, 0, 0, 0) == time_new(1)  # type: ignore
 *     assert datetime.time(1, 1, 0, 0) == time_new(1, 1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8.__pyx_n = 4;
    __pyx_t_8.hour = 0;
    __pyx_t_8.minute = 0;
    __pyx_t_8.second = 0;
    __pyx_t_8.microsecond = 0;
    __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_time_new(&__pyx_t_8)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 914, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 914, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 914, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 914, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":915
 *     assert datetime.time(0, 0, 0, 0) == time_new(0, 0, 0)  # type: ignore
 *     assert datetime.time(0, 0, 0, 0) == time_new(0, 0, 0, 0)  # type: ignore
 *     assert datetime.time(1, 0, 0, 0) == time_new(1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.time(1, 1, 0, 0) == time_new(1, 1)  # type: ignore
 *     assert datetime.time(1, 1, 1, 0) == time_new(1, 1, 1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.hour = 1;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_time_new(&__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 915, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 915, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 915, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 915, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":916
 *     assert datetime.time(0, 0, 0, 0) == time_new(0, 0, 0, 0)  # type: ignore
 *     assert datetime.time(1, 0, 0, 0) == time_new(1)  # type: ignore
 *     assert datetime.time(1, 1, 0, 0) == time_new(1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.time(1, 1, 1, 0) == time_new(1, 1, 1)  # type: ignore
 *     assert datetime.time(1, 1, 1, 1) == time_new(1, 1, 1, 1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 916, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 916, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.hour = 1;
    __pyx_t_8.minute = 1;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_time_new(&__pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 916, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 916, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 916, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 916, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 916, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":917
 *     assert datetime.time(1, 0, 0, 0) == time_new(1)  # type: ignore
 *     assert datetime.time(1, 1, 0, 0) == time_new(1, 1)  # type: ignore
 *     assert datetime.time(1, 1, 1, 0) == time_new(1, 1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.time(1, 1, 1, 1) == time_new(1, 1, 1, 1)  # type: ignore
 *     assert datetime.time(1, 1, 1, 1, tz) == time_new(1, 1, 1, 1, tz)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8.__pyx_n = 3;
    __pyx_t_8.hour = 1;
    __pyx_t_8.minute = 1;
    __pyx_t_8.second = 1;
    __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_time_new(&__pyx_t_8)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 917, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 917, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 917, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 917, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":918
 *     assert datetime.time(1, 1, 0, 0) == time_new(1, 1)  # type: ignore
 *     assert datetime.time(1, 1, 1, 0) == time_new(1, 1, 1)  # type: ignore
 *     assert datetime.time(1, 1, 1, 1) == time_new(1, 1, 1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.time(1, 1, 1, 1, tz) == time_new(1, 1, 1, 1, tz)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 918, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 918, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8.__pyx_n = 4;
    __pyx_t_8.hour = 1;
    __pyx_t_8.minute = 1;
    __pyx_t_8.second = 1;
    __pyx_t_8.microsecond = 1;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_time_new(&__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 918, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 918, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 918, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 918, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 918, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":919
 *     assert datetime.time(1, 1, 1, 0) == time_new(1, 1, 1)  # type: ignore
 *     assert datetime.time(1, 1, 1, 1) == time_new(1, 1, 1, 1)  # type: ignore
 *     assert datetime.time(1, 1, 1, 1, tz) == time_new(1, 1, 1, 1, tz)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     # Now
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 919, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[6] = {__pyx_t_5, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_v_tz};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_8.__pyx_n = 5;
    __pyx_t_8.hour = 1;
    __pyx_t_8.minute = 1;
    __pyx_t_8.second = 1;
    __pyx_t_8.microsecond = 1;
    __pyx_t_8.tz = __pyx_v_tz;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_time_new(&__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 919, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 919, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(1, 919, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 919, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 919, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":923
 *     # Now
 *     for t_n, t_c in (
 *         (datetime.datetime.now().time(), time_now()),  # type: ignore             # <<<<<<<<<<<<<<
 *         (datetime.datetime.now().time(), time_now(None)),  # type: ignore
 *         (datetime.datetime.now(UTC).timetz(), time_now(UTC)),  # type: ignore
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_now); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __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_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 923, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 923, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_time_now(NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5)) __PYX_ERR(1, 923, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(1, 923, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":924
 *     for t_n, t_c in (
 *         (datetime.datetime.now().time(), time_now()),  # type: ignore
 *         (datetime.datetime.now().time(), time_now(None)),  # type: ignore             # <<<<<<<<<<<<<<
 *         (datetime.datetime.now(UTC).timetz(), time_now(UTC)),  # type: ignore
 *         (datetime.datetime.now(tz).timetz(), time_now(tz)),  # type: ignore
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_now); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __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_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.tz = Py_None;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_time_now(&__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(1, 924, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(1, 924, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;

  /* "cytimes/utils.py":925
 *         (datetime.datetime.now().time(), time_now()),  # type: ignore
 *         (datetime.datetime.now().time(), time_now(None)),  # type: ignore
 *         (datetime.datetime.now(UTC).timetz(), time_now(UTC)),  # type: ignore             # <<<<<<<<<<<<<<
 *         (datetime.datetime.now(tz).timetz(), time_now(tz)),  # type: ignore
 *     ):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_now); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_7cytimes_5utils_UTC)};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_timetz); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __pyx_t_10 = ((PyObject *)__pyx_v_7cytimes_5utils_UTC);
  __Pyx_INCREF(__pyx_t_10);
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.tz = __pyx_t_10;
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_time_now(&__pyx_t_9)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3)) __PYX_ERR(1, 925, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_4)) __PYX_ERR(1, 925, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":926
 *         (datetime.datetime.now().time(), time_now(None)),  # type: ignore
 *         (datetime.datetime.now(UTC).timetz(), time_now(UTC)),  # type: ignore
 *         (datetime.datetime.now(tz).timetz(), time_now(tz)),  # type: ignore             # <<<<<<<<<<<<<<
 *     ):
 *         assert (
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_now); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __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_11))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_11, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_tz};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 926, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_timetz); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_11))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_11, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 926, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.tz = __pyx_v_tz;
  __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_time_now(&__pyx_t_9)); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 926, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_11);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11)) __PYX_ERR(1, 926, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_11 = 0;

  /* "cytimes/utils.py":923
 *     # Now
 *     for t_n, t_c in (
 *         (datetime.datetime.now().time(), time_now()),  # type: ignore             # <<<<<<<<<<<<<<
 *         (datetime.datetime.now().time(), time_now(None)),  # type: ignore
 *         (datetime.datetime.now(UTC).timetz(), time_now(UTC)),  # type: ignore
 */
  __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2)) __PYX_ERR(1, 923, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_5)) __PYX_ERR(1, 923, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10)) __PYX_ERR(1, 923, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_3)) __PYX_ERR(1, 923, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_5 = 0;
  __pyx_t_10 = 0;
  __pyx_t_3 = 0;

  /* "cytimes/utils.py":922
 * 
 *     # Now
 *     for t_n, t_c in (             # <<<<<<<<<<<<<<
 *         (datetime.datetime.now().time(), time_now()),  # type: ignore
 *         (datetime.datetime.now().time(), time_now(None)),  # type: ignore
 */
  __pyx_t_3 = __pyx_t_11; __Pyx_INCREF(__pyx_t_3);
  __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  for (;;) {
    if (__pyx_t_12 >= 4) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_11); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(1, 922, __pyx_L1_error)
    #else
    __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    #endif
    if (likely(__pyx_t_11 != Py_None)) {
      PyObject* sequence = __pyx_t_11;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(1, 922, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 922, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 922, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    } else {
      __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 922, __pyx_L1_error)
    }
    __Pyx_XDECREF_SET(__pyx_v_t_n, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_XDECREF_SET(__pyx_v_t_c, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cytimes/utils.py":928
 *         (datetime.datetime.now(tz).timetz(), time_now(tz)),  # type: ignore
 *     ):
 *         assert (             # <<<<<<<<<<<<<<
 *             (t_n.hour == t_c.hour)
 *             and (t_n.minute == t_c.minute)
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {

      /* "cytimes/utils.py":929
 *     ):
 *         assert (
 *             (t_n.hour == t_c.hour)             # <<<<<<<<<<<<<<
 *             and (t_n.minute == t_c.minute)
 *             and (t_n.second == t_c.second)
 */
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_n, __pyx_n_s_hour); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 929, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_c, __pyx_n_s_hour); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 929, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = PyObject_RichCompare(__pyx_t_11, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 929, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(1, 929, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (__pyx_t_13) {
      } else {
        __pyx_t_7 = __pyx_t_13;
        goto __pyx_L5_bool_binop_done;
      }

      /* "cytimes/utils.py":930
 *         assert (
 *             (t_n.hour == t_c.hour)
 *             and (t_n.minute == t_c.minute)             # <<<<<<<<<<<<<<
 *             and (t_n.second == t_c.second)
 *             and (-1000 < t_n.microsecond - t_c.microsecond < 1000)
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_n, __pyx_n_s_minute); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 930, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_c, __pyx_n_s_minute); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 930, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = PyObject_RichCompare(__pyx_t_10, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 930, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(1, 930, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (__pyx_t_13) {
      } else {
        __pyx_t_7 = __pyx_t_13;
        goto __pyx_L5_bool_binop_done;
      }

      /* "cytimes/utils.py":931
 *             (t_n.hour == t_c.hour)
 *             and (t_n.minute == t_c.minute)
 *             and (t_n.second == t_c.second)             # <<<<<<<<<<<<<<
 *             and (-1000 < t_n.microsecond - t_c.microsecond < 1000)
 *             and (t_n.tzinfo == t_c.tzinfo)
 */
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_n, __pyx_n_s_second); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 931, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_c, __pyx_n_s_second); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 931, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = PyObject_RichCompare(__pyx_t_11, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 931, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(1, 931, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (__pyx_t_13) {
      } else {
        __pyx_t_7 = __pyx_t_13;
        goto __pyx_L5_bool_binop_done;
      }

      /* "cytimes/utils.py":932
 *             and (t_n.minute == t_c.minute)
 *             and (t_n.second == t_c.second)
 *             and (-1000 < t_n.microsecond - t_c.microsecond < 1000)             # <<<<<<<<<<<<<<
 *             and (t_n.tzinfo == t_c.tzinfo)
 *         ), f"{t_n} != {t_c}"
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_n, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 932, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_c, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 932, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = PyNumber_Subtract(__pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 932, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_RichCompare(__pyx_int_neg_1000, __pyx_t_11, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 932, __pyx_L1_error)
      if (__Pyx_PyObject_IsTrue(__pyx_t_5)) {
        __Pyx_DECREF(__pyx_t_5);
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_11, __pyx_int_1000, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 932, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(1, 932, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_13) {
      } else {
        __pyx_t_7 = __pyx_t_13;
        goto __pyx_L5_bool_binop_done;
      }

      /* "cytimes/utils.py":933
 *             and (t_n.second == t_c.second)
 *             and (-1000 < t_n.microsecond - t_c.microsecond < 1000)
 *             and (t_n.tzinfo == t_c.tzinfo)             # <<<<<<<<<<<<<<
 *         ), f"{t_n} != {t_c}"
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_n, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 933, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_c, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 933, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = PyObject_RichCompare(__pyx_t_5, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 933, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(1, 933, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_7 = __pyx_t_13;
      __pyx_L5_bool_binop_done:;
      if (unlikely(!__pyx_t_7)) {

        /* "cytimes/utils.py":934
 *             and (-1000 < t_n.microsecond - t_c.microsecond < 1000)
 *             and (t_n.tzinfo == t_c.tzinfo)
 *         ), f"{t_n} != {t_c}"             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: time_generate")
 */
        __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 934, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_14 = 0;
        __pyx_t_15 = 127;
        __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_t_n, __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 934, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_15;
        __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_INCREF(__pyx_kp_u__38);
        __pyx_t_14 += 4;
        __Pyx_GIVEREF(__pyx_kp_u__38);
        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_kp_u__38);
        __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_t_c, __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 934, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_15;
        __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_11);
        __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 934, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_11, 0, 0);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __PYX_ERR(1, 928, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 928, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":922
 * 
 *     # Now
 *     for t_n, t_c in (             # <<<<<<<<<<<<<<
 *         (datetime.datetime.now().time(), time_now()),  # type: ignore
 *         (datetime.datetime.now().time(), time_now(None)),  # type: ignore
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":936
 *         ), f"{t_n} != {t_c}"
 * 
 *     print("Passed: time_generate")             # <<<<<<<<<<<<<<
 * 
 *     del datetime
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":938
 *     print("Passed: time_generate")
 * 
 *     del datetime             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;

  /* "cytimes/utils.py":904
 * 
 * # datetime.time
 * def _test_time_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.utils._test_time_generate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XDECREF(__pyx_v_t_n);
  __Pyx_XDECREF(__pyx_v_t_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":941
 * 
 * 
 * def _test_time_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_51_test_time_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_51_test_time_type_check = {"_test_time_type_check", (PyCFunction)__pyx_pw_7cytimes_5utils_51_test_time_type_check, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_51_test_time_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_time_type_check (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_50_test_time_type_check(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_50_test_time_type_check(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_CustomTime = NULL;
  PyObject *__pyx_v_time = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_time_type_check", 1);

  /* "cytimes/utils.py":942
 * 
 * def _test_time_type_check() -> None:
 *     import datetime             # <<<<<<<<<<<<<<
 * 
 *     class CustomTime(datetime.time):
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":944
 *     import datetime
 * 
 *     class CustomTime(datetime.time):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(1, 944, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_CustomTime, __pyx_n_s_test_time_type_check_locals_Cus, (PyObject *) NULL, __pyx_n_s_cytimes_utils, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_1 != __pyx_t_2) {
    if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(1, 944, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_CustomTime, __pyx_t_1, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_CustomTime = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":947
 *         pass
 * 
 *     time = datetime.time(1, 1, 1)             # <<<<<<<<<<<<<<
 *     assert is_time(time)  # type: ignore
 *     assert is_time_exact(time)  # type: ignore
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_time = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cytimes/utils.py":948
 * 
 *     time = datetime.time(1, 1, 1)
 *     assert is_time(time)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert is_time_exact(time)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = __pyx_f_7cytimes_5utils_is_time(__pyx_v_time); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 948, __pyx_L1_error)
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 948, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 948, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":949
 *     time = datetime.time(1, 1, 1)
 *     assert is_time(time)  # type: ignore
 *     assert is_time_exact(time)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     time = CustomTime(1, 1, 1)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = __pyx_f_7cytimes_5utils_is_time_exact(__pyx_v_time); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 949, __pyx_L1_error)
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 949, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 949, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":951
 *     assert is_time_exact(time)  # type: ignore
 * 
 *     time = CustomTime(1, 1, 1)             # <<<<<<<<<<<<<<
 *     assert is_time(time)  # type: ignore
 *     assert not is_time_exact(time)  # type: ignore
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_CustomTime, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_time, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/utils.py":952
 * 
 *     time = CustomTime(1, 1, 1)
 *     assert is_time(time)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert not is_time_exact(time)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = __pyx_f_7cytimes_5utils_is_time(__pyx_v_time); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 952, __pyx_L1_error)
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 952, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 952, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":953
 *     time = CustomTime(1, 1, 1)
 *     assert is_time(time)  # type: ignore
 *     assert not is_time_exact(time)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: time_type_check")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = __pyx_f_7cytimes_5utils_is_time_exact(__pyx_v_time); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 953, __pyx_L1_error)
    __pyx_t_6 = (!__pyx_t_5);
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 953, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 953, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":955
 *     assert not is_time_exact(time)  # type: ignore
 * 
 *     print("Passed: time_type_check")             # <<<<<<<<<<<<<<
 * 
 *     del CustomTime, datetime
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":957
 *     print("Passed: time_type_check")
 * 
 *     del CustomTime, datetime             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_CustomTime); __pyx_v_CustomTime = 0;
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;

  /* "cytimes/utils.py":941
 * 
 * 
 * def _test_time_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils._test_time_type_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_CustomTime);
  __Pyx_XDECREF(__pyx_v_time);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":960
 * 
 * 
 * def _test_time_tzinfo() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_53_test_time_tzinfo(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_53_test_time_tzinfo = {"_test_time_tzinfo", (PyCFunction)__pyx_pw_7cytimes_5utils_53_test_time_tzinfo, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_53_test_time_tzinfo(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_time_tzinfo (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_52_test_time_tzinfo(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_52_test_time_tzinfo(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_ZoneInfo = NULL;
  PyObject *__pyx_v_time = NULL;
  PyObject *__pyx_v_tz1 = NULL;
  PyObject *__pyx_v_time_tz1 = NULL;
  PyObject *__pyx_v_tz2 = NULL;
  PyObject *__pyx_v_time_tz2 = NULL;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_time_tzinfo", 1);

  /* "cytimes/utils.py":961
 * 
 * def _test_time_tzinfo() -> None:
 *     import datetime             # <<<<<<<<<<<<<<
 *     from zoneinfo import ZoneInfo
 * 
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":962
 * def _test_time_tzinfo() -> None:
 *     import datetime
 *     from zoneinfo import ZoneInfo             # <<<<<<<<<<<<<<
 * 
 *     time = datetime.time(3, 4, 5, 6)
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_ZoneInfo);
  __Pyx_GIVEREF(__pyx_n_s_ZoneInfo);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ZoneInfo)) __PYX_ERR(1, 962, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_zoneinfo, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ZoneInfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_ZoneInfo = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":964
 *     from zoneinfo import ZoneInfo
 * 
 *     time = datetime.time(3, 4, 5, 6)             # <<<<<<<<<<<<<<
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     time_tz1 = datetime.time(3, 4, 5, 6, tz1)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_time = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":965
 * 
 *     time = datetime.time(3, 4, 5, 6)
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))             # <<<<<<<<<<<<<<
 *     time_tz1 = datetime.time(3, 4, 5, 6, tz1)
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hours, __pyx_int_1) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_minutes, __pyx_int_1) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 965, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_tz1 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":966
 *     time = datetime.time(3, 4, 5, 6)
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     time_tz1 = datetime.time(3, 4, 5, 6, tz1)             # <<<<<<<<<<<<<<
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 *     time_tz2 = datetime.time(3, 4, 5, 6, tz2)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[6] = {__pyx_t_5, __pyx_int_3, __pyx_int_4, __pyx_int_5, __pyx_int_6, __pyx_v_tz1};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_time_tz1 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":967
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     time_tz1 = datetime.time(3, 4, 5, 6, tz1)
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))             # <<<<<<<<<<<<<<
 *     time_tz2 = datetime.time(3, 4, 5, 6, tz2)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hours, __pyx_int_23) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_minutes, __pyx_int_59) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 967, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_tz2 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":968
 *     time_tz1 = datetime.time(3, 4, 5, 6, tz1)
 *     tz2 = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 *     time_tz2 = datetime.time(3, 4, 5, 6, tz2)             # <<<<<<<<<<<<<<
 * 
 *     for t in (time, time_tz1, time_tz2):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[6] = {__pyx_t_3, __pyx_int_3, __pyx_int_4, __pyx_int_5, __pyx_int_6, __pyx_v_tz2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 968, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_time_tz2 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":970
 *     time_tz2 = datetime.time(3, 4, 5, 6, tz2)
 * 
 *     for t in (time, time_tz1, time_tz2):             # <<<<<<<<<<<<<<
 *         assert t.tzname() == time_tzname(t)  # type: ignore
 *         assert t.dst() == time_dst(t)  # type: ignore
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_time);
  __Pyx_GIVEREF(__pyx_v_time);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_time)) __PYX_ERR(1, 970, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_time_tz1);
  __Pyx_GIVEREF(__pyx_v_time_tz1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_time_tz1)) __PYX_ERR(1, 970, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_time_tz2);
  __Pyx_GIVEREF(__pyx_v_time_tz2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_time_tz2)) __PYX_ERR(1, 970, __pyx_L1_error);
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
  __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_7 >= 3) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(1, 970, __pyx_L1_error)
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/utils.py":971
 * 
 *     for t in (time, time_tz1, time_tz2):
 *         assert t.tzname() == time_tzname(t)  # type: ignore             # <<<<<<<<<<<<<<
 *         assert t.dst() == time_dst(t)  # type: ignore
 *         assert t.utcoffset() == time_utcoffset(t)  # type: ignore
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_tzname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 971, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 971, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      if (!(likely(((__pyx_v_t) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 971, __pyx_L1_error)
      __pyx_t_3 = __pyx_f_7cytimes_5utils_time_tzname(((PyDateTime_Time *)__pyx_v_t)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 971, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 971, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_8)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 971, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 971, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":972
 *     for t in (time, time_tz1, time_tz2):
 *         assert t.tzname() == time_tzname(t)  # type: ignore
 *         assert t.dst() == time_dst(t)  # type: ignore             # <<<<<<<<<<<<<<
 *         assert t.utcoffset() == time_utcoffset(t)  # type: ignore
 * 
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_dst); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 972, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 972, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      if (!(likely(((__pyx_v_t) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 972, __pyx_L1_error)
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_time_dst(((PyDateTime_Time *)__pyx_v_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 972, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 972, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 972, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_8)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 972, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 972, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":973
 *         assert t.tzname() == time_tzname(t)  # type: ignore
 *         assert t.dst() == time_dst(t)  # type: ignore
 *         assert t.utcoffset() == time_utcoffset(t)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: time_tzinfo")
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 973, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 973, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      if (!(likely(((__pyx_v_t) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 973, __pyx_L1_error)
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_time_utcoffset(((PyDateTime_Time *)__pyx_v_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 973, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 973, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 973, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_8)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 973, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 973, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":970
 *     time_tz2 = datetime.time(3, 4, 5, 6, tz2)
 * 
 *     for t in (time, time_tz1, time_tz2):             # <<<<<<<<<<<<<<
 *         assert t.tzname() == time_tzname(t)  # type: ignore
 *         assert t.dst() == time_dst(t)  # type: ignore
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":975
 *         assert t.utcoffset() == time_utcoffset(t)  # type: ignore
 * 
 *     print("Passed: time_tzinfo")             # <<<<<<<<<<<<<<
 * 
 *     del datetime, ZoneInfo
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":977
 *     print("Passed: time_tzinfo")
 * 
 *     del datetime, ZoneInfo             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;
  __Pyx_DECREF(__pyx_v_ZoneInfo); __pyx_v_ZoneInfo = 0;

  /* "cytimes/utils.py":960
 * 
 * 
 * def _test_time_tzinfo() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils._test_time_tzinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_ZoneInfo);
  __Pyx_XDECREF(__pyx_v_time);
  __Pyx_XDECREF(__pyx_v_tz1);
  __Pyx_XDECREF(__pyx_v_time_tz1);
  __Pyx_XDECREF(__pyx_v_tz2);
  __Pyx_XDECREF(__pyx_v_time_tz2);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":980
 * 
 * 
 * def _test_time_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_55_test_time_conversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_55_test_time_conversion = {"_test_time_conversion", (PyCFunction)__pyx_pw_7cytimes_5utils_55_test_time_conversion, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_55_test_time_conversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_time_conversion (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_54_test_time_conversion(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_54_test_time_conversion(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_t1 = NULL;
  PyObject *__pyx_v_tz1 = NULL;
  PyObject *__pyx_v_t_tz1 = NULL;
  PyObject *__pyx_v_dt = NULL;
  PyObject *__pyx_v_dt_tz1 = NULL;
  PyObject *__pyx_v_secs = NULL;
  PyObject *__pyx_v_offset = NULL;
  PyObject *__pyx_v_us = NULL;
  PyObject *__pyx_v_CustomTime = NULL;
  PyDateTime_Time *__pyx_v_tmp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils_time_to_isoformat __pyx_t_7;
  int __pyx_t_8;
  double __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_time_to_seconds __pyx_t_10;
  PY_LONG_LONG __pyx_t_11;
  struct __pyx_opt_args_7cytimes_5utils_time_to_us __pyx_t_12;
  int __pyx_t_13;
  struct __pyx_opt_args_7cytimes_5utils_time_fr_seconds __pyx_t_14;
  struct __pyx_opt_args_7cytimes_5utils_time_fr_us __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_time_conversion", 1);

  /* "cytimes/utils.py":981
 * 
 * def _test_time_conversion() -> None:
 *     import datetime             # <<<<<<<<<<<<<<
 * 
 *     t1 = datetime.time(3, 4, 5, 6)
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":983
 *     import datetime
 * 
 *     t1 = datetime.time(3, 4, 5, 6)             # <<<<<<<<<<<<<<
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     t_tz1 = datetime.time(3, 4, 5, 6, tz1)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_t1 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":984
 * 
 *     t1 = datetime.time(3, 4, 5, 6)
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))             # <<<<<<<<<<<<<<
 *     t_tz1 = datetime.time(3, 4, 5, 6, tz1)
 *     dt = datetime.datetime(1970, 1, 1, 3, 4, 5, 6)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hours, __pyx_int_1) < 0) __PYX_ERR(1, 984, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_minutes, __pyx_int_1) < 0) __PYX_ERR(1, 984, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_tz1 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":985
 *     t1 = datetime.time(3, 4, 5, 6)
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     t_tz1 = datetime.time(3, 4, 5, 6, tz1)             # <<<<<<<<<<<<<<
 *     dt = datetime.datetime(1970, 1, 1, 3, 4, 5, 6)
 *     dt_tz1 = datetime.datetime(1970, 1, 1, 3, 4, 5, 6, tz1)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 985, __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[6] = {__pyx_t_5, __pyx_int_3, __pyx_int_4, __pyx_int_5, __pyx_int_6, __pyx_v_tz1};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 985, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_t_tz1 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":986
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     t_tz1 = datetime.time(3, 4, 5, 6, tz1)
 *     dt = datetime.datetime(1970, 1, 1, 3, 4, 5, 6)             # <<<<<<<<<<<<<<
 *     dt_tz1 = datetime.datetime(1970, 1, 1, 3, 4, 5, 6, tz1)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_dt = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":987
 *     t_tz1 = datetime.time(3, 4, 5, 6, tz1)
 *     dt = datetime.datetime(1970, 1, 1, 3, 4, 5, 6)
 *     dt_tz1 = datetime.datetime(1970, 1, 1, 3, 4, 5, 6, tz1)             # <<<<<<<<<<<<<<
 * 
 *     assert "03:04:05.000006" == time_to_isoformat(t_tz1, False)  # type: ignore
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 987, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[9] = {__pyx_t_5, __pyx_int_1970, __pyx_int_1, __pyx_int_1, __pyx_int_3, __pyx_int_4, __pyx_int_5, __pyx_int_6, __pyx_v_tz1};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 8+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_dt_tz1 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":989
 *     dt_tz1 = datetime.datetime(1970, 1, 1, 3, 4, 5, 6, tz1)
 * 
 *     assert "03:04:05.000006" == time_to_isoformat(t_tz1, False)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "03:04:05.000006+0101" == time_to_isoformat(t_tz1, True)  # type: ignore
 *     assert "03:04:05" == time_to_isoformat(t_tz1.replace(microsecond=0), False)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_t_tz1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t_tz1, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 989, __pyx_L1_error)
    __pyx_t_7.__pyx_n = 1;
    __pyx_t_7.utc = 0;
    __pyx_t_1 = __pyx_f_7cytimes_5utils_time_to_isoformat(((PyDateTime_Time *)__pyx_v_t_tz1), &__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_03_04_05_000006, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 989, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 989, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 989, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":990
 * 
 *     assert "03:04:05.000006" == time_to_isoformat(t_tz1, False)  # type: ignore
 *     assert "03:04:05.000006+0101" == time_to_isoformat(t_tz1, True)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "03:04:05" == time_to_isoformat(t_tz1.replace(microsecond=0), False)  # type: ignore
 *     assert "03:04:05+0101" == time_to_isoformat(t_tz1.replace(microsecond=0), True)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_t_tz1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t_tz1, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 990, __pyx_L1_error)
    __pyx_t_7.__pyx_n = 1;
    __pyx_t_7.utc = 1;
    __pyx_t_1 = __pyx_f_7cytimes_5utils_time_to_isoformat(((PyDateTime_Time *)__pyx_v_t_tz1), &__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 990, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_03_04_05_000006_0101, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 990, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 990, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 990, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":991
 *     assert "03:04:05.000006" == time_to_isoformat(t_tz1, False)  # type: ignore
 *     assert "03:04:05.000006+0101" == time_to_isoformat(t_tz1, True)  # type: ignore
 *     assert "03:04:05" == time_to_isoformat(t_tz1.replace(microsecond=0), False)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "03:04:05+0101" == time_to_isoformat(t_tz1.replace(microsecond=0), True)  # type: ignore
 *     secs = t1.hour * 3600 + t1.minute * 60 + t1.second + t1.microsecond / 1_000_000
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_tz1, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_microsecond, __pyx_int_0) < 0) __PYX_ERR(1, 991, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 991, __pyx_L1_error)
    __pyx_t_7.__pyx_n = 1;
    __pyx_t_7.utc = 0;
    __pyx_t_2 = __pyx_f_7cytimes_5utils_time_to_isoformat(((PyDateTime_Time *)__pyx_t_5), &__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_03_04_05, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 991, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 991, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 991, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":992
 *     assert "03:04:05.000006+0101" == time_to_isoformat(t_tz1, True)  # type: ignore
 *     assert "03:04:05" == time_to_isoformat(t_tz1.replace(microsecond=0), False)  # type: ignore
 *     assert "03:04:05+0101" == time_to_isoformat(t_tz1.replace(microsecond=0), True)  # type: ignore             # <<<<<<<<<<<<<<
 *     secs = t1.hour * 3600 + t1.minute * 60 + t1.second + t1.microsecond / 1_000_000
 *     assert secs == time_to_seconds(t1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_t_tz1, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_microsecond, __pyx_int_0) < 0) __PYX_ERR(1, 992, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 992, __pyx_L1_error)
    __pyx_t_7.__pyx_n = 1;
    __pyx_t_7.utc = 1;
    __pyx_t_5 = __pyx_f_7cytimes_5utils_time_to_isoformat(((PyDateTime_Time *)__pyx_t_1), &__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_03_04_05_0101, __pyx_t_5, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 992, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 992, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 992, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":993
 *     assert "03:04:05" == time_to_isoformat(t_tz1.replace(microsecond=0), False)  # type: ignore
 *     assert "03:04:05+0101" == time_to_isoformat(t_tz1.replace(microsecond=0), True)  # type: ignore
 *     secs = t1.hour * 3600 + t1.minute * 60 + t1.second + t1.microsecond / 1_000_000             # <<<<<<<<<<<<<<
 *     assert secs == time_to_seconds(t1)  # type: ignore
 *     assert secs == time_to_seconds(t_tz1, False)  # type: ignore
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_t1, __pyx_n_s_hour); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyInt_MultiplyObjC(__pyx_t_5, __pyx_int_3600, 0xE10, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_t1, __pyx_n_s_minute); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_t_5, __pyx_int_60, 60, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_t1, __pyx_n_s_second); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_t1, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_2, __pyx_int_1000000, 0xF4240, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_secs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":994
 *     assert "03:04:05+0101" == time_to_isoformat(t_tz1.replace(microsecond=0), True)  # type: ignore
 *     secs = t1.hour * 3600 + t1.minute * 60 + t1.second + t1.microsecond / 1_000_000
 *     assert secs == time_to_seconds(t1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert secs == time_to_seconds(t_tz1, False)  # type: ignore
 *     offset = datetime.timedelta(hours=1, minutes=1).total_seconds()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_t1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t1, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 994, __pyx_L1_error)
    __pyx_t_9 = __pyx_f_7cytimes_5utils_time_to_seconds(((PyDateTime_Time *)__pyx_v_t1), NULL); if (unlikely(__pyx_t_9 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(1, 994, __pyx_L1_error)
    __pyx_t_2 = PyFloat_FromDouble(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 994, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_secs, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 994, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 994, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 994, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 994, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":995
 *     secs = t1.hour * 3600 + t1.minute * 60 + t1.second + t1.microsecond / 1_000_000
 *     assert secs == time_to_seconds(t1)  # type: ignore
 *     assert secs == time_to_seconds(t_tz1, False)  # type: ignore             # <<<<<<<<<<<<<<
 *     offset = datetime.timedelta(hours=1, minutes=1).total_seconds()
 *     assert secs - offset == time_to_seconds(t_tz1, True)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_t_tz1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t_tz1, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 995, __pyx_L1_error)
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.utc = 0;
    __pyx_t_9 = __pyx_f_7cytimes_5utils_time_to_seconds(((PyDateTime_Time *)__pyx_v_t_tz1), &__pyx_t_10); if (unlikely(__pyx_t_9 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(1, 995, __pyx_L1_error)
    __pyx_t_5 = PyFloat_FromDouble(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 995, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_secs, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 995, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 995, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 995, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 995, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":996
 *     assert secs == time_to_seconds(t1)  # type: ignore
 *     assert secs == time_to_seconds(t_tz1, False)  # type: ignore
 *     offset = datetime.timedelta(hours=1, minutes=1).total_seconds()             # <<<<<<<<<<<<<<
 *     assert secs - offset == time_to_seconds(t_tz1, True)  # type: ignore
 *     us = int(secs * 1_000_000)
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hours, __pyx_int_1) < 0) __PYX_ERR(1, 996, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_minutes, __pyx_int_1) < 0) __PYX_ERR(1, 996, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_total_seconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_offset = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":997
 *     assert secs == time_to_seconds(t_tz1, False)  # type: ignore
 *     offset = datetime.timedelta(hours=1, minutes=1).total_seconds()
 *     assert secs - offset == time_to_seconds(t_tz1, True)  # type: ignore             # <<<<<<<<<<<<<<
 *     us = int(secs * 1_000_000)
 *     assert us == time_to_us(t1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = PyNumber_Subtract(__pyx_v_secs, __pyx_v_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_v_t_tz1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t_tz1, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 997, __pyx_L1_error)
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.utc = 1;
    __pyx_t_9 = __pyx_f_7cytimes_5utils_time_to_seconds(((PyDateTime_Time *)__pyx_v_t_tz1), &__pyx_t_10); if (unlikely(__pyx_t_9 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(1, 997, __pyx_L1_error)
    __pyx_t_1 = PyFloat_FromDouble(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 997, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 997, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 997, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 997, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":998
 *     offset = datetime.timedelta(hours=1, minutes=1).total_seconds()
 *     assert secs - offset == time_to_seconds(t_tz1, True)  # type: ignore
 *     us = int(secs * 1_000_000)             # <<<<<<<<<<<<<<
 *     assert us == time_to_us(t1)  # type: ignore
 *     assert us == time_to_us(t_tz1, False)  # type: ignore
 */
  __pyx_t_4 = __Pyx_PyInt_MultiplyObjC(__pyx_v_secs, __pyx_int_1000000, 0xF4240, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_us = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":999
 *     assert secs - offset == time_to_seconds(t_tz1, True)  # type: ignore
 *     us = int(secs * 1_000_000)
 *     assert us == time_to_us(t1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert us == time_to_us(t_tz1, False)  # type: ignore
 *     assert us - (offset * 1_000_000) == time_to_us(t_tz1, True)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_t1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t1, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 999, __pyx_L1_error)
    __pyx_t_11 = __pyx_f_7cytimes_5utils_time_to_us(((PyDateTime_Time *)__pyx_v_t1), NULL); if (unlikely(__pyx_t_11 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 999, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_us, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 999, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 999, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 999, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 999, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1000
 *     us = int(secs * 1_000_000)
 *     assert us == time_to_us(t1)  # type: ignore
 *     assert us == time_to_us(t_tz1, False)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert us - (offset * 1_000_000) == time_to_us(t_tz1, True)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_t_tz1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t_tz1, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 1000, __pyx_L1_error)
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.utc = 0;
    __pyx_t_11 = __pyx_f_7cytimes_5utils_time_to_us(((PyDateTime_Time *)__pyx_v_t_tz1), &__pyx_t_12); if (unlikely(__pyx_t_11 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 1000, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1000, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_us, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1000, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 1000, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1000, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1000, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1001
 *     assert us == time_to_us(t1)  # type: ignore
 *     assert us == time_to_us(t_tz1, False)  # type: ignore
 *     assert us - (offset * 1_000_000) == time_to_us(t_tz1, True)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     assert datetime.time(3, 4, 5, 6) == time_fr_dt(dt)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_MultiplyObjC(__pyx_v_offset, __pyx_int_1000000, 0xF4240, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_us, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_v_t_tz1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t_tz1, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 1001, __pyx_L1_error)
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.utc = 1;
    __pyx_t_11 = __pyx_f_7cytimes_5utils_time_to_us(((PyDateTime_Time *)__pyx_v_t_tz1), &__pyx_t_12); if (unlikely(__pyx_t_11 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 1001, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1001, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 1001, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1001, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1001, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1003
 *     assert us - (offset * 1_000_000) == time_to_us(t_tz1, True)  # type: ignore
 * 
 *     assert datetime.time(3, 4, 5, 6) == time_fr_dt(dt)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.time(3, 4, 5, 6, tz1) == time_fr_dt(dt_tz1)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 1003, __pyx_L1_error)
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_time_fr_dt(((PyDateTime_DateTime *)__pyx_v_dt))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1003, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 1003, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1003, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1003, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1004
 * 
 *     assert datetime.time(3, 4, 5, 6) == time_fr_dt(dt)  # type: ignore
 *     assert datetime.time(3, 4, 5, 6, tz1) == time_fr_dt(dt_tz1)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     class CustomTime(datetime.time):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[6] = {__pyx_t_1, __pyx_int_3, __pyx_int_4, __pyx_int_5, __pyx_int_6, __pyx_v_tz1};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1004, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    if (!(likely(((__pyx_v_dt_tz1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt_tz1, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 1004, __pyx_L1_error)
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_time_fr_dt(((PyDateTime_DateTime *)__pyx_v_dt_tz1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1004, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 1004, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1004, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1004, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1006
 *     assert datetime.time(3, 4, 5, 6, tz1) == time_fr_dt(dt_tz1)  # type: ignore
 * 
 *     class CustomTime(datetime.time):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(1, 1006, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_1, __pyx_n_s_CustomTime, __pyx_n_s_test_time_conversion_locals_Cus, (PyObject *) NULL, __pyx_n_s_cytimes_utils, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_1 != __pyx_t_2) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(1, 1006, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_CustomTime, __pyx_t_1, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_CustomTime = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1009
 *         pass
 * 
 *     tmp = time_fr_time(CustomTime(3, 4, 5, 6))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert t1 == tmp and type(tmp) is datetime.time  # type: ignore
 *     tmp = time_fr_time(CustomTime(3, 4, 5, 6, tz1))  # type: ignore
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_CustomTime, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1009, __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(1, 1009, __pyx_L1_error)
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_time_fr_time(((PyDateTime_Time *)__pyx_t_1))); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_tmp = ((PyDateTime_Time *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":1010
 * 
 *     tmp = time_fr_time(CustomTime(3, 4, 5, 6))  # type: ignore
 *     assert t1 == tmp and type(tmp) is datetime.time  # type: ignore             # <<<<<<<<<<<<<<
 *     tmp = time_fr_time(CustomTime(3, 4, 5, 6, tz1))  # type: ignore
 *     assert t_tz1 == tmp and type(tmp) is datetime.time  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_t1, ((PyObject *)__pyx_v_tmp), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1010, __pyx_L1_error)
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(1, 1010, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_13) {
    } else {
      __pyx_t_8 = __pyx_t_13;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_13 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_tmp))) == __pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = __pyx_t_13;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1010, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1010, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1011
 *     tmp = time_fr_time(CustomTime(3, 4, 5, 6))  # type: ignore
 *     assert t1 == tmp and type(tmp) is datetime.time  # type: ignore
 *     tmp = time_fr_time(CustomTime(3, 4, 5, 6, tz1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert t_tz1 == tmp and type(tmp) is datetime.time  # type: ignore
 *     assert t1 == time_fr_seconds(time_to_seconds(t1))  # type: ignore
 */
  __Pyx_INCREF(__pyx_v_CustomTime);
  __pyx_t_1 = __pyx_v_CustomTime; __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[6] = {__pyx_t_5, __pyx_int_3, __pyx_int_4, __pyx_int_5, __pyx_int_6, __pyx_v_tz1};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 1011, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_time_fr_time(((PyDateTime_Time *)__pyx_t_4))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_tmp, ((PyDateTime_Time *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1012
 *     assert t1 == tmp and type(tmp) is datetime.time  # type: ignore
 *     tmp = time_fr_time(CustomTime(3, 4, 5, 6, tz1))  # type: ignore
 *     assert t_tz1 == tmp and type(tmp) is datetime.time  # type: ignore             # <<<<<<<<<<<<<<
 *     assert t1 == time_fr_seconds(time_to_seconds(t1))  # type: ignore
 *     assert t_tz1 == time_fr_seconds(time_to_seconds(t1, False), tz1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_t_tz1, ((PyObject *)__pyx_v_tmp), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1012, __pyx_L1_error)
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(1, 1012, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_13) {
    } else {
      __pyx_t_8 = __pyx_t_13;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_13 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_tmp))) == __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __pyx_t_13;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1012, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1012, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1013
 *     tmp = time_fr_time(CustomTime(3, 4, 5, 6, tz1))  # type: ignore
 *     assert t_tz1 == tmp and type(tmp) is datetime.time  # type: ignore
 *     assert t1 == time_fr_seconds(time_to_seconds(t1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert t_tz1 == time_fr_seconds(time_to_seconds(t1, False), tz1)  # type: ignore
 *     assert t1 == time_fr_us(time_to_us(t1))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_t1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t1, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 1013, __pyx_L1_error)
    __pyx_t_9 = __pyx_f_7cytimes_5utils_time_to_seconds(((PyDateTime_Time *)__pyx_v_t1), NULL); if (unlikely(__pyx_t_9 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(1, 1013, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_time_fr_seconds(__pyx_t_9, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1013, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_t1, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1013, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 1013, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1013, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1013, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1014
 *     assert t_tz1 == tmp and type(tmp) is datetime.time  # type: ignore
 *     assert t1 == time_fr_seconds(time_to_seconds(t1))  # type: ignore
 *     assert t_tz1 == time_fr_seconds(time_to_seconds(t1, False), tz1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert t1 == time_fr_us(time_to_us(t1))  # type: ignore
 *     assert t_tz1 == time_fr_us(time_to_us(t1, False), tz1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_t1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t1, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 1014, __pyx_L1_error)
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.utc = 0;
    __pyx_t_9 = __pyx_f_7cytimes_5utils_time_to_seconds(((PyDateTime_Time *)__pyx_v_t1), &__pyx_t_10); if (unlikely(__pyx_t_9 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(1, 1014, __pyx_L1_error)
    __pyx_t_14.__pyx_n = 1;
    __pyx_t_14.tz = __pyx_v_tz1;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_time_fr_seconds(__pyx_t_9, &__pyx_t_14)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1014, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_t_tz1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1014, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 1014, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1014, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1014, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1015
 *     assert t1 == time_fr_seconds(time_to_seconds(t1))  # type: ignore
 *     assert t_tz1 == time_fr_seconds(time_to_seconds(t1, False), tz1)  # type: ignore
 *     assert t1 == time_fr_us(time_to_us(t1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert t_tz1 == time_fr_us(time_to_us(t1, False), tz1)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_t1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t1, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 1015, __pyx_L1_error)
    __pyx_t_11 = __pyx_f_7cytimes_5utils_time_to_us(((PyDateTime_Time *)__pyx_v_t1), NULL); if (unlikely(__pyx_t_11 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 1015, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_time_fr_us(__pyx_t_11, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_t1, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1015, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 1015, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1015, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1015, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1016
 *     assert t_tz1 == time_fr_seconds(time_to_seconds(t1, False), tz1)  # type: ignore
 *     assert t1 == time_fr_us(time_to_us(t1))  # type: ignore
 *     assert t_tz1 == time_fr_us(time_to_us(t1, False), tz1)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: time_conversion")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_t1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_t1, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(1, 1016, __pyx_L1_error)
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.utc = 0;
    __pyx_t_11 = __pyx_f_7cytimes_5utils_time_to_us(((PyDateTime_Time *)__pyx_v_t1), &__pyx_t_12); if (unlikely(__pyx_t_11 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 1016, __pyx_L1_error)
    __pyx_t_15.__pyx_n = 1;
    __pyx_t_15.tz = __pyx_v_tz1;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_time_fr_us(__pyx_t_11, &__pyx_t_15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_t_tz1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1016, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 1016, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1016, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1016, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1018
 *     assert t_tz1 == time_fr_us(time_to_us(t1, False), tz1)  # type: ignore
 * 
 *     print("Passed: time_conversion")             # <<<<<<<<<<<<<<
 * 
 *     del CustomTime, datetime
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1020
 *     print("Passed: time_conversion")
 * 
 *     del CustomTime, datetime             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_CustomTime); __pyx_v_CustomTime = 0;
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;

  /* "cytimes/utils.py":980
 * 
 * 
 * def _test_time_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils._test_time_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_t1);
  __Pyx_XDECREF(__pyx_v_tz1);
  __Pyx_XDECREF(__pyx_v_t_tz1);
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XDECREF(__pyx_v_dt_tz1);
  __Pyx_XDECREF(__pyx_v_secs);
  __Pyx_XDECREF(__pyx_v_offset);
  __Pyx_XDECREF(__pyx_v_us);
  __Pyx_XDECREF(__pyx_v_CustomTime);
  __Pyx_XDECREF((PyObject *)__pyx_v_tmp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":1024
 * 
 * # datetime.timedelta
 * def _test_timedelta_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_57_test_timedelta_generate(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_57_test_timedelta_generate = {"_test_timedelta_generate", (PyCFunction)__pyx_pw_7cytimes_5utils_57_test_timedelta_generate, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_57_test_timedelta_generate(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_timedelta_generate (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_56_test_timedelta_generate(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_56_test_timedelta_generate(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  struct __pyx_opt_args_7cytimes_5utils_td_new __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_timedelta_generate", 1);

  /* "cytimes/utils.py":1025
 * # datetime.timedelta
 * def _test_timedelta_generate() -> None:
 *     import datetime             # <<<<<<<<<<<<<<
 * 
 *     # New
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1028
 * 
 *     # New
 *     assert datetime.timedelta(0, 0, 0) == td_new()  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timedelta(0, 0, 0) == td_new(0)  # type: ignore
 *     assert datetime.timedelta(0, 0, 0) == td_new(0, 0)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1028, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1028, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_td_new(NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1028, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1028, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1028, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1028, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1028, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1029
 *     # New
 *     assert datetime.timedelta(0, 0, 0) == td_new()  # type: ignore
 *     assert datetime.timedelta(0, 0, 0) == td_new(0)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timedelta(0, 0, 0) == td_new(0, 0)  # type: ignore
 *     assert datetime.timedelta(0, 0, 0) == td_new(0, 0, 0)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1029, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1029, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.days = 0;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_td_new(&__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1029, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1029, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1029, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1029, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1029, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1030
 *     assert datetime.timedelta(0, 0, 0) == td_new()  # type: ignore
 *     assert datetime.timedelta(0, 0, 0) == td_new(0)  # type: ignore
 *     assert datetime.timedelta(0, 0, 0) == td_new(0, 0)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timedelta(0, 0, 0) == td_new(0, 0, 0)  # type: ignore
 *     assert datetime.timedelta(1, 0, 0) == td_new(1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5.__pyx_n = 2;
    __pyx_t_5.days = 0;
    __pyx_t_5.seconds = 0;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_td_new(&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1030, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1030, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1030, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1030, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1031
 *     assert datetime.timedelta(0, 0, 0) == td_new(0)  # type: ignore
 *     assert datetime.timedelta(0, 0, 0) == td_new(0, 0)  # type: ignore
 *     assert datetime.timedelta(0, 0, 0) == td_new(0, 0, 0)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timedelta(1, 0, 0) == td_new(1)  # type: ignore
 *     assert datetime.timedelta(1, 1, 0) == td_new(1, 1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1031, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1031, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5.__pyx_n = 3;
    __pyx_t_5.days = 0;
    __pyx_t_5.seconds = 0;
    __pyx_t_5.microseconds = 0;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_td_new(&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1031, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1031, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1031, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1031, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1031, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1032
 *     assert datetime.timedelta(0, 0, 0) == td_new(0, 0)  # type: ignore
 *     assert datetime.timedelta(0, 0, 0) == td_new(0, 0, 0)  # type: ignore
 *     assert datetime.timedelta(1, 0, 0) == td_new(1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timedelta(1, 1, 0) == td_new(1, 1)  # type: ignore
 *     assert datetime.timedelta(1, 1, 1) == td_new(1, 1, 1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1032, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1032, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.days = 1;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_td_new(&__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1032, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1032, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1032, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1032, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1032, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1033
 *     assert datetime.timedelta(0, 0, 0) == td_new(0, 0, 0)  # type: ignore
 *     assert datetime.timedelta(1, 0, 0) == td_new(1)  # type: ignore
 *     assert datetime.timedelta(1, 1, 0) == td_new(1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timedelta(1, 1, 1) == td_new(1, 1, 1)  # type: ignore
 *     assert datetime.timedelta(-1, 0, 0) == td_new(-1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1033, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1033, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5.__pyx_n = 2;
    __pyx_t_5.days = 1;
    __pyx_t_5.seconds = 1;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_td_new(&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1033, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1033, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1033, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1033, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1033, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1034
 *     assert datetime.timedelta(1, 0, 0) == td_new(1)  # type: ignore
 *     assert datetime.timedelta(1, 1, 0) == td_new(1, 1)  # type: ignore
 *     assert datetime.timedelta(1, 1, 1) == td_new(1, 1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timedelta(-1, 0, 0) == td_new(-1)  # type: ignore
 *     assert datetime.timedelta(-1, -1, 0) == td_new(-1, -1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1034, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1034, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5.__pyx_n = 3;
    __pyx_t_5.days = 1;
    __pyx_t_5.seconds = 1;
    __pyx_t_5.microseconds = 1;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_td_new(&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1034, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1034, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1034, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1034, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1034, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1035
 *     assert datetime.timedelta(1, 1, 0) == td_new(1, 1)  # type: ignore
 *     assert datetime.timedelta(1, 1, 1) == td_new(1, 1, 1)  # type: ignore
 *     assert datetime.timedelta(-1, 0, 0) == td_new(-1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timedelta(-1, -1, 0) == td_new(-1, -1)  # type: ignore
 *     assert datetime.timedelta(-1, -1, -1) == td_new(-1, -1, -1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.days = -1;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_td_new(&__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1035, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1035, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1035, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1035, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1036
 *     assert datetime.timedelta(1, 1, 1) == td_new(1, 1, 1)  # type: ignore
 *     assert datetime.timedelta(-1, 0, 0) == td_new(-1)  # type: ignore
 *     assert datetime.timedelta(-1, -1, 0) == td_new(-1, -1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timedelta(-1, -1, -1) == td_new(-1, -1, -1)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5.__pyx_n = 2;
    __pyx_t_5.days = -1;
    __pyx_t_5.seconds = -1;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_td_new(&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1036, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1036, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1036, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1036, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1037
 *     assert datetime.timedelta(-1, 0, 0) == td_new(-1)  # type: ignore
 *     assert datetime.timedelta(-1, -1, 0) == td_new(-1, -1)  # type: ignore
 *     assert datetime.timedelta(-1, -1, -1) == td_new(-1, -1, -1)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: timedelta_generate")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5.__pyx_n = 3;
    __pyx_t_5.days = -1;
    __pyx_t_5.seconds = -1;
    __pyx_t_5.microseconds = -1;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_td_new(&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1037, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1037, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1037, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1037, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1039
 *     assert datetime.timedelta(-1, -1, -1) == td_new(-1, -1, -1)  # type: ignore
 * 
 *     print("Passed: timedelta_generate")             # <<<<<<<<<<<<<<
 * 
 *     del datetime
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":1041
 *     print("Passed: timedelta_generate")
 * 
 *     del datetime             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;

  /* "cytimes/utils.py":1024
 * 
 * # datetime.timedelta
 * def _test_timedelta_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils._test_timedelta_generate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":1044
 * 
 * 
 * def _test_timedelta_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_59_test_timedelta_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_59_test_timedelta_type_check = {"_test_timedelta_type_check", (PyCFunction)__pyx_pw_7cytimes_5utils_59_test_timedelta_type_check, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_59_test_timedelta_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_timedelta_type_check (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_58_test_timedelta_type_check(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_58_test_timedelta_type_check(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_CustomTD = NULL;
  PyObject *__pyx_v_td = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_timedelta_type_check", 1);

  /* "cytimes/utils.py":1045
 * 
 * def _test_timedelta_type_check() -> None:
 *     import datetime             # <<<<<<<<<<<<<<
 * 
 *     class CustomTD(datetime.timedelta):
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1045, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1047
 *     import datetime
 * 
 *     class CustomTD(datetime.timedelta):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(1, 1047, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_CustomTD, __pyx_n_s_test_timedelta_type_check_local, (PyObject *) NULL, __pyx_n_s_cytimes_utils, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_1 != __pyx_t_2) {
    if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(1, 1047, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_CustomTD, __pyx_t_1, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_CustomTD = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1050
 *         pass
 * 
 *     td = datetime.timedelta(1, 1, 1)             # <<<<<<<<<<<<<<
 *     assert is_td(td)  # type: ignore
 *     assert is_td_exact(td)  # type: ignore
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_td = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cytimes/utils.py":1051
 * 
 *     td = datetime.timedelta(1, 1, 1)
 *     assert is_td(td)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert is_td_exact(td)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = __pyx_f_7cytimes_5utils_is_td(__pyx_v_td); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1051, __pyx_L1_error)
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1051, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1051, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1052
 *     td = datetime.timedelta(1, 1, 1)
 *     assert is_td(td)  # type: ignore
 *     assert is_td_exact(td)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     td = CustomTD(1, 1, 1)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = __pyx_f_7cytimes_5utils_is_td_exact(__pyx_v_td); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1052, __pyx_L1_error)
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1052, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1052, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1054
 *     assert is_td_exact(td)  # type: ignore
 * 
 *     td = CustomTD(1, 1, 1)             # <<<<<<<<<<<<<<
 *     assert is_td(td)  # type: ignore
 *     assert not is_td_exact(td)  # type: ignore
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_CustomTD, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_td, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/utils.py":1055
 * 
 *     td = CustomTD(1, 1, 1)
 *     assert is_td(td)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert not is_td_exact(td)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = __pyx_f_7cytimes_5utils_is_td(__pyx_v_td); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1055, __pyx_L1_error)
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1055, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1055, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1056
 *     td = CustomTD(1, 1, 1)
 *     assert is_td(td)  # type: ignore
 *     assert not is_td_exact(td)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: timedelta_type_chech")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = __pyx_f_7cytimes_5utils_is_td_exact(__pyx_v_td); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1056, __pyx_L1_error)
    __pyx_t_6 = (!__pyx_t_5);
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1056, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1056, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1058
 *     assert not is_td_exact(td)  # type: ignore
 * 
 *     print("Passed: timedelta_type_chech")             # <<<<<<<<<<<<<<
 * 
 *     del CustomTD, datetime
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":1060
 *     print("Passed: timedelta_type_chech")
 * 
 *     del CustomTD, datetime             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_CustomTD); __pyx_v_CustomTD = 0;
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;

  /* "cytimes/utils.py":1044
 * 
 * 
 * def _test_timedelta_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils._test_timedelta_type_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_CustomTD);
  __Pyx_XDECREF(__pyx_v_td);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":1063
 * 
 * 
 * def _test_timedelta_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_61_test_timedelta_conversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_61_test_timedelta_conversion = {"_test_timedelta_conversion", (PyCFunction)__pyx_pw_7cytimes_5utils_61_test_timedelta_conversion, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_61_test_timedelta_conversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_timedelta_conversion (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_60_test_timedelta_conversion(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_60_test_timedelta_conversion(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  long __pyx_v_h;
  long __pyx_v_m;
  PyObject *__pyx_v_td = NULL;
  PyObject *__pyx_v_dt_str = NULL;
  PyObject *__pyx_v_tz_str = NULL;
  PyObject *__pyx_v_secs = NULL;
  PyObject *__pyx_v_CustomTD = NULL;
  PyDateTime_Delta *__pyx_v_tmp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  long __pyx_t_5;
  long __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  double __pyx_t_11;
  PY_LONG_LONG __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_timedelta_conversion", 1);

  /* "cytimes/utils.py":1064
 * 
 * def _test_timedelta_conversion() -> None:
 *     import datetime             # <<<<<<<<<<<<<<
 * 
 *     assert "00:00:01" == td_to_isoformat(datetime.timedelta(0, 1))  # type: ignore
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1066
 *     import datetime
 * 
 *     assert "00:00:01" == td_to_isoformat(datetime.timedelta(0, 1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "00:01:01" == td_to_isoformat(datetime.timedelta(0, 1, minutes=1))  # type: ignore
 *     assert "24:01:01" == td_to_isoformat(datetime.timedelta(1, 1, minutes=1))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1066, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1066, __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_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1066, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7cytimes_5utils_td_to_isoformat(((PyDateTime_Delta *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1066, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_00_00_01, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1066, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1066, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1066, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1067
 * 
 *     assert "00:00:01" == td_to_isoformat(datetime.timedelta(0, 1))  # type: ignore
 *     assert "00:01:01" == td_to_isoformat(datetime.timedelta(0, 1, minutes=1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "24:01:01" == td_to_isoformat(datetime.timedelta(1, 1, minutes=1))  # type: ignore
 *     assert "24:01:01.001000" == td_to_isoformat(datetime.timedelta(1, 1, 0, minutes=1, milliseconds=1))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1067, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1067, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_minutes, __pyx_int_1) < 0) __PYX_ERR(1, 1067, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__95, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1067, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1067, __pyx_L1_error)
    __pyx_t_2 = __pyx_f_7cytimes_5utils_td_to_isoformat(((PyDateTime_Delta *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1067, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_00_01_01, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1067, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1067, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1067, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1068
 *     assert "00:00:01" == td_to_isoformat(datetime.timedelta(0, 1))  # type: ignore
 *     assert "00:01:01" == td_to_isoformat(datetime.timedelta(0, 1, minutes=1))  # type: ignore
 *     assert "24:01:01" == td_to_isoformat(datetime.timedelta(1, 1, minutes=1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "24:01:01.001000" == td_to_isoformat(datetime.timedelta(1, 1, 0, minutes=1, milliseconds=1))  # type: ignore
 *     assert "24:01:01.000001" == td_to_isoformat(datetime.timedelta(1, 1, 1, minutes=1))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1068, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1068, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_minutes, __pyx_int_1) < 0) __PYX_ERR(1, 1068, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__96, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1068, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1068, __pyx_L1_error)
    __pyx_t_4 = __pyx_f_7cytimes_5utils_td_to_isoformat(((PyDateTime_Delta *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1068, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_24_01_01, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1068, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1068, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1068, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1069
 *     assert "00:01:01" == td_to_isoformat(datetime.timedelta(0, 1, minutes=1))  # type: ignore
 *     assert "24:01:01" == td_to_isoformat(datetime.timedelta(1, 1, minutes=1))  # type: ignore
 *     assert "24:01:01.001000" == td_to_isoformat(datetime.timedelta(1, 1, 0, minutes=1, milliseconds=1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "24:01:01.000001" == td_to_isoformat(datetime.timedelta(1, 1, 1, minutes=1))  # type: ignore
 *     assert "24:01:01.001001" == td_to_isoformat(datetime.timedelta(1, 1, 1, minutes=1, milliseconds=1))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1069, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1069, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_minutes, __pyx_int_1) < 0) __PYX_ERR(1, 1069, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_milliseconds, __pyx_int_1) < 0) __PYX_ERR(1, 1069, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__90, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1069, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1069, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7cytimes_5utils_td_to_isoformat(((PyDateTime_Delta *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1069, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_24_01_01_001000, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1069, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1069, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1069, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1070
 *     assert "24:01:01" == td_to_isoformat(datetime.timedelta(1, 1, minutes=1))  # type: ignore
 *     assert "24:01:01.001000" == td_to_isoformat(datetime.timedelta(1, 1, 0, minutes=1, milliseconds=1))  # type: ignore
 *     assert "24:01:01.000001" == td_to_isoformat(datetime.timedelta(1, 1, 1, minutes=1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "24:01:01.001001" == td_to_isoformat(datetime.timedelta(1, 1, 1, minutes=1, milliseconds=1))  # type: ignore
 *     assert "-00:00:01" == td_to_isoformat(datetime.timedelta(0, -1))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1070, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1070, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_minutes, __pyx_int_1) < 0) __PYX_ERR(1, 1070, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__53, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1070, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1070, __pyx_L1_error)
    __pyx_t_2 = __pyx_f_7cytimes_5utils_td_to_isoformat(((PyDateTime_Delta *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1070, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_24_01_01_000001, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1070, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1070, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1070, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1071
 *     assert "24:01:01.001000" == td_to_isoformat(datetime.timedelta(1, 1, 0, minutes=1, milliseconds=1))  # type: ignore
 *     assert "24:01:01.000001" == td_to_isoformat(datetime.timedelta(1, 1, 1, minutes=1))  # type: ignore
 *     assert "24:01:01.001001" == td_to_isoformat(datetime.timedelta(1, 1, 1, minutes=1, milliseconds=1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "-00:00:01" == td_to_isoformat(datetime.timedelta(0, -1))  # type: ignore
 *     assert "-00:01:01" == td_to_isoformat(datetime.timedelta(0, -1, minutes=-1))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_minutes, __pyx_int_1) < 0) __PYX_ERR(1, 1071, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_milliseconds, __pyx_int_1) < 0) __PYX_ERR(1, 1071, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__53, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1071, __pyx_L1_error)
    __pyx_t_4 = __pyx_f_7cytimes_5utils_td_to_isoformat(((PyDateTime_Delta *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_24_01_01_001001, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1071, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1071, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1071, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1072
 *     assert "24:01:01.000001" == td_to_isoformat(datetime.timedelta(1, 1, 1, minutes=1))  # type: ignore
 *     assert "24:01:01.001001" == td_to_isoformat(datetime.timedelta(1, 1, 1, minutes=1, milliseconds=1))  # type: ignore
 *     assert "-00:00:01" == td_to_isoformat(datetime.timedelta(0, -1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "-00:01:01" == td_to_isoformat(datetime.timedelta(0, -1, minutes=-1))  # type: ignore
 *     assert "-24:01:01" == td_to_isoformat(datetime.timedelta(-1, -1, minutes=-1))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1072, __pyx_L1_error)
    __pyx_t_4 = __pyx_f_7cytimes_5utils_td_to_isoformat(((PyDateTime_Delta *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_00_00_01_2, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1072, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1072, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1072, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1073
 *     assert "24:01:01.001001" == td_to_isoformat(datetime.timedelta(1, 1, 1, minutes=1, milliseconds=1))  # type: ignore
 *     assert "-00:00:01" == td_to_isoformat(datetime.timedelta(0, -1))  # type: ignore
 *     assert "-00:01:01" == td_to_isoformat(datetime.timedelta(0, -1, minutes=-1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "-24:01:01" == td_to_isoformat(datetime.timedelta(-1, -1, minutes=-1))  # type: ignore
 *     assert "-24:01:01.001000" == td_to_isoformat(datetime.timedelta(-1, -1, 0, minutes=-1, milliseconds=-1))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_minutes, __pyx_int_neg_1) < 0) __PYX_ERR(1, 1073, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__97, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1073, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7cytimes_5utils_td_to_isoformat(((PyDateTime_Delta *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_00_01_01_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1073, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1073, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1073, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1074
 *     assert "-00:00:01" == td_to_isoformat(datetime.timedelta(0, -1))  # type: ignore
 *     assert "-00:01:01" == td_to_isoformat(datetime.timedelta(0, -1, minutes=-1))  # type: ignore
 *     assert "-24:01:01" == td_to_isoformat(datetime.timedelta(-1, -1, minutes=-1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "-24:01:01.001000" == td_to_isoformat(datetime.timedelta(-1, -1, 0, minutes=-1, milliseconds=-1))  # type: ignore
 *     assert "-24:01:01.000001" == td_to_isoformat(datetime.timedelta(-1, -1, -1, minutes=-1))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1074, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1074, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_minutes, __pyx_int_neg_1) < 0) __PYX_ERR(1, 1074, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__98, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1074, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1074, __pyx_L1_error)
    __pyx_t_2 = __pyx_f_7cytimes_5utils_td_to_isoformat(((PyDateTime_Delta *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1074, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_24_01_01_2, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1074, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1074, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1074, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1075
 *     assert "-00:01:01" == td_to_isoformat(datetime.timedelta(0, -1, minutes=-1))  # type: ignore
 *     assert "-24:01:01" == td_to_isoformat(datetime.timedelta(-1, -1, minutes=-1))  # type: ignore
 *     assert "-24:01:01.001000" == td_to_isoformat(datetime.timedelta(-1, -1, 0, minutes=-1, milliseconds=-1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "-24:01:01.000001" == td_to_isoformat(datetime.timedelta(-1, -1, -1, minutes=-1))  # type: ignore
 *     assert "-24:01:01.001001" == td_to_isoformat(datetime.timedelta(-1, -1, -1, minutes=-1, milliseconds=-1))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1075, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1075, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_minutes, __pyx_int_neg_1) < 0) __PYX_ERR(1, 1075, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_milliseconds, __pyx_int_neg_1) < 0) __PYX_ERR(1, 1075, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__92, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1075, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1075, __pyx_L1_error)
    __pyx_t_4 = __pyx_f_7cytimes_5utils_td_to_isoformat(((PyDateTime_Delta *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1075, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_24_01_01_001000_2, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1075, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1075, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1075, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1076
 *     assert "-24:01:01" == td_to_isoformat(datetime.timedelta(-1, -1, minutes=-1))  # type: ignore
 *     assert "-24:01:01.001000" == td_to_isoformat(datetime.timedelta(-1, -1, 0, minutes=-1, milliseconds=-1))  # type: ignore
 *     assert "-24:01:01.000001" == td_to_isoformat(datetime.timedelta(-1, -1, -1, minutes=-1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "-24:01:01.001001" == td_to_isoformat(datetime.timedelta(-1, -1, -1, minutes=-1, milliseconds=-1))  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_minutes, __pyx_int_neg_1) < 0) __PYX_ERR(1, 1076, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__74, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1076, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7cytimes_5utils_td_to_isoformat(((PyDateTime_Delta *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_24_01_01_000001_2, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1076, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1076, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1076, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1077
 *     assert "-24:01:01.001000" == td_to_isoformat(datetime.timedelta(-1, -1, 0, minutes=-1, milliseconds=-1))  # type: ignore
 *     assert "-24:01:01.000001" == td_to_isoformat(datetime.timedelta(-1, -1, -1, minutes=-1))  # type: ignore
 *     assert "-24:01:01.001001" == td_to_isoformat(datetime.timedelta(-1, -1, -1, minutes=-1, milliseconds=-1))  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     for h in range(-23, 24):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1077, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1077, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_minutes, __pyx_int_neg_1) < 0) __PYX_ERR(1, 1077, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_milliseconds, __pyx_int_neg_1) < 0) __PYX_ERR(1, 1077, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__74, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1077, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1077, __pyx_L1_error)
    __pyx_t_2 = __pyx_f_7cytimes_5utils_td_to_isoformat(((PyDateTime_Delta *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1077, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_24_01_01_001001_2, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1077, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1077, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1077, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1079
 *     assert "-24:01:01.001001" == td_to_isoformat(datetime.timedelta(-1, -1, -1, minutes=-1, milliseconds=-1))  # type: ignore
 * 
 *     for h in range(-23, 24):             # <<<<<<<<<<<<<<
 *         for m in range(-59, 60):
 *             td = datetime.timedelta(hours=h, minutes=m)
 */
  for (__pyx_t_5 = -23L; __pyx_t_5 < 24; __pyx_t_5+=1) {
    __pyx_v_h = __pyx_t_5;

    /* "cytimes/utils.py":1080
 * 
 *     for h in range(-23, 24):
 *         for m in range(-59, 60):             # <<<<<<<<<<<<<<
 *             td = datetime.timedelta(hours=h, minutes=m)
 *             dt_str = str(datetime.datetime.now(datetime.timezone(td)))
 */
    for (__pyx_t_6 = -59L; __pyx_t_6 < 60; __pyx_t_6+=1) {
      __pyx_v_m = __pyx_t_6;

      /* "cytimes/utils.py":1081
 *     for h in range(-23, 24):
 *         for m in range(-59, 60):
 *             td = datetime.timedelta(hours=h, minutes=m)             # <<<<<<<<<<<<<<
 *             dt_str = str(datetime.datetime.now(datetime.timezone(td)))
 *             tz_str = dt_str[len(dt_str) - 6 :]
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1081, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1081, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1081, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_hours, __pyx_t_1) < 0) __PYX_ERR(1, 1081, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1081, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_minutes, __pyx_t_1) < 0) __PYX_ERR(1, 1081, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1081, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_td, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cytimes/utils.py":1082
 *         for m in range(-59, 60):
 *             td = datetime.timedelta(hours=h, minutes=m)
 *             dt_str = str(datetime.datetime.now(datetime.timezone(td)))             # <<<<<<<<<<<<<<
 *             tz_str = dt_str[len(dt_str) - 6 :]
 *             with cython.wraparound(True):
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1082, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_now); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1082, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1082, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_9 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_td};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1082, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __pyx_t_7 = NULL;
      __pyx_t_9 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_9 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1082, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1082, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_dt_str, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cytimes/utils.py":1083
 *             td = datetime.timedelta(hours=h, minutes=m)
 *             dt_str = str(datetime.datetime.now(datetime.timezone(td)))
 *             tz_str = dt_str[len(dt_str) - 6 :]             # <<<<<<<<<<<<<<
 *             with cython.wraparound(True):
 *                 tz_str = tz_str[:-3] + tz_str[-2:]
 */
      __pyx_t_10 = PyObject_Length(__pyx_v_dt_str); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(1, 1083, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_dt_str, (__pyx_t_10 - 6), 0, NULL, NULL, NULL, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1083, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_tz_str, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cytimes/utils.py":1085
 *             tz_str = dt_str[len(dt_str) - 6 :]
 *             with cython.wraparound(True):
 *                 tz_str = tz_str[:-3] + tz_str[-2:]             # <<<<<<<<<<<<<<
 *             assert tz_str == td_to_utcformat(td)  # type: ignore
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_tz_str, 0, -3L, NULL, NULL, &__pyx_slice__99, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1085, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_tz_str, -2L, 0, NULL, NULL, &__pyx_slice__100, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1085, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1085, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF_SET(__pyx_v_tz_str, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cytimes/utils.py":1086
 *             with cython.wraparound(True):
 *                 tz_str = tz_str[:-3] + tz_str[-2:]
 *             assert tz_str == td_to_utcformat(td)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     td = datetime.timedelta(1, 1, 1)
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        if (!(likely(((__pyx_v_td) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_td, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1086, __pyx_L1_error)
        __pyx_t_4 = __pyx_f_7cytimes_5utils_td_to_utcformat(((PyDateTime_Delta *)__pyx_v_td)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1086, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_tz_str, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1086, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(1, 1086, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(1, 1086, __pyx_L1_error)
      #endif
    }
  }

  /* "cytimes/utils.py":1088
 *             assert tz_str == td_to_utcformat(td)  # type: ignore
 * 
 *     td = datetime.timedelta(1, 1, 1)             # <<<<<<<<<<<<<<
 *     secs = td.total_seconds()
 *     assert secs == td_to_seconds(td)  # type: ignore
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_XDECREF_SET(__pyx_v_td, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1089
 * 
 *     td = datetime.timedelta(1, 1, 1)
 *     secs = td.total_seconds()             # <<<<<<<<<<<<<<
 *     assert secs == td_to_seconds(td)  # type: ignore
 *     assert int(secs * 1_000_000) == td_to_us(td)  # type: ignore
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_td, __pyx_n_s_total_seconds); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_9 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_9 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1089, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_v_secs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1090
 *     td = datetime.timedelta(1, 1, 1)
 *     secs = td.total_seconds()
 *     assert secs == td_to_seconds(td)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert int(secs * 1_000_000) == td_to_us(td)  # type: ignore
 *     td = datetime.timedelta(-1, -1, -1)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_td) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_td, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1090, __pyx_L1_error)
    __pyx_t_11 = __pyx_f_7cytimes_5utils_td_to_seconds(((PyDateTime_Delta *)__pyx_v_td)); if (unlikely(__pyx_t_11 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(1, 1090, __pyx_L1_error)
    __pyx_t_1 = PyFloat_FromDouble(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1090, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_secs, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1090, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1090, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1090, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1090, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1091
 *     secs = td.total_seconds()
 *     assert secs == td_to_seconds(td)  # type: ignore
 *     assert int(secs * 1_000_000) == td_to_us(td)  # type: ignore             # <<<<<<<<<<<<<<
 *     td = datetime.timedelta(-1, -1, -1)
 *     secs = td.total_seconds()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = __Pyx_PyInt_MultiplyObjC(__pyx_v_secs, __pyx_int_1000000, 0xF4240, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_v_td) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_td, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1091, __pyx_L1_error)
    __pyx_t_12 = __pyx_f_7cytimes_5utils_td_to_us(((PyDateTime_Delta *)__pyx_v_td)); if (unlikely(__pyx_t_12 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 1091, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1091, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1091, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1091, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1091, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1092
 *     assert secs == td_to_seconds(td)  # type: ignore
 *     assert int(secs * 1_000_000) == td_to_us(td)  # type: ignore
 *     td = datetime.timedelta(-1, -1, -1)             # <<<<<<<<<<<<<<
 *     secs = td.total_seconds()
 *     assert secs == td_to_seconds(td)  # type: ignore
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1092, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1092, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_td, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":1093
 *     assert int(secs * 1_000_000) == td_to_us(td)  # type: ignore
 *     td = datetime.timedelta(-1, -1, -1)
 *     secs = td.total_seconds()             # <<<<<<<<<<<<<<
 *     assert secs == td_to_seconds(td)  # type: ignore
 *     assert int(secs * 1_000_000) == td_to_us(td)  # type: ignore
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_td, __pyx_n_s_total_seconds); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  __pyx_t_9 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_9 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1093, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_secs, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":1094
 *     td = datetime.timedelta(-1, -1, -1)
 *     secs = td.total_seconds()
 *     assert secs == td_to_seconds(td)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert int(secs * 1_000_000) == td_to_us(td)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_td) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_td, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1094, __pyx_L1_error)
    __pyx_t_11 = __pyx_f_7cytimes_5utils_td_to_seconds(((PyDateTime_Delta *)__pyx_v_td)); if (unlikely(__pyx_t_11 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(1, 1094, __pyx_L1_error)
    __pyx_t_4 = PyFloat_FromDouble(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_secs, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1094, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1094, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1094, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1094, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1095
 *     secs = td.total_seconds()
 *     assert secs == td_to_seconds(td)  # type: ignore
 *     assert int(secs * 1_000_000) == td_to_us(td)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     class CustomTD(datetime.timedelta):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_v_secs, __pyx_int_1000000, 0xF4240, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1095, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1095, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_v_td) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_td, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1095, __pyx_L1_error)
    __pyx_t_12 = __pyx_f_7cytimes_5utils_td_to_us(((PyDateTime_Delta *)__pyx_v_td)); if (unlikely(__pyx_t_12 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 1095, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1095, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1095, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1095, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1095, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1095, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1097
 *     assert int(secs * 1_000_000) == td_to_us(td)  # type: ignore
 * 
 *     class CustomTD(datetime.timedelta):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(1, 1097, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_1, __pyx_n_s_CustomTD, __pyx_n_s_test_timedelta_conversion_local, (PyObject *) NULL, __pyx_n_s_cytimes_utils, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_1 != __pyx_t_2) {
    if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(1, 1097, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_CustomTD, __pyx_t_1, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_CustomTD = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1100
 *         pass
 * 
 *     tmp = td_fr_td(CustomTD(-1, -1, -1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert td == tmp and type(tmp) is datetime.timedelta  # type: ignore
 *     assert td == td_fr_seconds(td_to_seconds(td))  # type: ignore
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_CustomTD, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1100, __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_timedelta))))) __PYX_ERR(1, 1100, __pyx_L1_error)
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_td_fr_td(((PyDateTime_Delta *)__pyx_t_1))); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_tmp = ((PyDateTime_Delta *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":1101
 * 
 *     tmp = td_fr_td(CustomTD(-1, -1, -1))  # type: ignore
 *     assert td == tmp and type(tmp) is datetime.timedelta  # type: ignore             # <<<<<<<<<<<<<<
 *     assert td == td_fr_seconds(td_to_seconds(td))  # type: ignore
 *     assert td == td_fr_us(td_to_us(td))  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_td, ((PyObject *)__pyx_v_tmp), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1101, __pyx_L1_error)
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(1, 1101, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_13) {
    } else {
      __pyx_t_3 = __pyx_t_13;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_13 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_tmp))) == __pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __pyx_t_13;
    __pyx_L7_bool_binop_done:;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1101, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1101, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1102
 *     tmp = td_fr_td(CustomTD(-1, -1, -1))  # type: ignore
 *     assert td == tmp and type(tmp) is datetime.timedelta  # type: ignore
 *     assert td == td_fr_seconds(td_to_seconds(td))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert td == td_fr_us(td_to_us(td))  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_td) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_td, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1102, __pyx_L1_error)
    __pyx_t_11 = __pyx_f_7cytimes_5utils_td_to_seconds(((PyDateTime_Delta *)__pyx_v_td)); if (unlikely(__pyx_t_11 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(1, 1102, __pyx_L1_error)
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_td_fr_seconds(__pyx_t_11)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_td, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1102, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1102, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1102, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1102, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1103
 *     assert td == tmp and type(tmp) is datetime.timedelta  # type: ignore
 *     assert td == td_fr_seconds(td_to_seconds(td))  # type: ignore
 *     assert td == td_fr_us(td_to_us(td))  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: timedelta_conversion")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_td) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_td, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 1103, __pyx_L1_error)
    __pyx_t_12 = __pyx_f_7cytimes_5utils_td_to_us(((PyDateTime_Delta *)__pyx_v_td)); if (unlikely(__pyx_t_12 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 1103, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_td_fr_us(__pyx_t_12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_td, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1103, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1103, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1103, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1103, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1105
 *     assert td == td_fr_us(td_to_us(td))  # type: ignore
 * 
 *     print("Passed: timedelta_conversion")             # <<<<<<<<<<<<<<
 * 
 *     del CustomTD, datetime
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__101, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":1107
 *     print("Passed: timedelta_conversion")
 * 
 *     del CustomTD, datetime             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_CustomTD); __pyx_v_CustomTD = 0;
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;

  /* "cytimes/utils.py":1063
 * 
 * 
 * def _test_timedelta_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cytimes.utils._test_timedelta_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_td);
  __Pyx_XDECREF(__pyx_v_dt_str);
  __Pyx_XDECREF(__pyx_v_tz_str);
  __Pyx_XDECREF(__pyx_v_secs);
  __Pyx_XDECREF(__pyx_v_CustomTD);
  __Pyx_XDECREF((PyObject *)__pyx_v_tmp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":1111
 * 
 * # datetime.tzinfo
 * def _test_tzinfo_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime, time
 *     from babel.dates import LOCALTZ
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_63_test_tzinfo_generate(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_63_test_tzinfo_generate = {"_test_tzinfo_generate", (PyCFunction)__pyx_pw_7cytimes_5utils_63_test_tzinfo_generate, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_63_test_tzinfo_generate(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_tzinfo_generate (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_62_test_tzinfo_generate(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_62_test_tzinfo_generate(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_time = NULL;
  PyObject *__pyx_v_LOCALTZ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_tz_new __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_tzinfo_generate", 1);

  /* "cytimes/utils.py":1112
 * # datetime.tzinfo
 * def _test_tzinfo_generate() -> None:
 *     import datetime, time             # <<<<<<<<<<<<<<
 *     from babel.dates import LOCALTZ
 * 
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_time, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_time = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1113
 * def _test_tzinfo_generate() -> None:
 *     import datetime, time
 *     from babel.dates import LOCALTZ             # <<<<<<<<<<<<<<
 * 
 *     # New
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_LOCALTZ);
  __Pyx_GIVEREF(__pyx_n_s_LOCALTZ);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_LOCALTZ)) __PYX_ERR(1, 1113, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_babel_dates, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_LOCALTZ); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_LOCALTZ = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":1116
 * 
 *     # New
 *     assert datetime.timezone.utc == tz_new()  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timezone(datetime.timedelta(hours=1, minutes=1)) == tz_new(1, 1)  # type: ignore
 *     assert datetime.timezone(datetime.timedelta(hours=-1, minutes=-1)) == tz_new(-1, -1)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_utc); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_new(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1116, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1116, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1116, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1116, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1117
 *     # New
 *     assert datetime.timezone.utc == tz_new()  # type: ignore
 *     assert datetime.timezone(datetime.timedelta(hours=1, minutes=1)) == tz_new(1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timezone(datetime.timedelta(hours=-1, minutes=-1)) == tz_new(-1, -1)  # type: ignore
 *     assert datetime.timezone(datetime.timedelta(hours=23, minutes=59)) == tz_new(23, 59)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_hours, __pyx_int_1) < 0) __PYX_ERR(1, 1117, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_minutes, __pyx_int_1) < 0) __PYX_ERR(1, 1117, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.hours = 1;
    __pyx_t_8.minites = 1;
    __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_new(&__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1117, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1117, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1117, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1117, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1118
 *     assert datetime.timezone.utc == tz_new()  # type: ignore
 *     assert datetime.timezone(datetime.timedelta(hours=1, minutes=1)) == tz_new(1, 1)  # type: ignore
 *     assert datetime.timezone(datetime.timedelta(hours=-1, minutes=-1)) == tz_new(-1, -1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timezone(datetime.timedelta(hours=23, minutes=59)) == tz_new(23, 59)  # type: ignore
 *     assert datetime.timezone(datetime.timedelta(hours=-23, minutes=-59)) == tz_new(-23, -59)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_hours, __pyx_int_neg_1) < 0) __PYX_ERR(1, 1118, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_minutes, __pyx_int_neg_1) < 0) __PYX_ERR(1, 1118, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1118, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.hours = -1;
    __pyx_t_8.minites = -1;
    __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_new(&__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1118, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1118, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1118, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1118, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1119
 *     assert datetime.timezone(datetime.timedelta(hours=1, minutes=1)) == tz_new(1, 1)  # type: ignore
 *     assert datetime.timezone(datetime.timedelta(hours=-1, minutes=-1)) == tz_new(-1, -1)  # type: ignore
 *     assert datetime.timezone(datetime.timedelta(hours=23, minutes=59)) == tz_new(23, 59)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timezone(datetime.timedelta(hours=-23, minutes=-59)) == tz_new(-23, -59)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_hours, __pyx_int_23) < 0) __PYX_ERR(1, 1119, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_minutes, __pyx_int_59) < 0) __PYX_ERR(1, 1119, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1119, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.hours = 23;
    __pyx_t_8.minites = 59;
    __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_new(&__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1119, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1119, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1119, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1119, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1120
 *     assert datetime.timezone(datetime.timedelta(hours=-1, minutes=-1)) == tz_new(-1, -1)  # type: ignore
 *     assert datetime.timezone(datetime.timedelta(hours=23, minutes=59)) == tz_new(23, 59)  # type: ignore
 *     assert datetime.timezone(datetime.timedelta(hours=-23, minutes=-59)) == tz_new(-23, -59)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     # Local
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1120, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1120, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1120, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_hours, __pyx_int_neg_23) < 0) __PYX_ERR(1, 1120, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_minutes, __pyx_int_neg_59) < 0) __PYX_ERR(1, 1120, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1120, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1120, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.hours = -23;
    __pyx_t_8.minites = -59;
    __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_new(&__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1120, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1120, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1120, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1120, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1120, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1123
 * 
 *     # Local
 *     assert tz_parse(LOCALTZ) == tz_local()  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: tzinfo_generate")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_6 = __pyx_f_7cytimes_5utils_tz_parse(__pyx_v_LOCALTZ); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_local(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1123, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 1123, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1123, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1123, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1125
 *     assert tz_parse(LOCALTZ) == tz_local()  # type: ignore
 * 
 *     print("Passed: tzinfo_generate")             # <<<<<<<<<<<<<<
 * 
 *     del datetime, time, LOCALTZ
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__102, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":1127
 *     print("Passed: tzinfo_generate")
 * 
 *     del datetime, time, LOCALTZ             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;
  __Pyx_DECREF(__pyx_v_time); __pyx_v_time = 0;
  __Pyx_DECREF(__pyx_v_LOCALTZ); __pyx_v_LOCALTZ = 0;

  /* "cytimes/utils.py":1111
 * 
 * # datetime.tzinfo
 * def _test_tzinfo_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime, time
 *     from babel.dates import LOCALTZ
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytimes.utils._test_tzinfo_generate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_time);
  __Pyx_XDECREF(__pyx_v_LOCALTZ);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":1130
 * 
 * 
 * def _test_tzinfo_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_65_test_tzinfo_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_65_test_tzinfo_type_check = {"_test_tzinfo_type_check", (PyCFunction)__pyx_pw_7cytimes_5utils_65_test_tzinfo_type_check, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_65_test_tzinfo_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_tzinfo_type_check (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_64_test_tzinfo_type_check(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_64_test_tzinfo_type_check(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyDateTime_TZInfo *__pyx_v_tz = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_tzinfo_type_check", 1);

  /* "cytimes/utils.py":1131
 * 
 * def _test_tzinfo_type_check() -> None:
 *     import datetime             # <<<<<<<<<<<<<<
 * 
 *     tz = UTC
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1133
 *     import datetime
 * 
 *     tz = UTC             # <<<<<<<<<<<<<<
 *     assert is_tz(tz)  # type: ignore
 *     assert not is_tz_exact(tz)  # type: ignore
 */
  __Pyx_INCREF((PyObject *)__pyx_v_7cytimes_5utils_UTC);
  __pyx_v_tz = __pyx_v_7cytimes_5utils_UTC;

  /* "cytimes/utils.py":1134
 * 
 *     tz = UTC
 *     assert is_tz(tz)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert not is_tz_exact(tz)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_is_tz(((PyObject *)__pyx_v_tz)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 1134, __pyx_L1_error)
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1134, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1134, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1135
 *     tz = UTC
 *     assert is_tz(tz)  # type: ignore
 *     assert not is_tz_exact(tz)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: tzinfo_type_check")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_is_tz_exact(((PyObject *)__pyx_v_tz)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 1135, __pyx_L1_error)
    __pyx_t_3 = (!__pyx_t_2);
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1135, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1135, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1137
 *     assert not is_tz_exact(tz)  # type: ignore
 * 
 *     print("Passed: tzinfo_type_check")             # <<<<<<<<<<<<<<
 * 
 *     del datetime
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__103, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1139
 *     print("Passed: tzinfo_type_check")
 * 
 *     del datetime             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;

  /* "cytimes/utils.py":1130
 * 
 * 
 * def _test_tzinfo_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils._test_tzinfo_type_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF((PyObject *)__pyx_v_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":1142
 * 
 * 
 * def _test_tzinfo_access() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_67_test_tzinfo_access(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_67_test_tzinfo_access = {"_test_tzinfo_access", (PyCFunction)__pyx_pw_7cytimes_5utils_67_test_tzinfo_access, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_67_test_tzinfo_access(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_tzinfo_access (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_66_test_tzinfo_access(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_66_test_tzinfo_access(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_ZoneInfo = NULL;
  PyObject *__pyx_v_dt = NULL;
  PyObject *__pyx_v_tz = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  struct __pyx_opt_args_7cytimes_5utils_tz_name __pyx_t_5;
  int __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils_tz_dst __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcformat __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_tzinfo_access", 1);

  /* "cytimes/utils.py":1143
 * 
 * def _test_tzinfo_access() -> None:
 *     import datetime             # <<<<<<<<<<<<<<
 *     from zoneinfo import ZoneInfo
 * 
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1144
 * def _test_tzinfo_access() -> None:
 *     import datetime
 *     from zoneinfo import ZoneInfo             # <<<<<<<<<<<<<<
 * 
 *     dt = datetime.datetime.now()
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_ZoneInfo);
  __Pyx_GIVEREF(__pyx_n_s_ZoneInfo);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ZoneInfo)) __PYX_ERR(1, 1144, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_zoneinfo, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ZoneInfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_ZoneInfo = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":1146
 *     from zoneinfo import ZoneInfo
 * 
 *     dt = datetime.datetime.now()             # <<<<<<<<<<<<<<
 *     tz = dt.tzinfo
 *     assert None == tz_name(tz, dt)  # type: ignore
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_now); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_dt = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":1147
 * 
 *     dt = datetime.datetime.now()
 *     tz = dt.tzinfo             # <<<<<<<<<<<<<<
 *     assert None == tz_name(tz, dt)  # type: ignore
 *     assert None == tz_dst(tz, dt)  # type: ignore
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_tz = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":1148
 *     dt = datetime.datetime.now()
 *     tz = dt.tzinfo
 *     assert None == tz_name(tz, dt)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert None == tz_dst(tz, dt)  # type: ignore
 *     assert None == tz_utcoffset(tz, dt)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 1148, __pyx_L1_error)
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.dt = ((PyDateTime_DateTime *)__pyx_v_dt);
    __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_name(__pyx_v_tz, &__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = (__Pyx_PyUnicode_Equals(Py_None, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1148, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1148, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1148, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1149
 *     tz = dt.tzinfo
 *     assert None == tz_name(tz, dt)  # type: ignore
 *     assert None == tz_dst(tz, dt)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert None == tz_utcoffset(tz, dt)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 1149, __pyx_L1_error)
    __pyx_t_7.__pyx_n = 1;
    __pyx_t_7.dt = ((PyDateTime_DateTime *)__pyx_v_dt);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_dst(__pyx_v_tz, &__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(Py_None, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1149, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1149, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1149, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1149, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1150
 *     assert None == tz_name(tz, dt)  # type: ignore
 *     assert None == tz_dst(tz, dt)  # type: ignore
 *     assert None == tz_utcoffset(tz, dt)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     dt = datetime.datetime.now(UTC)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 1150, __pyx_L1_error)
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.dt = ((PyDateTime_DateTime *)__pyx_v_dt);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_v_tz, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(Py_None, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1150, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1150, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1150, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1150, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1152
 *     assert None == tz_utcoffset(tz, dt)  # type: ignore
 * 
 *     dt = datetime.datetime.now(UTC)             # <<<<<<<<<<<<<<
 *     tz = dt.tzinfo
 *     assert "UTC" == tz_name(tz, dt)  # type: ignore
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_now); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_7cytimes_5utils_UTC)};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":1153
 * 
 *     dt = datetime.datetime.now(UTC)
 *     tz = dt.tzinfo             # <<<<<<<<<<<<<<
 *     assert "UTC" == tz_name(tz, dt)  # type: ignore
 *     assert None == tz_dst(tz, dt)  # type: ignore
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":1154
 *     dt = datetime.datetime.now(UTC)
 *     tz = dt.tzinfo
 *     assert "UTC" == tz_name(tz, dt)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert None == tz_dst(tz, dt)  # type: ignore
 *     assert datetime.timedelta() == tz_utcoffset(tz, dt)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 1154, __pyx_L1_error)
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.dt = ((PyDateTime_DateTime *)__pyx_v_dt);
    __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_name(__pyx_v_tz, &__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_n_u_UTC, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1154, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1154, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1154, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1155
 *     tz = dt.tzinfo
 *     assert "UTC" == tz_name(tz, dt)  # type: ignore
 *     assert None == tz_dst(tz, dt)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timedelta() == tz_utcoffset(tz, dt)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 1155, __pyx_L1_error)
    __pyx_t_7.__pyx_n = 1;
    __pyx_t_7.dt = ((PyDateTime_DateTime *)__pyx_v_dt);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_dst(__pyx_v_tz, &__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(Py_None, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1155, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1155, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1155, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1155, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1156
 *     assert "UTC" == tz_name(tz, dt)  # type: ignore
 *     assert None == tz_dst(tz, dt)  # type: ignore
 *     assert datetime.timedelta() == tz_utcoffset(tz, dt)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     dt = datetime.datetime.now(ZoneInfo("Asia/Shanghai"))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 1156, __pyx_L1_error)
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.dt = ((PyDateTime_DateTime *)__pyx_v_dt);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_v_tz, &__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1156, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1156, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1156, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1156, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1158
 *     assert datetime.timedelta() == tz_utcoffset(tz, dt)  # type: ignore
 * 
 *     dt = datetime.datetime.now(ZoneInfo("Asia/Shanghai"))             # <<<<<<<<<<<<<<
 *     tz = dt.tzinfo
 *     assert "CST" == tz_name(tz, dt)  # type: ignore
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_now); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_v_ZoneInfo);
  __pyx_t_9 = __pyx_v_ZoneInfo; __pyx_t_10 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_kp_u_Asia_Shanghai};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __pyx_t_9 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_2};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/utils.py":1159
 * 
 *     dt = datetime.datetime.now(ZoneInfo("Asia/Shanghai"))
 *     tz = dt.tzinfo             # <<<<<<<<<<<<<<
 *     assert "CST" == tz_name(tz, dt)  # type: ignore
 *     assert datetime.timedelta() == tz_dst(tz, dt)  # type: ignore
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/utils.py":1160
 *     dt = datetime.datetime.now(ZoneInfo("Asia/Shanghai"))
 *     tz = dt.tzinfo
 *     assert "CST" == tz_name(tz, dt)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timedelta() == tz_dst(tz, dt)  # type: ignore
 *     assert datetime.timedelta(hours=8) == tz_utcoffset(tz, dt)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 1160, __pyx_L1_error)
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.dt = ((PyDateTime_DateTime *)__pyx_v_dt);
    __pyx_t_3 = __pyx_f_7cytimes_5utils_tz_name(__pyx_v_tz, &__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_n_u_CST, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1160, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1160, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1160, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1161
 *     tz = dt.tzinfo
 *     assert "CST" == tz_name(tz, dt)  # type: ignore
 *     assert datetime.timedelta() == tz_dst(tz, dt)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timedelta(hours=8) == tz_utcoffset(tz, dt)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 1161, __pyx_L1_error)
    __pyx_t_7.__pyx_n = 1;
    __pyx_t_7.dt = ((PyDateTime_DateTime *)__pyx_v_dt);
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_dst(__pyx_v_tz, &__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1161, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1161, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1161, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1161, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1162
 *     assert "CST" == tz_name(tz, dt)  # type: ignore
 *     assert datetime.timedelta() == tz_dst(tz, dt)  # type: ignore
 *     assert datetime.timedelta(hours=8) == tz_utcoffset(tz, dt)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     dt = datetime.datetime.now()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hours, __pyx_int_8) < 0) __PYX_ERR(1, 1162, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 1162, __pyx_L1_error)
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.dt = ((PyDateTime_DateTime *)__pyx_v_dt);
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_v_tz, &__pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1162, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1162, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1162, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1162, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1164
 *     assert datetime.timedelta(hours=8) == tz_utcoffset(tz, dt)  # type: ignore
 * 
 *     dt = datetime.datetime.now()             # <<<<<<<<<<<<<<
 *     tz = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 *     assert "+2359" == tz_utcformat(tz, dt)  # type: ignore
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_now); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":1165
 * 
 *     dt = datetime.datetime.now()
 *     tz = datetime.timezone(datetime.timedelta(hours=23, minutes=59))             # <<<<<<<<<<<<<<
 *     assert "+2359" == tz_utcformat(tz, dt)  # type: ignore
 *     tz = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_hours, __pyx_int_23) < 0) __PYX_ERR(1, 1165, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_minutes, __pyx_int_59) < 0) __PYX_ERR(1, 1165, __pyx_L1_error)
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":1166
 *     dt = datetime.datetime.now()
 *     tz = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 *     assert "+2359" == tz_utcformat(tz, dt)  # type: ignore             # <<<<<<<<<<<<<<
 *     tz = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     assert "+0101" == tz_utcformat(tz, dt)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 1166, __pyx_L1_error)
    __pyx_t_11.__pyx_n = 1;
    __pyx_t_11.dt = ((PyDateTime_DateTime *)__pyx_v_dt);
    __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_utcformat(__pyx_v_tz, &__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_2359, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1166, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1166, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1166, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1167
 *     tz = datetime.timezone(datetime.timedelta(hours=23, minutes=59))
 *     assert "+2359" == tz_utcformat(tz, dt)  # type: ignore
 *     tz = datetime.timezone(datetime.timedelta(hours=1, minutes=1))             # <<<<<<<<<<<<<<
 *     assert "+0101" == tz_utcformat(tz, dt)  # type: ignore
 *     tz = datetime.timezone(datetime.timedelta(hours=-1, minutes=-1))
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_hours, __pyx_int_1) < 0) __PYX_ERR(1, 1167, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_minutes, __pyx_int_1) < 0) __PYX_ERR(1, 1167, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_1};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":1168
 *     assert "+2359" == tz_utcformat(tz, dt)  # type: ignore
 *     tz = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     assert "+0101" == tz_utcformat(tz, dt)  # type: ignore             # <<<<<<<<<<<<<<
 *     tz = datetime.timezone(datetime.timedelta(hours=-1, minutes=-1))
 *     assert "-0101" == tz_utcformat(tz, dt)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 1168, __pyx_L1_error)
    __pyx_t_11.__pyx_n = 1;
    __pyx_t_11.dt = ((PyDateTime_DateTime *)__pyx_v_dt);
    __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_utcformat(__pyx_v_tz, &__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_0101, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1168, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1168, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1168, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1169
 *     tz = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     assert "+0101" == tz_utcformat(tz, dt)  # type: ignore
 *     tz = datetime.timezone(datetime.timedelta(hours=-1, minutes=-1))             # <<<<<<<<<<<<<<
 *     assert "-0101" == tz_utcformat(tz, dt)  # type: ignore
 *     tz = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_hours, __pyx_int_neg_1) < 0) __PYX_ERR(1, 1169, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_minutes, __pyx_int_neg_1) < 0) __PYX_ERR(1, 1169, __pyx_L1_error)
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":1170
 *     assert "+0101" == tz_utcformat(tz, dt)  # type: ignore
 *     tz = datetime.timezone(datetime.timedelta(hours=-1, minutes=-1))
 *     assert "-0101" == tz_utcformat(tz, dt)  # type: ignore             # <<<<<<<<<<<<<<
 *     tz = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))
 *     assert "-2359" == tz_utcformat(tz, dt)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 1170, __pyx_L1_error)
    __pyx_t_11.__pyx_n = 1;
    __pyx_t_11.dt = ((PyDateTime_DateTime *)__pyx_v_dt);
    __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_utcformat(__pyx_v_tz, &__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_0101_2, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1170, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1170, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1170, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1171
 *     tz = datetime.timezone(datetime.timedelta(hours=-1, minutes=-1))
 *     assert "-0101" == tz_utcformat(tz, dt)  # type: ignore
 *     tz = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))             # <<<<<<<<<<<<<<
 *     assert "-2359" == tz_utcformat(tz, dt)  # type: ignore
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_hours, __pyx_int_neg_23) < 0) __PYX_ERR(1, 1171, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_minutes, __pyx_int_neg_59) < 0) __PYX_ERR(1, 1171, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_1};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":1172
 *     assert "-0101" == tz_utcformat(tz, dt)  # type: ignore
 *     tz = datetime.timezone(datetime.timedelta(hours=-23, minutes=-59))
 *     assert "-2359" == tz_utcformat(tz, dt)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: tzinfo_access")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(1, 1172, __pyx_L1_error)
    __pyx_t_11.__pyx_n = 1;
    __pyx_t_11.dt = ((PyDateTime_DateTime *)__pyx_v_dt);
    __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_utcformat(__pyx_v_tz, &__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_kp_u_2359_2, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 1172, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1172, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1172, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1174
 *     assert "-2359" == tz_utcformat(tz, dt)  # type: ignore
 * 
 *     print("Passed: tzinfo_access")             # <<<<<<<<<<<<<<
 * 
 *     del datetime, ZoneInfo
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":1176
 *     print("Passed: tzinfo_access")
 * 
 *     del datetime, ZoneInfo             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;
  __Pyx_DECREF(__pyx_v_ZoneInfo); __pyx_v_ZoneInfo = 0;

  /* "cytimes/utils.py":1142
 * 
 * 
 * def _test_tzinfo_access() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytimes.utils._test_tzinfo_access", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_ZoneInfo);
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":1180
 * 
 * # . numpy.share
 * def _test_numpy_share() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_69_test_numpy_share(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_69_test_numpy_share = {"_test_numpy_share", (PyCFunction)__pyx_pw_7cytimes_5utils_69_test_numpy_share, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_69_test_numpy_share(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_numpy_share (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_68_test_numpy_share(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_68_test_numpy_share(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_np = NULL;
  PyObject *__pyx_v_units = NULL;
  PyObject *__pyx_v_unit = NULL;
  PyObject *__pyx_v_arr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  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("_test_numpy_share", 1);

  /* "cytimes/utils.py":1181
 * # . numpy.share
 * def _test_numpy_share() -> None:
 *     import numpy as np             # <<<<<<<<<<<<<<
 * 
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns", "ps", "fs", "as")
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1183
 *     import numpy as np
 * 
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns", "ps", "fs", "as")             # <<<<<<<<<<<<<<
 * 
 *     for unit in units:
 */
  __Pyx_INCREF(__pyx_tuple__105);
  __pyx_v_units = __pyx_tuple__105;

  /* "cytimes/utils.py":1185
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns", "ps", "fs", "as")
 * 
 *     for unit in units:             # <<<<<<<<<<<<<<
 *         unit == map_nptime_unit_int2str(map_nptime_unit_str2int(unit))  # type: ignore
 * 
 */
  __pyx_t_1 = __pyx_v_units; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1185, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(1, 1185, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_unit, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.py":1186
 * 
 *     for unit in units:
 *         unit == map_nptime_unit_int2str(map_nptime_unit_str2int(unit))  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     for unit in units:
 */
    __pyx_t_4 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_unit); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1186, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 1186, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cytimes/utils.py":1185
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns", "ps", "fs", "as")
 * 
 *     for unit in units:             # <<<<<<<<<<<<<<
 *         unit == map_nptime_unit_int2str(map_nptime_unit_str2int(unit))  # type: ignore
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1188
 *         unit == map_nptime_unit_int2str(map_nptime_unit_str2int(unit))  # type: ignore
 * 
 *     for unit in units:             # <<<<<<<<<<<<<<
 *         arr = np.array([], dtype="datetime64[%s]" % unit)
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore
 */
  __pyx_t_1 = __pyx_v_units; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1188, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(1, 1188, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_unit, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.py":1189
 * 
 *     for unit in units:
 *         arr = np.array([], dtype="datetime64[%s]" % unit)             # <<<<<<<<<<<<<<
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore
 *         arr = np.array([1, 2, 3], dtype="datetime64[%s]" % unit)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6)) __PYX_ERR(1, 1189, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_unit); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(1, 1189, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_arr, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "cytimes/utils.py":1190
 *     for unit in units:
 *         arr = np.array([], dtype="datetime64[%s]" % unit)
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore             # <<<<<<<<<<<<<<
 *         arr = np.array([1, 2, 3], dtype="datetime64[%s]" % unit)
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1190, __pyx_L1_error)
      __pyx_t_4 = __pyx_f_7cytimes_5utils_parse_arr_nptime_unit(((PyArrayObject *)__pyx_v_arr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1190, __pyx_L1_error)
      __pyx_t_8 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1190, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_t_8, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 1190, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_5)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 1190, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 1190, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":1191
 *         arr = np.array([], dtype="datetime64[%s]" % unit)
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore
 *         arr = np.array([1, 2, 3], dtype="datetime64[%s]" % unit)             # <<<<<<<<<<<<<<
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore
 *         arr = np.array([], dtype="timedelta64[%s]" % unit)
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_int_1)) __PYX_ERR(1, 1191, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_2);
    __Pyx_GIVEREF(__pyx_int_2);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_int_2)) __PYX_ERR(1, 1191, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_3);
    __Pyx_GIVEREF(__pyx_int_3);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 2, __pyx_int_3)) __PYX_ERR(1, 1191, __pyx_L1_error);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6)) __PYX_ERR(1, 1191, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(1, 1191, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/utils.py":1192
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore
 *         arr = np.array([1, 2, 3], dtype="datetime64[%s]" % unit)
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore             # <<<<<<<<<<<<<<
 *         arr = np.array([], dtype="timedelta64[%s]" % unit)
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1192, __pyx_L1_error)
      __pyx_t_4 = __pyx_f_7cytimes_5utils_parse_arr_nptime_unit(((PyArrayObject *)__pyx_v_arr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1192, __pyx_L1_error)
      __pyx_t_3 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1192, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 1192, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 1192, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 1192, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":1193
 *         arr = np.array([1, 2, 3], dtype="datetime64[%s]" % unit)
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore
 *         arr = np.array([], dtype="timedelta64[%s]" % unit)             # <<<<<<<<<<<<<<
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore
 *         arr = np.array([1, 2, 3], dtype="timedelta64[%s]" % unit)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6)) __PYX_ERR(1, 1193, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_timedelta64_s, __pyx_v_unit); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(1, 1193, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "cytimes/utils.py":1194
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore
 *         arr = np.array([], dtype="timedelta64[%s]" % unit)
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore             # <<<<<<<<<<<<<<
 *         arr = np.array([1, 2, 3], dtype="timedelta64[%s]" % unit)
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1194, __pyx_L1_error)
      __pyx_t_4 = __pyx_f_7cytimes_5utils_parse_arr_nptime_unit(((PyArrayObject *)__pyx_v_arr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1194, __pyx_L1_error)
      __pyx_t_8 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_t_8, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 1194, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_5)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 1194, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 1194, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":1195
 *         arr = np.array([], dtype="timedelta64[%s]" % unit)
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore
 *         arr = np.array([1, 2, 3], dtype="timedelta64[%s]" % unit)             # <<<<<<<<<<<<<<
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore
 * 
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_int_1)) __PYX_ERR(1, 1195, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_2);
    __Pyx_GIVEREF(__pyx_int_2);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_int_2)) __PYX_ERR(1, 1195, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_3);
    __Pyx_GIVEREF(__pyx_int_3);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 2, __pyx_int_3)) __PYX_ERR(1, 1195, __pyx_L1_error);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6)) __PYX_ERR(1, 1195, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_timedelta64_s, __pyx_v_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(1, 1195, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/utils.py":1196
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore
 *         arr = np.array([1, 2, 3], dtype="timedelta64[%s]" % unit)
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: numpy_share")
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1196, __pyx_L1_error)
      __pyx_t_4 = __pyx_f_7cytimes_5utils_parse_arr_nptime_unit(((PyArrayObject *)__pyx_v_arr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1196, __pyx_L1_error)
      __pyx_t_3 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1196, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 1196, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 1196, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 1196, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":1188
 *         unit == map_nptime_unit_int2str(map_nptime_unit_str2int(unit))  # type: ignore
 * 
 *     for unit in units:             # <<<<<<<<<<<<<<
 *         arr = np.array([], dtype="datetime64[%s]" % unit)
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1198
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore
 * 
 *     print("Passed: numpy_share")             # <<<<<<<<<<<<<<
 * 
 *     del np
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1200
 *     print("Passed: numpy_share")
 * 
 *     del np             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_np); __pyx_v_np = 0;

  /* "cytimes/utils.py":1180
 * 
 * # . numpy.share
 * def _test_numpy_share() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cytimes.utils._test_numpy_share", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_np);
  __Pyx_XDECREF(__pyx_v_units);
  __Pyx_XDECREF(__pyx_v_unit);
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":1204
 * 
 * # . numpy.datetime64
 * def _test_datetime64_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_71_test_datetime64_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_71_test_datetime64_type_check = {"_test_datetime64_type_check", (PyCFunction)__pyx_pw_7cytimes_5utils_71_test_datetime64_type_check, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_71_test_datetime64_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_datetime64_type_check (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_70_test_datetime64_type_check(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_70_test_datetime64_type_check(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_np = NULL;
  PyObject *__pyx_v_dt = NULL;
  long __pyx_v_dt2;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_datetime64_type_check", 1);

  /* "cytimes/utils.py":1205
 * # . numpy.datetime64
 * def _test_datetime64_type_check() -> None:
 *     import numpy as np             # <<<<<<<<<<<<<<
 * 
 *     dt = np.datetime64("2021-01-02")
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1207
 *     import numpy as np
 * 
 *     dt = np.datetime64("2021-01-02")             # <<<<<<<<<<<<<<
 *     assert is_dt64(dt)  # type: ignore
 *     validate_dt64(dt)  # type: ignore
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_2021_01_02};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_dt = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1208
 * 
 *     dt = np.datetime64("2021-01-02")
 *     assert is_dt64(dt)  # type: ignore             # <<<<<<<<<<<<<<
 *     validate_dt64(dt)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_5 = __pyx_f_7cytimes_5utils_is_dt64(__pyx_v_dt); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1208, __pyx_L1_error)
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1208, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1208, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1209
 *     dt = np.datetime64("2021-01-02")
 *     assert is_dt64(dt)  # type: ignore
 *     validate_dt64(dt)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     dt2 = 1
 */
  __pyx_t_5 = __pyx_f_7cytimes_5utils_validate_dt64(__pyx_v_dt); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1209, __pyx_L1_error)

  /* "cytimes/utils.py":1211
 *     validate_dt64(dt)  # type: ignore
 * 
 *     dt2 = 1             # <<<<<<<<<<<<<<
 *     assert not is_dt64(dt2)  # type: ignore
 *     try:
 */
  __pyx_v_dt2 = 1;

  /* "cytimes/utils.py":1212
 * 
 *     dt2 = 1
 *     assert not is_dt64(dt2)  # type: ignore             # <<<<<<<<<<<<<<
 *     try:
 *         validate_dt64(dt2)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_dt2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __pyx_f_7cytimes_5utils_is_dt64(__pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1212, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (!__pyx_t_5);
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1212, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1212, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1213
 *     dt2 = 1
 *     assert not is_dt64(dt2)  # type: ignore
 *     try:             # <<<<<<<<<<<<<<
 *         validate_dt64(dt2)  # type: ignore
 *     except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    /*try:*/ {

      /* "cytimes/utils.py":1214
 *     assert not is_dt64(dt2)  # type: ignore
 *     try:
 *         validate_dt64(dt2)  # type: ignore             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         pass
 */
      __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_dt2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1214, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __pyx_f_7cytimes_5utils_validate_dt64(__pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1214, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cytimes/utils.py":1213
 *     dt2 = 1
 *     assert not is_dt64(dt2)  # type: ignore
 *     try:             # <<<<<<<<<<<<<<
 *         validate_dt64(dt2)  # type: ignore
 *     except TypeError:
 */
    }

    /* "cytimes/utils.py":1218
 *         pass
 *     else:
 *         raise AssertionError("Failed: datetime64_type_check")             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: datetime64_type_check")
 */
    /*else:*/ {
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1218, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 1218, __pyx_L5_except_error)
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cytimes/utils.py":1215
 *     try:
 *         validate_dt64(dt2)  # type: ignore
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         pass
 *     else:
 */
    __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_10) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "cytimes/utils.py":1213
 *     dt2 = 1
 *     assert not is_dt64(dt2)  # type: ignore
 *     try:             # <<<<<<<<<<<<<<
 *         validate_dt64(dt2)  # type: ignore
 *     except TypeError:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
  }

  /* "cytimes/utils.py":1220
 *         raise AssertionError("Failed: datetime64_type_check")
 * 
 *     print("Passed: datetime64_type_check")             # <<<<<<<<<<<<<<
 * 
 *     del np
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__108, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1222
 *     print("Passed: datetime64_type_check")
 * 
 *     del np             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_np); __pyx_v_np = 0;

  /* "cytimes/utils.py":1204
 * 
 * # . numpy.datetime64
 * def _test_datetime64_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils._test_datetime64_type_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_np);
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":1225
 * 
 * 
 * def _test_datetime64_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime, numpy as np
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_73_test_datetime64_conversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_73_test_datetime64_conversion = {"_test_datetime64_conversion", (PyCFunction)__pyx_pw_7cytimes_5utils_73_test_datetime64_conversion, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_73_test_datetime64_conversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_datetime64_conversion (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_72_test_datetime64_conversion(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_72_test_datetime64_conversion(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_np = NULL;
  PyObject *__pyx_v_units = NULL;
  PyObject *__pyx_v_unit = NULL;
  long __pyx_v_i;
  PyObject *__pyx_v_dt64 = NULL;
  PyObject *__pyx_v_us = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  npy_int64 __pyx_t_9;
  int __pyx_t_10;
  PY_LONG_LONG __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_datetime64_conversion", 1);

  /* "cytimes/utils.py":1226
 * 
 * def _test_datetime64_conversion() -> None:
 *     import datetime, numpy as np             # <<<<<<<<<<<<<<
 * 
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1228
 *     import datetime, numpy as np
 * 
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")             # <<<<<<<<<<<<<<
 *     for unit in units:
 *         for i in range(-500, 501):
 */
  __Pyx_INCREF(__pyx_tuple__109);
  __pyx_v_units = __pyx_tuple__109;

  /* "cytimes/utils.py":1229
 * 
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")
 *     for unit in units:             # <<<<<<<<<<<<<<
 *         for i in range(-500, 501):
 *             dt64 = np.datetime64(i, unit)
 */
  __pyx_t_1 = __pyx_v_units; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1229, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(1, 1229, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_unit, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.py":1230
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")
 *     for unit in units:
 *         for i in range(-500, 501):             # <<<<<<<<<<<<<<
 *             dt64 = np.datetime64(i, unit)
 *             us = dt64.astype("datetime64[us]").astype("int64")
 */
    for (__pyx_t_4 = -500L; __pyx_t_4 < 0x1F5; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "cytimes/utils.py":1231
 *     for unit in units:
 *         for i in range(-500, 501):
 *             dt64 = np.datetime64(i, unit)             # <<<<<<<<<<<<<<
 *             us = dt64.astype("datetime64[us]").astype("int64")
 *             assert dt64_as_int64_us(dt64) == us  # type: ignore
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1231, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1231, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_unit};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1231, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_dt64, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cytimes/utils.py":1232
 *         for i in range(-500, 501):
 *             dt64 = np.datetime64(i, unit)
 *             us = dt64.astype("datetime64[us]").astype("int64")             # <<<<<<<<<<<<<<
 *             assert dt64_as_int64_us(dt64) == us  # type: ignore
 *             assert dt64_to_dt(dt64) == dt_fr_us(us)  # type: ignore
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt64, __pyx_n_s_astype); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1232, __pyx_L1_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, __pyx_kp_u_datetime64_us};
        __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, 1232, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_n_u_int64};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1232, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_us, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cytimes/utils.py":1233
 *             dt64 = np.datetime64(i, unit)
 *             us = dt64.astype("datetime64[us]").astype("int64")
 *             assert dt64_as_int64_us(dt64) == us  # type: ignore             # <<<<<<<<<<<<<<
 *             assert dt64_to_dt(dt64) == dt_fr_us(us)  # type: ignore
 * 
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_9 = __pyx_f_7cytimes_5utils_dt64_as_int64_us(__pyx_v_dt64, NULL); if (unlikely(__pyx_t_9 == ((npy_int64)-1) && PyErr_Occurred())) __PYX_ERR(1, 1233, __pyx_L1_error)
        __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1233, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_v_us, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1233, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(1, 1233, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_10)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(1, 1233, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(1, 1233, __pyx_L1_error)
      #endif

      /* "cytimes/utils.py":1234
 *             us = dt64.astype("datetime64[us]").astype("int64")
 *             assert dt64_as_int64_us(dt64) == us  # type: ignore
 *             assert dt64_to_dt(dt64) == dt_fr_us(us)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: datetime64_conversion")
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_6 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64_to_dt(__pyx_v_dt64, NULL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1234, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_11 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_v_us); if (unlikely((__pyx_t_11 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 1234, __pyx_L1_error)
        __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_us(__pyx_t_11, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1234, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1234, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(1, 1234, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_10)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(1, 1234, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(1, 1234, __pyx_L1_error)
      #endif
    }

    /* "cytimes/utils.py":1229
 * 
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")
 *     for unit in units:             # <<<<<<<<<<<<<<
 *         for i in range(-500, 501):
 *             dt64 = np.datetime64(i, unit)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1236
 *             assert dt64_to_dt(dt64) == dt_fr_us(us)  # type: ignore
 * 
 *     print("Passed: datetime64_conversion")             # <<<<<<<<<<<<<<
 * 
 *     del datetime, np
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__110, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1238
 *     print("Passed: datetime64_conversion")
 * 
 *     del datetime, np             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;
  __Pyx_DECREF(__pyx_v_np); __pyx_v_np = 0;

  /* "cytimes/utils.py":1225
 * 
 * 
 * def _test_datetime64_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime, numpy as np
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.utils._test_datetime64_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_np);
  __Pyx_XDECREF(__pyx_v_units);
  __Pyx_XDECREF(__pyx_v_unit);
  __Pyx_XDECREF(__pyx_v_dt64);
  __Pyx_XDECREF(__pyx_v_us);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":1242
 * 
 * # . numpy.timedelta64
 * def _test_timedelta64_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_75_test_timedelta64_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_75_test_timedelta64_type_check = {"_test_timedelta64_type_check", (PyCFunction)__pyx_pw_7cytimes_5utils_75_test_timedelta64_type_check, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_75_test_timedelta64_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_timedelta64_type_check (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_74_test_timedelta64_type_check(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_74_test_timedelta64_type_check(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_np = NULL;
  PyObject *__pyx_v_td = NULL;
  long __pyx_v_td2;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_timedelta64_type_check", 1);

  /* "cytimes/utils.py":1243
 * # . numpy.timedelta64
 * def _test_timedelta64_type_check() -> None:
 *     import numpy as np             # <<<<<<<<<<<<<<
 * 
 *     td = np.timedelta64(1, "D")
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1245
 *     import numpy as np
 * 
 *     td = np.timedelta64(1, "D")             # <<<<<<<<<<<<<<
 *     assert is_td64(td)  # type: ignore
 *     validate_td64(td)  # type: ignore
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_td = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/utils.py":1246
 * 
 *     td = np.timedelta64(1, "D")
 *     assert is_td64(td)  # type: ignore             # <<<<<<<<<<<<<<
 *     validate_td64(td)  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = __pyx_f_7cytimes_5utils_is_td64(__pyx_v_td); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1246, __pyx_L1_error)
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1246, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1246, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1247
 *     td = np.timedelta64(1, "D")
 *     assert is_td64(td)  # type: ignore
 *     validate_td64(td)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     td2 = 1
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_validate_td64(__pyx_v_td); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1247, __pyx_L1_error)

  /* "cytimes/utils.py":1249
 *     validate_td64(td)  # type: ignore
 * 
 *     td2 = 1             # <<<<<<<<<<<<<<
 *     assert not is_td64(td2)  # type: ignore
 *     try:
 */
  __pyx_v_td2 = 1;

  /* "cytimes/utils.py":1250
 * 
 *     td2 = 1
 *     assert not is_td64(td2)  # type: ignore             # <<<<<<<<<<<<<<
 *     try:
 *         validate_td64(td2)  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_td2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_f_7cytimes_5utils_is_td64(__pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1250, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = (!__pyx_t_3);
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1250, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1250, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1251
 *     td2 = 1
 *     assert not is_td64(td2)  # type: ignore
 *     try:             # <<<<<<<<<<<<<<
 *         validate_td64(td2)  # type: ignore
 *     except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "cytimes/utils.py":1252
 *     assert not is_td64(td2)  # type: ignore
 *     try:
 *         validate_td64(td2)  # type: ignore             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         pass
 */
      __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_td2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1252, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __pyx_f_7cytimes_5utils_validate_td64(__pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1252, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cytimes/utils.py":1251
 *     td2 = 1
 *     assert not is_td64(td2)  # type: ignore
 *     try:             # <<<<<<<<<<<<<<
 *         validate_td64(td2)  # type: ignore
 *     except TypeError:
 */
    }

    /* "cytimes/utils.py":1256
 *         pass
 *     else:
 *         raise AssertionError("Failed: timedelta64_type_check")             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: timedelta64_type_check")
 */
    /*else:*/ {
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__112, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1256, __pyx_L5_except_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(1, 1256, __pyx_L5_except_error)
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cytimes/utils.py":1253
 *     try:
 *         validate_td64(td2)  # type: ignore
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         pass
 *     else:
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_8) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "cytimes/utils.py":1251
 *     td2 = 1
 *     assert not is_td64(td2)  # type: ignore
 *     try:             # <<<<<<<<<<<<<<
 *         validate_td64(td2)  # type: ignore
 *     except TypeError:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
  }

  /* "cytimes/utils.py":1258
 *         raise AssertionError("Failed: timedelta64_type_check")
 * 
 *     print("Passed: timedelta64_type_check")             # <<<<<<<<<<<<<<
 * 
 *     del np
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/utils.py":1260
 *     print("Passed: timedelta64_type_check")
 * 
 *     del np             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_np); __pyx_v_np = 0;

  /* "cytimes/utils.py":1242
 * 
 * # . numpy.timedelta64
 * def _test_timedelta64_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils._test_timedelta64_type_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_np);
  __Pyx_XDECREF(__pyx_v_td);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":1263
 * 
 * 
 * def _test_timedelta64_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime, numpy as np
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_77_test_timedelta64_conversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_77_test_timedelta64_conversion = {"_test_timedelta64_conversion", (PyCFunction)__pyx_pw_7cytimes_5utils_77_test_timedelta64_conversion, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_77_test_timedelta64_conversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_timedelta64_conversion (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_76_test_timedelta64_conversion(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_76_test_timedelta64_conversion(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_np = NULL;
  PyObject *__pyx_v_units = NULL;
  PyObject *__pyx_v_unit = NULL;
  long __pyx_v_i;
  PyObject *__pyx_v_td64 = NULL;
  PyObject *__pyx_v_us = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  npy_int64 __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_timedelta64_conversion", 1);

  /* "cytimes/utils.py":1264
 * 
 * def _test_timedelta64_conversion() -> None:
 *     import datetime, numpy as np             # <<<<<<<<<<<<<<
 * 
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1266
 *     import datetime, numpy as np
 * 
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")             # <<<<<<<<<<<<<<
 *     for unit in units:
 *         for i in range(-500, 501):
 */
  __Pyx_INCREF(__pyx_tuple__109);
  __pyx_v_units = __pyx_tuple__109;

  /* "cytimes/utils.py":1267
 * 
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")
 *     for unit in units:             # <<<<<<<<<<<<<<
 *         for i in range(-500, 501):
 *             td64 = np.timedelta64(i, unit)
 */
  __pyx_t_1 = __pyx_v_units; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1267, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(1, 1267, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_unit, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.py":1268
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")
 *     for unit in units:
 *         for i in range(-500, 501):             # <<<<<<<<<<<<<<
 *             td64 = np.timedelta64(i, unit)
 *             us = td64.astype("timedelta64[us]").astype("int64")
 */
    for (__pyx_t_4 = -500L; __pyx_t_4 < 0x1F5; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "cytimes/utils.py":1269
 *     for unit in units:
 *         for i in range(-500, 501):
 *             td64 = np.timedelta64(i, unit)             # <<<<<<<<<<<<<<
 *             us = td64.astype("timedelta64[us]").astype("int64")
 *             assert td64_as_int64_us(td64) == us  # type: ignore
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_unit};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1269, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_td64, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cytimes/utils.py":1270
 *         for i in range(-500, 501):
 *             td64 = np.timedelta64(i, unit)
 *             us = td64.astype("timedelta64[us]").astype("int64")             # <<<<<<<<<<<<<<
 *             assert td64_as_int64_us(td64) == us  # type: ignore
 *             assert td64_to_td(td64) == datetime.timedelta(microseconds=int(us))  # type: ignore
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_td64, __pyx_n_s_astype); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1270, __pyx_L1_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, __pyx_kp_u_timedelta64_us};
        __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, 1270, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1270, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_n_u_int64};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1270, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_us, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cytimes/utils.py":1271
 *             td64 = np.timedelta64(i, unit)
 *             us = td64.astype("timedelta64[us]").astype("int64")
 *             assert td64_as_int64_us(td64) == us  # type: ignore             # <<<<<<<<<<<<<<
 *             assert td64_to_td(td64) == datetime.timedelta(microseconds=int(us))  # type: ignore
 * 
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_9 = __pyx_f_7cytimes_5utils_td64_as_int64_us(__pyx_v_td64, NULL); if (unlikely(__pyx_t_9 == ((npy_int64)-1) && PyErr_Occurred())) __PYX_ERR(1, 1271, __pyx_L1_error)
        __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1271, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_v_us, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1271, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(1, 1271, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_10)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(1, 1271, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(1, 1271, __pyx_L1_error)
      #endif

      /* "cytimes/utils.py":1272
 *             us = td64.astype("timedelta64[us]").astype("int64")
 *             assert td64_as_int64_us(td64) == us  # type: ignore
 *             assert td64_to_td(td64) == datetime.timedelta(microseconds=int(us))  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: timedelta64_conversion")
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_6 = ((PyObject *)__pyx_f_7cytimes_5utils_td64_to_td(__pyx_v_td64)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1272, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1272, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1272, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_v_us); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1272, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_microseconds, __pyx_t_7) < 0) __PYX_ERR(1, 1272, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1272, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1272, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(1, 1272, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_10)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(1, 1272, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(1, 1272, __pyx_L1_error)
      #endif
    }

    /* "cytimes/utils.py":1267
 * 
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")
 *     for unit in units:             # <<<<<<<<<<<<<<
 *         for i in range(-500, 501):
 *             td64 = np.timedelta64(i, unit)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1274
 *             assert td64_to_td(td64) == datetime.timedelta(microseconds=int(us))  # type: ignore
 * 
 *     print("Passed: timedelta64_conversion")             # <<<<<<<<<<<<<<
 * 
 *     del datetime, np
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1276
 *     print("Passed: timedelta64_conversion")
 * 
 *     del datetime, np             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_datetime); __pyx_v_datetime = 0;
  __Pyx_DECREF(__pyx_v_np); __pyx_v_np = 0;

  /* "cytimes/utils.py":1263
 * 
 * 
 * def _test_timedelta64_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime, numpy as np
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.utils._test_timedelta64_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_np);
  __Pyx_XDECREF(__pyx_v_units);
  __Pyx_XDECREF(__pyx_v_unit);
  __Pyx_XDECREF(__pyx_v_td64);
  __Pyx_XDECREF(__pyx_v_us);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":1280
 * 
 * # . numpy.ndarray
 * def _test_ndarray_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_79_test_ndarray_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_79_test_ndarray_type_check = {"_test_ndarray_type_check", (PyCFunction)__pyx_pw_7cytimes_5utils_79_test_ndarray_type_check, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_79_test_ndarray_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_ndarray_type_check (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_78_test_ndarray_type_check(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_78_test_ndarray_type_check(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_np = 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;
  unsigned int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_ndarray_type_check", 1);

  /* "cytimes/utils.py":1281
 * # . numpy.ndarray
 * def _test_ndarray_type_check() -> None:
 *     import numpy as np             # <<<<<<<<<<<<<<
 * 
 *     assert is_arr(np.array([1, 2, 3]))  # type: ignore
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1283
 *     import numpy as np
 * 
 *     assert is_arr(np.array([1, 2, 3]))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert is_arr(np.array([]))  # type: ignore
 *     assert is_arr("a") == False  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_1)) __PYX_ERR(1, 1283, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_2);
    __Pyx_GIVEREF(__pyx_int_2);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_2)) __PYX_ERR(1, 1283, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_3);
    __Pyx_GIVEREF(__pyx_int_3);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_int_3)) __PYX_ERR(1, 1283, __pyx_L1_error);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1283, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_6 = __pyx_f_7cytimes_5utils_is_arr(__pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1283, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1283, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1283, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1284
 * 
 *     assert is_arr(np.array([1, 2, 3]))  # type: ignore
 *     assert is_arr(np.array([]))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert is_arr("a") == False  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_6 = __pyx_f_7cytimes_5utils_is_arr(__pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1284, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1284, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1284, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1285
 *     assert is_arr(np.array([1, 2, 3]))  # type: ignore
 *     assert is_arr(np.array([]))  # type: ignore
 *     assert is_arr("a") == False  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: ndarray_type_check")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_6 = __pyx_f_7cytimes_5utils_is_arr(__pyx_n_u_a); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1285, __pyx_L1_error)
    __pyx_t_7 = (__pyx_t_6 == 0);
    if (unlikely(!__pyx_t_7)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1285, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1285, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1287
 *     assert is_arr("a") == False  # type: ignore
 * 
 *     print("Passed: ndarray_type_check")             # <<<<<<<<<<<<<<
 * 
 *     del np
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1289
 *     print("Passed: ndarray_type_check")
 * 
 *     del np             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_np); __pyx_v_np = 0;

  /* "cytimes/utils.py":1280
 * 
 * # . numpy.ndarray
 * def _test_ndarray_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils._test_ndarray_type_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_np);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":1293
 * 
 * # . numpy.ndarray[datetime64]
 * def _test_ndarray_dt64_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_81_test_ndarray_dt64_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_81_test_ndarray_dt64_type_check = {"_test_ndarray_dt64_type_check", (PyCFunction)__pyx_pw_7cytimes_5utils_81_test_ndarray_dt64_type_check, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_81_test_ndarray_dt64_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_ndarray_dt64_type_check (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_80_test_ndarray_dt64_type_check(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_80_test_ndarray_dt64_type_check(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_np = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_ndarray_dt64_type_check", 1);

  /* "cytimes/utils.py":1294
 * # . numpy.ndarray[datetime64]
 * def _test_ndarray_dt64_type_check() -> None:
 *     import numpy as np             # <<<<<<<<<<<<<<
 * 
 *     assert is_dt64arr(np.array([1, 2, 3], dtype="datetime64[ns]"))  # type: ignore
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1296
 *     import numpy as np
 * 
 *     assert is_dt64arr(np.array([1, 2, 3], dtype="datetime64[ns]"))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert is_dt64arr(np.array([], dtype="datetime64[ns]"))  # type: ignore
 *     assert is_dt64arr(np.array([1, 2, 3], dtype="int64")) == False  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1)) __PYX_ERR(1, 1296, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_2);
    __Pyx_GIVEREF(__pyx_int_2);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_int_2)) __PYX_ERR(1, 1296, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_3);
    __Pyx_GIVEREF(__pyx_int_3);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_int_3)) __PYX_ERR(1, 1296, __pyx_L1_error);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(1, 1296, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_kp_u_datetime64_ns) < 0) __PYX_ERR(1, 1296, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1296, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_7cytimes_5utils_is_dt64arr(((PyArrayObject *)__pyx_t_4)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1296, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1296, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1296, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1297
 * 
 *     assert is_dt64arr(np.array([1, 2, 3], dtype="datetime64[ns]"))  # type: ignore
 *     assert is_dt64arr(np.array([], dtype="datetime64[ns]"))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert is_dt64arr(np.array([1, 2, 3], dtype="int64")) == False  # type: ignore
 *     assert is_dt64arr(np.array([], dtype="int64")) == False  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(1, 1297, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_kp_u_datetime64_ns) < 0) __PYX_ERR(1, 1297, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1297, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_7cytimes_5utils_is_dt64arr(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1297, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1297, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1298
 *     assert is_dt64arr(np.array([1, 2, 3], dtype="datetime64[ns]"))  # type: ignore
 *     assert is_dt64arr(np.array([], dtype="datetime64[ns]"))  # type: ignore
 *     assert is_dt64arr(np.array([1, 2, 3], dtype="int64")) == False  # type: ignore             # <<<<<<<<<<<<<<
 *     assert is_dt64arr(np.array([], dtype="int64")) == False  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1)) __PYX_ERR(1, 1298, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_2);
    __Pyx_GIVEREF(__pyx_int_2);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_int_2)) __PYX_ERR(1, 1298, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_3);
    __Pyx_GIVEREF(__pyx_int_3);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_int_3)) __PYX_ERR(1, 1298, __pyx_L1_error);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(1, 1298, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_u_int64) < 0) __PYX_ERR(1, 1298, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1298, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_7cytimes_5utils_is_dt64arr(((PyArrayObject *)__pyx_t_4)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1298, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = (__pyx_t_5 == 0);
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1298, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1298, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1299
 *     assert is_dt64arr(np.array([], dtype="datetime64[ns]"))  # type: ignore
 *     assert is_dt64arr(np.array([1, 2, 3], dtype="int64")) == False  # type: ignore
 *     assert is_dt64arr(np.array([], dtype="int64")) == False  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: ndarray_dt64_type_check")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(1, 1299, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_u_int64) < 0) __PYX_ERR(1, 1299, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1299, __pyx_L1_error)
    __pyx_t_6 = __pyx_f_7cytimes_5utils_is_dt64arr(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1299, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (__pyx_t_6 == 0);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1299, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1299, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1301
 *     assert is_dt64arr(np.array([], dtype="int64")) == False  # type: ignore
 * 
 *     print("Passed: ndarray_dt64_type_check")             # <<<<<<<<<<<<<<
 * 
 *     del np
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__116, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1303
 *     print("Passed: ndarray_dt64_type_check")
 * 
 *     del np             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_np); __pyx_v_np = 0;

  /* "cytimes/utils.py":1293
 * 
 * # . numpy.ndarray[datetime64]
 * def _test_ndarray_dt64_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils._test_ndarray_dt64_type_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_np);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":1306
 * 
 * 
 * def _test_ndarray_dt64_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_83_test_ndarray_dt64_conversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_83_test_ndarray_dt64_conversion = {"_test_ndarray_dt64_conversion", (PyCFunction)__pyx_pw_7cytimes_5utils_83_test_ndarray_dt64_conversion, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_83_test_ndarray_dt64_conversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_ndarray_dt64_conversion (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_82_test_ndarray_dt64_conversion(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_82_test_ndarray_dt64_conversion(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_np = NULL;
  PyObject *__pyx_v_units = NULL;
  PyObject *__pyx_v_my_unit = NULL;
  PyObject *__pyx_v_arr = NULL;
  PyObject *__pyx_v_arr_i = NULL;
  PyObject *__pyx_v_to_unit = NULL;
  PyObject *__pyx_v_cmp = NULL;
  PyArrayObject *__pyx_v_val = NULL;
  long __pyx_8genexpr1__pyx_v_i;
  long __pyx_8genexpr2__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  long __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  unsigned int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_ndarray_dt64_conversion", 1);

  /* "cytimes/utils.py":1307
 * 
 * def _test_ndarray_dt64_conversion() -> None:
 *     import numpy as np             # <<<<<<<<<<<<<<
 * 
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1309
 *     import numpy as np
 * 
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")             # <<<<<<<<<<<<<<
 * 
 *     for my_unit in units:
 */
  __Pyx_INCREF(__pyx_tuple__109);
  __pyx_v_units = __pyx_tuple__109;

  /* "cytimes/utils.py":1311
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")
 * 
 *     for my_unit in units:             # <<<<<<<<<<<<<<
 *         arr = np.array([i for i in range(-500, 501)], dtype=f"datetime64[{my_unit}]")
 *         arr_i = arr.astype("int64")
 */
  __pyx_t_1 = __pyx_v_units; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1311, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(1, 1311, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_my_unit, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.py":1312
 * 
 *     for my_unit in units:
 *         arr = np.array([i for i in range(-500, 501)], dtype=f"datetime64[{my_unit}]")             # <<<<<<<<<<<<<<
 *         arr_i = arr.astype("int64")
 *         for to_unit in units:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    { /* enter inner scope */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1312, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      for (__pyx_t_5 = -500L; __pyx_t_5 < 0x1F5; __pyx_t_5+=1) {
        __pyx_8genexpr1__pyx_v_i = __pyx_t_5;
        __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_8genexpr1__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1312, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 1312, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    } /* exit inner scope */
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(1, 1312, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;
    __Pyx_INCREF(__pyx_kp_u_datetime64_2);
    __pyx_t_8 += 11;
    __Pyx_GIVEREF(__pyx_kp_u_datetime64_2);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_u_datetime64_2);
    __pyx_t_10 = __Pyx_PyUnicode_Unicode(__pyx_v_my_unit); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u__117);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__117);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u__117);
    __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_7, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(1, 1312, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_arr, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "cytimes/utils.py":1313
 *     for my_unit in units:
 *         arr = np.array([i for i in range(-500, 501)], dtype=f"datetime64[{my_unit}]")
 *         arr_i = arr.astype("int64")             # <<<<<<<<<<<<<<
 *         for to_unit in units:
 *             cmp = arr.astype(f"datetime64[{to_unit}]").astype("int64")
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    __pyx_t_11 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_11 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_n_u_int64};
      __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1313, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_arr_i, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "cytimes/utils.py":1314
 *         arr = np.array([i for i in range(-500, 501)], dtype=f"datetime64[{my_unit}]")
 *         arr_i = arr.astype("int64")
 *         for to_unit in units:             # <<<<<<<<<<<<<<
 *             cmp = arr.astype(f"datetime64[{to_unit}]").astype("int64")
 *             val = dt64arr_as_int64(arr, to_unit)  # type: ignore
 */
    __pyx_t_10 = __pyx_v_units; __Pyx_INCREF(__pyx_t_10);
    __pyx_t_8 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1314, __pyx_L1_error)
        #endif
        if (__pyx_t_8 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 1314, __pyx_L1_error)
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_to_unit, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.py":1315
 *         arr_i = arr.astype("int64")
 *         for to_unit in units:
 *             cmp = arr.astype(f"datetime64[{to_unit}]").astype("int64")             # <<<<<<<<<<<<<<
 *             val = dt64arr_as_int64(arr, to_unit)  # type: ignore
 *             assert np.equal(val, cmp).all()
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = 0;
      __pyx_t_9 = 127;
      __Pyx_INCREF(__pyx_kp_u_datetime64_2);
      __pyx_t_12 += 11;
      __Pyx_GIVEREF(__pyx_kp_u_datetime64_2);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_u_datetime64_2);
      __pyx_t_13 = __Pyx_PyUnicode_Unicode(__pyx_v_to_unit); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 1315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) : __pyx_t_9;
      __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_13);
      __pyx_t_13 = 0;
      __Pyx_INCREF(__pyx_kp_u__117);
      __pyx_t_12 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__117);
      PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u__117);
      __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_7, 3, __pyx_t_12, __pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 1315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      __pyx_t_11 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_11 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_13};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1315, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      __pyx_t_11 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_11 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_n_u_int64};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1315, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_cmp, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cytimes/utils.py":1316
 *         for to_unit in units:
 *             cmp = arr.astype(f"datetime64[{to_unit}]").astype("int64")
 *             val = dt64arr_as_int64(arr, to_unit)  # type: ignore             # <<<<<<<<<<<<<<
 *             assert np.equal(val, cmp).all()
 *             val = dt64arr_as_int64(arr, to_unit, my_unit)  # type: ignore
 */
      if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1316, __pyx_L1_error)
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(((PyArrayObject *)__pyx_v_arr), __pyx_v_to_unit, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1316, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_val, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.py":1317
 *             cmp = arr.astype(f"datetime64[{to_unit}]").astype("int64")
 *             val = dt64arr_as_int64(arr, to_unit)  # type: ignore
 *             assert np.equal(val, cmp).all()             # <<<<<<<<<<<<<<
 *             val = dt64arr_as_int64(arr, to_unit, my_unit)  # type: ignore
 *             assert np.equal(val, cmp).all()
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_equal); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1317, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_13 = NULL;
        __pyx_t_11 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_11 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_13, ((PyObject *)__pyx_v_val), __pyx_v_cmp};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11);
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1317, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_all); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1317, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = NULL;
        __pyx_t_11 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_11 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1317, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(1, 1317, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_14)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(1, 1317, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(1, 1317, __pyx_L1_error)
      #endif

      /* "cytimes/utils.py":1318
 *             val = dt64arr_as_int64(arr, to_unit)  # type: ignore
 *             assert np.equal(val, cmp).all()
 *             val = dt64arr_as_int64(arr, to_unit, my_unit)  # type: ignore             # <<<<<<<<<<<<<<
 *             assert np.equal(val, cmp).all()
 *             val = dt64arr_as_int64(arr_i, to_unit, my_unit)  # type: ignore
 */
      if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1318, __pyx_L1_error)
      __pyx_t_15.__pyx_n = 1;
      __pyx_t_15.arr_unit = __pyx_v_my_unit;
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(((PyArrayObject *)__pyx_v_arr), __pyx_v_to_unit, &__pyx_t_15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_val, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.py":1319
 *             assert np.equal(val, cmp).all()
 *             val = dt64arr_as_int64(arr, to_unit, my_unit)  # type: ignore
 *             assert np.equal(val, cmp).all()             # <<<<<<<<<<<<<<
 *             val = dt64arr_as_int64(arr_i, to_unit, my_unit)  # type: ignore
 *             assert np.equal(val, cmp).all()
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_equal); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1319, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_13 = NULL;
        __pyx_t_11 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_11 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_13, ((PyObject *)__pyx_v_val), __pyx_v_cmp};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11);
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1319, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_all); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1319, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        __pyx_t_11 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_11 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1319, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(1, 1319, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_14)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(1, 1319, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(1, 1319, __pyx_L1_error)
      #endif

      /* "cytimes/utils.py":1320
 *             val = dt64arr_as_int64(arr, to_unit, my_unit)  # type: ignore
 *             assert np.equal(val, cmp).all()
 *             val = dt64arr_as_int64(arr_i, to_unit, my_unit)  # type: ignore             # <<<<<<<<<<<<<<
 *             assert np.equal(val, cmp).all()
 * 
 */
      if (!(likely(((__pyx_v_arr_i) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr_i, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1320, __pyx_L1_error)
      __pyx_t_15.__pyx_n = 1;
      __pyx_t_15.arr_unit = __pyx_v_my_unit;
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(((PyArrayObject *)__pyx_v_arr_i), __pyx_v_to_unit, &__pyx_t_15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1320, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_val, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.py":1321
 *             assert np.equal(val, cmp).all()
 *             val = dt64arr_as_int64(arr_i, to_unit, my_unit)  # type: ignore
 *             assert np.equal(val, cmp).all()             # <<<<<<<<<<<<<<
 * 
 *     for my_unit in units:
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_equal); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_13 = NULL;
        __pyx_t_11 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_11 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_13, ((PyObject *)__pyx_v_val), __pyx_v_cmp};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11);
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1321, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_all); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = NULL;
        __pyx_t_11 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_11 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1321, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(1, 1321, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_14)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(1, 1321, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(1, 1321, __pyx_L1_error)
      #endif

      /* "cytimes/utils.py":1314
 *         arr = np.array([i for i in range(-500, 501)], dtype=f"datetime64[{my_unit}]")
 *         arr_i = arr.astype("int64")
 *         for to_unit in units:             # <<<<<<<<<<<<<<
 *             cmp = arr.astype(f"datetime64[{to_unit}]").astype("int64")
 *             val = dt64arr_as_int64(arr, to_unit)  # type: ignore
 */
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cytimes/utils.py":1311
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")
 * 
 *     for my_unit in units:             # <<<<<<<<<<<<<<
 *         arr = np.array([i for i in range(-500, 501)], dtype=f"datetime64[{my_unit}]")
 *         arr_i = arr.astype("int64")
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1323
 *             assert np.equal(val, cmp).all()
 * 
 *     for my_unit in units:             # <<<<<<<<<<<<<<
 *         arr = np.array([i for i in range(-500, 501)], dtype=f"datetime64[{my_unit}]")
 *         for to_unit in units:
 */
  __pyx_t_1 = __pyx_v_units; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1323, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_10); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(1, 1323, __pyx_L1_error)
    #else
    __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_my_unit, ((PyObject*)__pyx_t_10));
    __pyx_t_10 = 0;

    /* "cytimes/utils.py":1324
 * 
 *     for my_unit in units:
 *         arr = np.array([i for i in range(-500, 501)], dtype=f"datetime64[{my_unit}]")             # <<<<<<<<<<<<<<
 *         for to_unit in units:
 *             cmp = arr.astype(f"datetime64[{to_unit}]")
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    { /* enter inner scope */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      for (__pyx_t_5 = -500L; __pyx_t_5 < 0x1F5; __pyx_t_5+=1) {
        __pyx_8genexpr2__pyx_v_i = __pyx_t_5;
        __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_8genexpr2__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1324, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 1324, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    } /* exit inner scope */
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(1, 1324, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;
    __Pyx_INCREF(__pyx_kp_u_datetime64_2);
    __pyx_t_8 += 11;
    __Pyx_GIVEREF(__pyx_kp_u_datetime64_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_datetime64_2);
    __pyx_t_13 = __Pyx_PyUnicode_Unicode(__pyx_v_my_unit); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 1324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13);
    __Pyx_GIVEREF(__pyx_t_13);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_13);
    __pyx_t_13 = 0;
    __Pyx_INCREF(__pyx_kp_u__117);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__117);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__117);
    __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 1324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_13) < 0) __PYX_ERR(1, 1324, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 1324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_arr, __pyx_t_13);
    __pyx_t_13 = 0;

    /* "cytimes/utils.py":1325
 *     for my_unit in units:
 *         arr = np.array([i for i in range(-500, 501)], dtype=f"datetime64[{my_unit}]")
 *         for to_unit in units:             # <<<<<<<<<<<<<<
 *             cmp = arr.astype(f"datetime64[{to_unit}]")
 *             val = dt64arr_as_unit(arr, to_unit)  # type: ignore
 */
    __pyx_t_13 = __pyx_v_units; __Pyx_INCREF(__pyx_t_13);
    __pyx_t_8 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_13);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1325, __pyx_L1_error)
        #endif
        if (__pyx_t_8 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 1325, __pyx_L1_error)
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_13, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_to_unit, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.py":1326
 *         arr = np.array([i for i in range(-500, 501)], dtype=f"datetime64[{my_unit}]")
 *         for to_unit in units:
 *             cmp = arr.astype(f"datetime64[{to_unit}]")             # <<<<<<<<<<<<<<
 *             val = dt64arr_as_unit(arr, to_unit)  # type: ignore
 *             assert np.equal(val, cmp).all()
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_12 = 0;
      __pyx_t_9 = 127;
      __Pyx_INCREF(__pyx_kp_u_datetime64_2);
      __pyx_t_12 += 11;
      __Pyx_GIVEREF(__pyx_kp_u_datetime64_2);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_kp_u_datetime64_2);
      __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_v_to_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_9;
      __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__117);
      __pyx_t_12 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__117);
      PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_kp_u__117);
      __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, __pyx_t_12, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = NULL;
      __pyx_t_11 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_11 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_3};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1326, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_cmp, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cytimes/utils.py":1327
 *         for to_unit in units:
 *             cmp = arr.astype(f"datetime64[{to_unit}]")
 *             val = dt64arr_as_unit(arr, to_unit)  # type: ignore             # <<<<<<<<<<<<<<
 *             assert np.equal(val, cmp).all()
 * 
 */
      if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1327, __pyx_L1_error)
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_unit(((PyArrayObject *)__pyx_v_arr), __pyx_v_to_unit, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1327, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_val, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/utils.py":1328
 *             cmp = arr.astype(f"datetime64[{to_unit}]")
 *             val = dt64arr_as_unit(arr, to_unit)  # type: ignore
 *             assert np.equal(val, cmp).all()             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: ndarray_dt64_conversion")
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_equal); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1328, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_10 = NULL;
        __pyx_t_11 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_11 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_10, ((PyObject *)__pyx_v_val), __pyx_v_cmp};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1328, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_all); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1328, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        __pyx_t_11 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_11 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1328, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(1, 1328, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_14)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(1, 1328, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(1, 1328, __pyx_L1_error)
      #endif

      /* "cytimes/utils.py":1325
 *     for my_unit in units:
 *         arr = np.array([i for i in range(-500, 501)], dtype=f"datetime64[{my_unit}]")
 *         for to_unit in units:             # <<<<<<<<<<<<<<
 *             cmp = arr.astype(f"datetime64[{to_unit}]")
 *             val = dt64arr_as_unit(arr, to_unit)  # type: ignore
 */
    }
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

    /* "cytimes/utils.py":1323
 *             assert np.equal(val, cmp).all()
 * 
 *     for my_unit in units:             # <<<<<<<<<<<<<<
 *         arr = np.array([i for i in range(-500, 501)], dtype=f"datetime64[{my_unit}]")
 *         for to_unit in units:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1330
 *             assert np.equal(val, cmp).all()
 * 
 *     print("Passed: ndarray_dt64_conversion")             # <<<<<<<<<<<<<<
 * 
 *     del np
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__118, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1332
 *     print("Passed: ndarray_dt64_conversion")
 * 
 *     del np             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_np); __pyx_v_np = 0;

  /* "cytimes/utils.py":1306
 * 
 * 
 * def _test_ndarray_dt64_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("cytimes.utils._test_ndarray_dt64_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_np);
  __Pyx_XDECREF(__pyx_v_units);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_arr_i);
  __Pyx_XDECREF(__pyx_v_to_unit);
  __Pyx_XDECREF(__pyx_v_cmp);
  __Pyx_XDECREF((PyObject *)__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":1336
 * 
 * # . numpy.ndarray[timedelta64]
 * def _test_ndarray_td64_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_85_test_ndarray_td64_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_85_test_ndarray_td64_type_check = {"_test_ndarray_td64_type_check", (PyCFunction)__pyx_pw_7cytimes_5utils_85_test_ndarray_td64_type_check, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_85_test_ndarray_td64_type_check(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_ndarray_td64_type_check (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_84_test_ndarray_td64_type_check(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_84_test_ndarray_td64_type_check(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_np = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_ndarray_td64_type_check", 1);

  /* "cytimes/utils.py":1337
 * # . numpy.ndarray[timedelta64]
 * def _test_ndarray_td64_type_check() -> None:
 *     import numpy as np             # <<<<<<<<<<<<<<
 * 
 *     assert is_td64arr(np.array([1, 2, 3], dtype="timedelta64[ns]"))  # type: ignore
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1339
 *     import numpy as np
 * 
 *     assert is_td64arr(np.array([1, 2, 3], dtype="timedelta64[ns]"))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert is_td64arr(np.array([], dtype="timedelta64[ns]"))  # type: ignore
 *     assert is_td64arr(np.array([1, 2, 3], dtype="int64")) == False  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1339, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1339, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1)) __PYX_ERR(1, 1339, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_2);
    __Pyx_GIVEREF(__pyx_int_2);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_int_2)) __PYX_ERR(1, 1339, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_3);
    __Pyx_GIVEREF(__pyx_int_3);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_int_3)) __PYX_ERR(1, 1339, __pyx_L1_error);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1339, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(1, 1339, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1339, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_kp_u_timedelta64_ns) < 0) __PYX_ERR(1, 1339, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1339, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1339, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_7cytimes_5utils_is_td64arr(((PyArrayObject *)__pyx_t_4)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1339, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1339, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1339, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1340
 * 
 *     assert is_td64arr(np.array([1, 2, 3], dtype="timedelta64[ns]"))  # type: ignore
 *     assert is_td64arr(np.array([], dtype="timedelta64[ns]"))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert is_td64arr(np.array([1, 2, 3], dtype="int64")) == False  # type: ignore
 *     assert is_td64arr(np.array([], dtype="int64")) == False  # type: ignore
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(1, 1340, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_kp_u_timedelta64_ns) < 0) __PYX_ERR(1, 1340, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1340, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_7cytimes_5utils_is_td64arr(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1340, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1340, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1340, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1341
 *     assert is_td64arr(np.array([1, 2, 3], dtype="timedelta64[ns]"))  # type: ignore
 *     assert is_td64arr(np.array([], dtype="timedelta64[ns]"))  # type: ignore
 *     assert is_td64arr(np.array([1, 2, 3], dtype="int64")) == False  # type: ignore             # <<<<<<<<<<<<<<
 *     assert is_td64arr(np.array([], dtype="int64")) == False  # type: ignore
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1)) __PYX_ERR(1, 1341, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_2);
    __Pyx_GIVEREF(__pyx_int_2);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_int_2)) __PYX_ERR(1, 1341, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_3);
    __Pyx_GIVEREF(__pyx_int_3);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_int_3)) __PYX_ERR(1, 1341, __pyx_L1_error);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(1, 1341, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_u_int64) < 0) __PYX_ERR(1, 1341, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1341, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_7cytimes_5utils_is_td64arr(((PyArrayObject *)__pyx_t_4)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1341, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = (__pyx_t_5 == 0);
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1341, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1341, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1342
 *     assert is_td64arr(np.array([], dtype="timedelta64[ns]"))  # type: ignore
 *     assert is_td64arr(np.array([1, 2, 3], dtype="int64")) == False  # type: ignore
 *     assert is_td64arr(np.array([], dtype="int64")) == False  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: ndarray_td64_type_check")
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(1, 1342, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_u_int64) < 0) __PYX_ERR(1, 1342, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1342, __pyx_L1_error)
    __pyx_t_6 = __pyx_f_7cytimes_5utils_is_td64arr(((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1342, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (__pyx_t_6 == 0);
    if (unlikely(!__pyx_t_5)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(1, 1342, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 1342, __pyx_L1_error)
  #endif

  /* "cytimes/utils.py":1344
 *     assert is_td64arr(np.array([], dtype="int64")) == False  # type: ignore
 * 
 *     print("Passed: ndarray_td64_type_check")             # <<<<<<<<<<<<<<
 * 
 *     del np
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__119, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1346
 *     print("Passed: ndarray_td64_type_check")
 * 
 *     del np             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_DECREF(__pyx_v_np); __pyx_v_np = 0;

  /* "cytimes/utils.py":1336
 * 
 * # . numpy.ndarray[timedelta64]
 * def _test_ndarray_td64_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils._test_ndarray_td64_type_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_np);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/utils.py":1349
 * 
 * 
 * def _test_ndarray_td64_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_5utils_87_test_ndarray_td64_conversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_5utils_87_test_ndarray_td64_conversion = {"_test_ndarray_td64_conversion", (PyCFunction)__pyx_pw_7cytimes_5utils_87_test_ndarray_td64_conversion, METH_NOARGS, 0};
static PyObject *__pyx_pw_7cytimes_5utils_87_test_ndarray_td64_conversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_test_ndarray_td64_conversion (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7cytimes_5utils_86_test_ndarray_td64_conversion(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_5utils_86_test_ndarray_td64_conversion(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_np = NULL;
  PyObject *__pyx_v_units = NULL;
  PyObject *__pyx_v_my_unit = NULL;
  PyObject *__pyx_v_arr = NULL;
  PyObject *__pyx_v_cmp = NULL;
  PyArrayObject *__pyx_v_val = NULL;
  long __pyx_8genexpr3__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  long __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  unsigned int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_test_ndarray_td64_conversion", 1);

  /* "cytimes/utils.py":1350
 * 
 * def _test_ndarray_td64_conversion() -> None:
 *     import numpy as np             # <<<<<<<<<<<<<<
 * 
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_np = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/utils.py":1352
 *     import numpy as np
 * 
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")             # <<<<<<<<<<<<<<
 * 
 *     for my_unit in units:
 */
  __Pyx_INCREF(__pyx_tuple__109);
  __pyx_v_units = __pyx_tuple__109;

  /* "cytimes/utils.py":1354
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")
 * 
 *     for my_unit in units:             # <<<<<<<<<<<<<<
 *         arr = np.array([i for i in range(-500, 501)], dtype=f"timedelta64[{my_unit}]")
 *         cmp = arr.astype(f"timedelta64[us]")
 */
  __pyx_t_1 = __pyx_v_units; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 1354, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(1, 1354, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_my_unit, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/utils.py":1355
 * 
 *     for my_unit in units:
 *         arr = np.array([i for i in range(-500, 501)], dtype=f"timedelta64[{my_unit}]")             # <<<<<<<<<<<<<<
 *         cmp = arr.astype(f"timedelta64[us]")
 *         val = td64arr_as_int64_us(arr)  # type: ignore
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    { /* enter inner scope */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1355, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      for (__pyx_t_5 = -500L; __pyx_t_5 < 0x1F5; __pyx_t_5+=1) {
        __pyx_8genexpr3__pyx_v_i = __pyx_t_5;
        __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_8genexpr3__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1355, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 1355, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    } /* exit inner scope */
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(1, 1355, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;
    __Pyx_INCREF(__pyx_kp_u_timedelta64_2);
    __pyx_t_8 += 12;
    __Pyx_GIVEREF(__pyx_kp_u_timedelta64_2);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_u_timedelta64_2);
    __pyx_t_10 = __Pyx_PyUnicode_Unicode(__pyx_v_my_unit); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u__117);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__117);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u__117);
    __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_7, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(1, 1355, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_arr, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "cytimes/utils.py":1356
 *     for my_unit in units:
 *         arr = np.array([i for i in range(-500, 501)], dtype=f"timedelta64[{my_unit}]")
 *         cmp = arr.astype(f"timedelta64[us]")             # <<<<<<<<<<<<<<
 *         val = td64arr_as_int64_us(arr)  # type: ignore
 *         assert np.equal(val, cmp).all()
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    __pyx_t_11 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_11 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_u_timedelta64_us};
      __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1356, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_cmp, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "cytimes/utils.py":1357
 *         arr = np.array([i for i in range(-500, 501)], dtype=f"timedelta64[{my_unit}]")
 *         cmp = arr.astype(f"timedelta64[us]")
 *         val = td64arr_as_int64_us(arr)  # type: ignore             # <<<<<<<<<<<<<<
 *         assert np.equal(val, cmp).all()
 * 
 */
    if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 1357, __pyx_L1_error)
    __pyx_t_10 = ((PyObject *)__pyx_f_7cytimes_5utils_td64arr_as_int64_us(((PyArrayObject *)__pyx_v_arr), NULL)); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_XDECREF_SET(__pyx_v_val, ((PyArrayObject *)__pyx_t_10));
    __pyx_t_10 = 0;

    /* "cytimes/utils.py":1358
 *         cmp = arr.astype(f"timedelta64[us]")
 *         val = td64arr_as_int64_us(arr)  # type: ignore
 *         assert np.equal(val, cmp).all()             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: ndarray_td64_conversion")
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_equal); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1358, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = NULL;
      __pyx_t_11 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_11 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_val), __pyx_v_cmp};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1358, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_all); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1358, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      __pyx_t_11 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_11 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1358, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(1, 1358, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_12)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 1358, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 1358, __pyx_L1_error)
    #endif

    /* "cytimes/utils.py":1354
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")
 * 
 *     for my_unit in units:             # <<<<<<<<<<<<<<
 *         arr = np.array([i for i in range(-500, 501)], dtype=f"timedelta64[{my_unit}]")
 *         cmp = arr.astype(f"timedelta64[us]")
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1360
 *         assert np.equal(val, cmp).all()
 * 
 *     print("Passed: ndarray_td64_conversion")             # <<<<<<<<<<<<<<
 * 
 *     del np
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__120, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/utils.py":1362
 *     print("Passed: ndarray_td64_conversion")
 * 
 *     del np             # <<<<<<<<<<<<<<
 */
  __Pyx_DECREF(__pyx_v_np); __pyx_v_np = 0;

  /* "cytimes/utils.py":1349
 * 
 * 
 * def _test_ndarray_td64_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytimes.utils._test_ndarray_td64_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_np);
  __Pyx_XDECREF(__pyx_v_units);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_cmp);
  __Pyx_XDECREF((PyObject *)__pyx_v_val);
  __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_00, __pyx_k_00, sizeof(__pyx_k_00), 0, 1, 0, 0},
    {&__pyx_kp_u_00_00, __pyx_k_00_00, sizeof(__pyx_k_00_00), 0, 1, 0, 0},
    {&__pyx_kp_u_00_00_00_06d, __pyx_k_00_00_00_06d, sizeof(__pyx_k_00_00_00_06d), 0, 1, 0, 0},
    {&__pyx_kp_u_00_00_01, __pyx_k_00_00_01, sizeof(__pyx_k_00_00_01), 0, 1, 0, 0},
    {&__pyx_kp_u_00_00_01_2, __pyx_k_00_00_01_2, sizeof(__pyx_k_00_00_01_2), 0, 1, 0, 0},
    {&__pyx_kp_u_00_00_02d, __pyx_k_00_00_02d, sizeof(__pyx_k_00_00_02d), 0, 1, 0, 0},
    {&__pyx_kp_u_00_01_01, __pyx_k_00_01_01, sizeof(__pyx_k_00_01_01), 0, 1, 0, 0},
    {&__pyx_kp_u_00_01_01_2, __pyx_k_00_01_01_2, sizeof(__pyx_k_00_01_01_2), 0, 1, 0, 0},
    {&__pyx_kp_u_0101, __pyx_k_0101, sizeof(__pyx_k_0101), 0, 1, 0, 0},
    {&__pyx_kp_u_0101_2, __pyx_k_0101_2, sizeof(__pyx_k_0101_2), 0, 1, 0, 0},
    {&__pyx_kp_u_01_02_2021, __pyx_k_01_02_2021, sizeof(__pyx_k_01_02_2021), 0, 1, 0, 0},
    {&__pyx_kp_u_01_02_2021_000006_05_04_03, __pyx_k_01_02_2021_000006_05_04_03, sizeof(__pyx_k_01_02_2021_000006_05_04_03), 0, 1, 0, 0},
    {&__pyx_kp_u_01_02_2021_000006_05_04_03UTC_01, __pyx_k_01_02_2021_000006_05_04_03UTC_01, sizeof(__pyx_k_01_02_2021_000006_05_04_03UTC_01), 0, 1, 0, 0},
    {&__pyx_kp_u_01_02_2021_000006_05_04_03_0101, __pyx_k_01_02_2021_000006_05_04_03_0101, sizeof(__pyx_k_01_02_2021_000006_05_04_03_0101), 0, 1, 0, 0},
    {&__pyx_kp_u_02d, __pyx_k_02d, sizeof(__pyx_k_02d), 0, 1, 0, 0},
    {&__pyx_kp_u_03_04_05, __pyx_k_03_04_05, sizeof(__pyx_k_03_04_05), 0, 1, 0, 0},
    {&__pyx_kp_u_03_04_05_000006, __pyx_k_03_04_05_000006, sizeof(__pyx_k_03_04_05_000006), 0, 1, 0, 0},
    {&__pyx_kp_u_03_04_05_000006_0101, __pyx_k_03_04_05_000006_0101, sizeof(__pyx_k_03_04_05_000006_0101), 0, 1, 0, 0},
    {&__pyx_kp_u_03_04_05_0101, __pyx_k_03_04_05_0101, sizeof(__pyx_k_03_04_05_0101), 0, 1, 0, 0},
    {&__pyx_kp_u_04d, __pyx_k_04d, sizeof(__pyx_k_04d), 0, 1, 0, 0},
    {&__pyx_kp_u_06d, __pyx_k_06d, sizeof(__pyx_k_06d), 0, 1, 0, 0},
    {&__pyx_kp_u_06d_2, __pyx_k_06d_2, sizeof(__pyx_k_06d_2), 0, 1, 0, 0},
    {&__pyx_kp_u_2021_000, __pyx_k_2021_000, sizeof(__pyx_k_2021_000), 0, 1, 0, 0},
    {&__pyx_kp_u_2021_01_02, __pyx_k_2021_01_02, sizeof(__pyx_k_2021_01_02), 0, 1, 0, 0},
    {&__pyx_kp_u_2021_01_02T03_04_05, __pyx_k_2021_01_02T03_04_05, sizeof(__pyx_k_2021_01_02T03_04_05), 0, 1, 0, 0},
    {&__pyx_kp_u_2021_01_02T03_04_05_000006, __pyx_k_2021_01_02T03_04_05_000006, sizeof(__pyx_k_2021_01_02T03_04_05_000006), 0, 1, 0, 0},
    {&__pyx_kp_u_2021_01_02T03_04_05_006007, __pyx_k_2021_01_02T03_04_05_006007, sizeof(__pyx_k_2021_01_02T03_04_05_006007), 0, 1, 0, 0},
    {&__pyx_kp_u_2021_01_02_03_04_05_000006_0101, __pyx_k_2021_01_02_03_04_05_000006_0101, sizeof(__pyx_k_2021_01_02_03_04_05_000006_0101), 0, 1, 0, 0},
    {&__pyx_kp_u_2021_01_02_03_04_05_0101, __pyx_k_2021_01_02_03_04_05_0101, sizeof(__pyx_k_2021_01_02_03_04_05_0101), 0, 1, 0, 0},
    {&__pyx_kp_u_2021_365, __pyx_k_2021_365, sizeof(__pyx_k_2021_365), 0, 1, 0, 0},
    {&__pyx_kp_u_2021_367, __pyx_k_2021_367, sizeof(__pyx_k_2021_367), 0, 1, 0, 0},
    {&__pyx_kp_u_2021_W52_6, __pyx_k_2021_W52_6, sizeof(__pyx_k_2021_W52_6), 0, 1, 0, 0},
    {&__pyx_kp_u_2359, __pyx_k_2359, sizeof(__pyx_k_2359), 0, 1, 0, 0},
    {&__pyx_kp_u_2359_2, __pyx_k_2359_2, sizeof(__pyx_k_2359_2), 0, 1, 0, 0},
    {&__pyx_kp_u_24_01_01, __pyx_k_24_01_01, sizeof(__pyx_k_24_01_01), 0, 1, 0, 0},
    {&__pyx_kp_u_24_01_01_000001, __pyx_k_24_01_01_000001, sizeof(__pyx_k_24_01_01_000001), 0, 1, 0, 0},
    {&__pyx_kp_u_24_01_01_000001_2, __pyx_k_24_01_01_000001_2, sizeof(__pyx_k_24_01_01_000001_2), 0, 1, 0, 0},
    {&__pyx_kp_u_24_01_01_001000, __pyx_k_24_01_01_001000, sizeof(__pyx_k_24_01_01_001000), 0, 1, 0, 0},
    {&__pyx_kp_u_24_01_01_001000_2, __pyx_k_24_01_01_001000_2, sizeof(__pyx_k_24_01_01_001000_2), 0, 1, 0, 0},
    {&__pyx_kp_u_24_01_01_001001, __pyx_k_24_01_01_001001, sizeof(__pyx_k_24_01_01_001001), 0, 1, 0, 0},
    {&__pyx_kp_u_24_01_01_001001_2, __pyx_k_24_01_01_001001_2, sizeof(__pyx_k_24_01_01_001001_2), 0, 1, 0, 0},
    {&__pyx_kp_u_24_01_01_2, __pyx_k_24_01_01_2, sizeof(__pyx_k_24_01_01_2), 0, 1, 0, 0},
    {&__pyx_kp_u_2d, __pyx_k_2d, sizeof(__pyx_k_2d), 0, 1, 0, 0},
    {&__pyx_n_u_Apr, __pyx_k_Apr, sizeof(__pyx_k_Apr), 0, 1, 0, 1},
    {&__pyx_kp_u_Array_with_dtype_of_datetime64, __pyx_k_Array_with_dtype_of_datetime64, sizeof(__pyx_k_Array_with_dtype_of_datetime64), 0, 1, 0, 0},
    {&__pyx_kp_u_Asia_Shanghai, __pyx_k_Asia_Shanghai, sizeof(__pyx_k_Asia_Shanghai), 0, 1, 0, 0},
    {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
    {&__pyx_n_u_Aug, __pyx_k_Aug, sizeof(__pyx_k_Aug), 0, 1, 0, 1},
    {&__pyx_n_u_CET, __pyx_k_CET, sizeof(__pyx_k_CET), 0, 1, 0, 1},
    {&__pyx_n_u_CST, __pyx_k_CST, sizeof(__pyx_k_CST), 0, 1, 0, 1},
    {&__pyx_kp_u_Conversion_limits_to_datetime_u, __pyx_k_Conversion_limits_to_datetime_u, sizeof(__pyx_k_Conversion_limits_to_datetime_u), 0, 1, 0, 0},
    {&__pyx_n_s_CustomDate, __pyx_k_CustomDate, sizeof(__pyx_k_CustomDate), 0, 0, 1, 1},
    {&__pyx_n_s_CustomDateTime, __pyx_k_CustomDateTime, sizeof(__pyx_k_CustomDateTime), 0, 0, 1, 1},
    {&__pyx_n_s_CustomTD, __pyx_k_CustomTD, sizeof(__pyx_k_CustomTD), 0, 0, 1, 1},
    {&__pyx_n_s_CustomTime, __pyx_k_CustomTime, sizeof(__pyx_k_CustomTime), 0, 0, 1, 1},
    {&__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_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_DT64_NS_DD_MAX, __pyx_k_DT64_NS_DD_MAX, sizeof(__pyx_k_DT64_NS_DD_MAX), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_DD_MIN, __pyx_k_DT64_NS_DD_MIN, sizeof(__pyx_k_DT64_NS_DD_MIN), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_HH_MAX, __pyx_k_DT64_NS_HH_MAX, sizeof(__pyx_k_DT64_NS_HH_MAX), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_HH_MIN, __pyx_k_DT64_NS_HH_MIN, sizeof(__pyx_k_DT64_NS_HH_MIN), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_MI_MAX, __pyx_k_DT64_NS_MI_MAX, sizeof(__pyx_k_DT64_NS_MI_MAX), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_MI_MIN, __pyx_k_DT64_NS_MI_MIN, sizeof(__pyx_k_DT64_NS_MI_MIN), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_MM_MAX, __pyx_k_DT64_NS_MM_MAX, sizeof(__pyx_k_DT64_NS_MM_MAX), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_MM_MIN, __pyx_k_DT64_NS_MM_MIN, sizeof(__pyx_k_DT64_NS_MM_MIN), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_MS_MAX, __pyx_k_DT64_NS_MS_MAX, sizeof(__pyx_k_DT64_NS_MS_MAX), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_MS_MIN, __pyx_k_DT64_NS_MS_MIN, sizeof(__pyx_k_DT64_NS_MS_MIN), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_NS_MAX, __pyx_k_DT64_NS_NS_MAX, sizeof(__pyx_k_DT64_NS_NS_MAX), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_NS_MIN, __pyx_k_DT64_NS_NS_MIN, sizeof(__pyx_k_DT64_NS_NS_MIN), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_SS_MAX, __pyx_k_DT64_NS_SS_MAX, sizeof(__pyx_k_DT64_NS_SS_MAX), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_SS_MIN, __pyx_k_DT64_NS_SS_MIN, sizeof(__pyx_k_DT64_NS_SS_MIN), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_US_MAX, __pyx_k_DT64_NS_US_MAX, sizeof(__pyx_k_DT64_NS_US_MAX), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_US_MIN, __pyx_k_DT64_NS_US_MIN, sizeof(__pyx_k_DT64_NS_US_MIN), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_WW_MAX, __pyx_k_DT64_NS_WW_MAX, sizeof(__pyx_k_DT64_NS_WW_MAX), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_WW_MIN, __pyx_k_DT64_NS_WW_MIN, sizeof(__pyx_k_DT64_NS_WW_MIN), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_YY_MAX, __pyx_k_DT64_NS_YY_MAX, sizeof(__pyx_k_DT64_NS_YY_MAX), 0, 0, 1, 1},
    {&__pyx_n_s_DT64_NS_YY_MIN, __pyx_k_DT64_NS_YY_MIN, sizeof(__pyx_k_DT64_NS_YY_MIN), 0, 0, 1, 1},
    {&__pyx_n_u_Dec, __pyx_k_Dec, sizeof(__pyx_k_Dec), 0, 1, 0, 1},
    {&__pyx_n_s_EPOCH_DAY, __pyx_k_EPOCH_DAY, sizeof(__pyx_k_EPOCH_DAY), 0, 0, 1, 1},
    {&__pyx_n_s_EPOCH_DT, __pyx_k_EPOCH_DT, sizeof(__pyx_k_EPOCH_DT), 0, 0, 1, 1},
    {&__pyx_n_s_EPOCH_HOUR, __pyx_k_EPOCH_HOUR, sizeof(__pyx_k_EPOCH_HOUR), 0, 0, 1, 1},
    {&__pyx_n_s_EPOCH_MICROSECOND, __pyx_k_EPOCH_MICROSECOND, sizeof(__pyx_k_EPOCH_MICROSECOND), 0, 0, 1, 1},
    {&__pyx_n_s_EPOCH_MILLISECOND, __pyx_k_EPOCH_MILLISECOND, sizeof(__pyx_k_EPOCH_MILLISECOND), 0, 0, 1, 1},
    {&__pyx_n_s_EPOCH_MINUTE, __pyx_k_EPOCH_MINUTE, sizeof(__pyx_k_EPOCH_MINUTE), 0, 0, 1, 1},
    {&__pyx_n_s_EPOCH_MONTH, __pyx_k_EPOCH_MONTH, sizeof(__pyx_k_EPOCH_MONTH), 0, 0, 1, 1},
    {&__pyx_n_s_EPOCH_SECOND, __pyx_k_EPOCH_SECOND, sizeof(__pyx_k_EPOCH_SECOND), 0, 0, 1, 1},
    {&__pyx_n_s_EPOCH_YEAR, __pyx_k_EPOCH_YEAR, sizeof(__pyx_k_EPOCH_YEAR), 0, 0, 1, 1},
    {&__pyx_kp_u_Failed_datetime64_type_check, __pyx_k_Failed_datetime64_type_check, sizeof(__pyx_k_Failed_datetime64_type_check), 0, 1, 0, 0},
    {&__pyx_kp_u_Failed_timedelta64_type_check, __pyx_k_Failed_timedelta64_type_check, sizeof(__pyx_k_Failed_timedelta64_type_check), 0, 1, 0, 0},
    {&__pyx_n_u_False, __pyx_k_False, sizeof(__pyx_k_False), 0, 1, 0, 1},
    {&__pyx_n_u_Feb, __pyx_k_Feb, sizeof(__pyx_k_Feb), 0, 1, 0, 1},
    {&__pyx_kp_u_For_comparision_array_size_must, __pyx_k_For_comparision_array_size_must, sizeof(__pyx_k_For_comparision_array_size_must), 0, 1, 0, 0},
    {&__pyx_n_u_Fri, __pyx_k_Fri, sizeof(__pyx_k_Fri), 0, 1, 0, 1},
    {&__pyx_n_u_GMT, __pyx_k_GMT, sizeof(__pyx_k_GMT), 0, 1, 0, 1},
    {&__pyx_n_u_GMT0, __pyx_k_GMT0, sizeof(__pyx_k_GMT0), 0, 1, 0, 1},
    {&__pyx_kp_u_GMT_0, __pyx_k_GMT_0, sizeof(__pyx_k_GMT_0), 0, 1, 0, 0},
    {&__pyx_kp_u_GMT_0_2, __pyx_k_GMT_0_2, sizeof(__pyx_k_GMT_0_2), 0, 1, 0, 0},
    {&__pyx_n_u_Greenwich, __pyx_k_Greenwich, sizeof(__pyx_k_Greenwich), 0, 1, 0, 1},
    {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
    {&__pyx_n_s_InvalidTimezoneError, __pyx_k_InvalidTimezoneError, sizeof(__pyx_k_InvalidTimezoneError), 0, 0, 1, 1},
    {&__pyx_n_u_Jan, __pyx_k_Jan, sizeof(__pyx_k_Jan), 0, 1, 0, 1},
    {&__pyx_n_u_Jul, __pyx_k_Jul, sizeof(__pyx_k_Jul), 0, 1, 0, 1},
    {&__pyx_n_u_Jun, __pyx_k_Jun, sizeof(__pyx_k_Jun), 0, 1, 0, 1},
    {&__pyx_n_s_LOCALTZ, __pyx_k_LOCALTZ, sizeof(__pyx_k_LOCALTZ), 0, 0, 1, 1},
    {&__pyx_n_s_LOCAL_TZ, __pyx_k_LOCAL_TZ, sizeof(__pyx_k_LOCAL_TZ), 0, 0, 1, 1},
    {&__pyx_n_u_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 1, 0, 1},
    {&__pyx_n_s_MAXORDINAL, __pyx_k_MAXORDINAL, sizeof(__pyx_k_MAXORDINAL), 0, 0, 1, 1},
    {&__pyx_n_s_MS_DAY, __pyx_k_MS_DAY, sizeof(__pyx_k_MS_DAY), 0, 0, 1, 1},
    {&__pyx_n_s_MS_HOUR, __pyx_k_MS_HOUR, sizeof(__pyx_k_MS_HOUR), 0, 0, 1, 1},
    {&__pyx_n_s_MS_MINUTE, __pyx_k_MS_MINUTE, sizeof(__pyx_k_MS_MINUTE), 0, 0, 1, 1},
    {&__pyx_n_s_MS_SECOND, __pyx_k_MS_SECOND, sizeof(__pyx_k_MS_SECOND), 0, 0, 1, 1},
    {&__pyx_n_u_Mar, __pyx_k_Mar, sizeof(__pyx_k_Mar), 0, 1, 0, 1},
    {&__pyx_n_u_May, __pyx_k_May, sizeof(__pyx_k_May), 0, 1, 0, 1},
    {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
    {&__pyx_n_u_Mon, __pyx_k_Mon, sizeof(__pyx_k_Mon), 0, 1, 0, 1},
    {&__pyx_n_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_MICROSECOND, __pyx_k_NS_MICROSECOND, sizeof(__pyx_k_NS_MICROSECOND), 0, 0, 1, 1},
    {&__pyx_n_s_NS_MILLISECOND, __pyx_k_NS_MILLISECOND, sizeof(__pyx_k_NS_MILLISECOND), 0, 0, 1, 1},
    {&__pyx_n_s_NS_MINUTE, __pyx_k_NS_MINUTE, sizeof(__pyx_k_NS_MINUTE), 0, 0, 1, 1},
    {&__pyx_n_s_NS_SECOND, __pyx_k_NS_SECOND, sizeof(__pyx_k_NS_SECOND), 0, 0, 1, 1},
    {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1},
    {&__pyx_kp_u_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0, 0},
    {&__pyx_n_u_Nov, __pyx_k_Nov, sizeof(__pyx_k_Nov), 0, 1, 0, 1},
    {&__pyx_n_s_ORDINAL_MAX, __pyx_k_ORDINAL_MAX, sizeof(__pyx_k_ORDINAL_MAX), 0, 0, 1, 1},
    {&__pyx_n_u_Oct, __pyx_k_Oct, sizeof(__pyx_k_Oct), 0, 1, 0, 1},
    {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1},
    {&__pyx_kp_u_Passed_date_arithmetic, __pyx_k_Passed_date_arithmetic, sizeof(__pyx_k_Passed_date_arithmetic), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_date_conversion, __pyx_k_Passed_date_conversion, sizeof(__pyx_k_Passed_date_conversion), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_date_generate, __pyx_k_Passed_date_generate, sizeof(__pyx_k_Passed_date_generate), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_date_type_check, __pyx_k_Passed_date_type_check, sizeof(__pyx_k_Passed_date_type_check), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_datetime64_conversion, __pyx_k_Passed_datetime64_conversion, sizeof(__pyx_k_Passed_datetime64_conversion), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_datetime64_type_check, __pyx_k_Passed_datetime64_type_check, sizeof(__pyx_k_Passed_datetime64_type_check), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_days_bf_month, __pyx_k_Passed_days_bf_month, sizeof(__pyx_k_Passed_days_bf_month), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_days_bf_year, __pyx_k_Passed_days_bf_year, sizeof(__pyx_k_Passed_days_bf_year), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_days_in_month, __pyx_k_Passed_days_in_month, sizeof(__pyx_k_Passed_days_in_month), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_days_in_quarter, __pyx_k_Passed_days_in_quarter, sizeof(__pyx_k_Passed_days_in_quarter), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_dt_conversion, __pyx_k_Passed_dt_conversion, sizeof(__pyx_k_Passed_dt_conversion), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_dt_generate, __pyx_k_Passed_dt_generate, sizeof(__pyx_k_Passed_dt_generate), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_dt_manipulate, __pyx_k_Passed_dt_manipulate, sizeof(__pyx_k_Passed_dt_manipulate), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_dt_type_check, __pyx_k_Passed_dt_type_check, sizeof(__pyx_k_Passed_dt_type_check), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_dt_tzinfo, __pyx_k_Passed_dt_tzinfo, sizeof(__pyx_k_Passed_dt_tzinfo), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_is_leap_year, __pyx_k_Passed_is_leap_year, sizeof(__pyx_k_Passed_is_leap_year), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_iso_1st_monday, __pyx_k_Passed_iso_1st_monday, sizeof(__pyx_k_Passed_iso_1st_monday), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_isocalendar, __pyx_k_Passed_isocalendar, sizeof(__pyx_k_Passed_isocalendar), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_localtime_gmtime, __pyx_k_Passed_localtime_gmtime, sizeof(__pyx_k_Passed_localtime_gmtime), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_ndarray_dt64_conversion, __pyx_k_Passed_ndarray_dt64_conversion, sizeof(__pyx_k_Passed_ndarray_dt64_conversion), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_ndarray_dt64_type_check, __pyx_k_Passed_ndarray_dt64_type_check, sizeof(__pyx_k_Passed_ndarray_dt64_type_check), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_ndarray_td64_conversion, __pyx_k_Passed_ndarray_td64_conversion, sizeof(__pyx_k_Passed_ndarray_td64_conversion), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_ndarray_td64_type_check, __pyx_k_Passed_ndarray_td64_type_check, sizeof(__pyx_k_Passed_ndarray_td64_type_check), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_ndarray_type_check, __pyx_k_Passed_ndarray_type_check, sizeof(__pyx_k_Passed_ndarray_type_check), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_numpy_share, __pyx_k_Passed_numpy_share, sizeof(__pyx_k_Passed_numpy_share), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_parser, __pyx_k_Passed_parser, sizeof(__pyx_k_Passed_parser), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_quarter_of_month, __pyx_k_Passed_quarter_of_month, sizeof(__pyx_k_Passed_quarter_of_month), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_time_conversion, __pyx_k_Passed_time_conversion, sizeof(__pyx_k_Passed_time_conversion), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_time_generate, __pyx_k_Passed_time_generate, sizeof(__pyx_k_Passed_time_generate), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_time_type_check, __pyx_k_Passed_time_type_check, sizeof(__pyx_k_Passed_time_type_check), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_time_tzinfo, __pyx_k_Passed_time_tzinfo, sizeof(__pyx_k_Passed_time_tzinfo), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_timedelta64_conversion, __pyx_k_Passed_timedelta64_conversion, sizeof(__pyx_k_Passed_timedelta64_conversion), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_timedelta64_type_check, __pyx_k_Passed_timedelta64_type_check, sizeof(__pyx_k_Passed_timedelta64_type_check), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_timedelta_conversion, __pyx_k_Passed_timedelta_conversion, sizeof(__pyx_k_Passed_timedelta_conversion), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_timedelta_generate, __pyx_k_Passed_timedelta_generate, sizeof(__pyx_k_Passed_timedelta_generate), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_timedelta_type_chech, __pyx_k_Passed_timedelta_type_chech, sizeof(__pyx_k_Passed_timedelta_type_chech), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_tzinfo_access, __pyx_k_Passed_tzinfo_access, sizeof(__pyx_k_Passed_tzinfo_access), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_tzinfo_generate, __pyx_k_Passed_tzinfo_generate, sizeof(__pyx_k_Passed_tzinfo_generate), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_tzinfo_type_check, __pyx_k_Passed_tzinfo_type_check, sizeof(__pyx_k_Passed_tzinfo_type_check), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_weekday, __pyx_k_Passed_weekday, sizeof(__pyx_k_Passed_weekday), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_ymd_fr_isocalendar, __pyx_k_Passed_ymd_fr_isocalendar, sizeof(__pyx_k_Passed_ymd_fr_isocalendar), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_ymd_fr_ordinal, __pyx_k_Passed_ymd_fr_ordinal, sizeof(__pyx_k_Passed_ymd_fr_ordinal), 0, 1, 0, 0},
    {&__pyx_kp_u_Passed_ymd_to_ordinal, __pyx_k_Passed_ymd_to_ordinal, sizeof(__pyx_k_Passed_ymd_to_ordinal), 0, 1, 0, 0},
    {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
    {&__pyx_n_s_SS_DAY, __pyx_k_SS_DAY, sizeof(__pyx_k_SS_DAY), 0, 0, 1, 1},
    {&__pyx_n_s_SS_HOUR, __pyx_k_SS_HOUR, sizeof(__pyx_k_SS_HOUR), 0, 0, 1, 1},
    {&__pyx_n_s_SS_MINUTE, __pyx_k_SS_MINUTE, sizeof(__pyx_k_SS_MINUTE), 0, 0, 1, 1},
    {&__pyx_n_u_Sat, __pyx_k_Sat, sizeof(__pyx_k_Sat), 0, 1, 0, 1},
    {&__pyx_n_u_Sep, __pyx_k_Sep, sizeof(__pyx_k_Sep), 0, 1, 0, 1},
    {&__pyx_n_u_Sun, __pyx_k_Sun, sizeof(__pyx_k_Sun), 0, 1, 0, 1},
    {&__pyx_n_u_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 1, 0, 1},
    {&__pyx_n_s_TD64_MM_DAY, __pyx_k_TD64_MM_DAY, sizeof(__pyx_k_TD64_MM_DAY), 0, 0, 1, 1},
    {&__pyx_n_s_TD64_MM_MICROSECOND, __pyx_k_TD64_MM_MICROSECOND, sizeof(__pyx_k_TD64_MM_MICROSECOND), 0, 0, 1, 1},
    {&__pyx_n_s_TD64_MM_MILLISECOND, __pyx_k_TD64_MM_MILLISECOND, sizeof(__pyx_k_TD64_MM_MILLISECOND), 0, 0, 1, 1},
    {&__pyx_n_s_TD64_MM_NANOSECOND, __pyx_k_TD64_MM_NANOSECOND, sizeof(__pyx_k_TD64_MM_NANOSECOND), 0, 0, 1, 1},
    {&__pyx_n_s_TD64_MM_SECOND, __pyx_k_TD64_MM_SECOND, sizeof(__pyx_k_TD64_MM_SECOND), 0, 0, 1, 1},
    {&__pyx_n_s_TD64_YY_DAY, __pyx_k_TD64_YY_DAY, sizeof(__pyx_k_TD64_YY_DAY), 0, 0, 1, 1},
    {&__pyx_n_s_TD64_YY_MICROSECOND, __pyx_k_TD64_YY_MICROSECOND, sizeof(__pyx_k_TD64_YY_MICROSECOND), 0, 0, 1, 1},
    {&__pyx_n_s_TD64_YY_MILLISECOND, __pyx_k_TD64_YY_MILLISECOND, sizeof(__pyx_k_TD64_YY_MILLISECOND), 0, 0, 1, 1},
    {&__pyx_n_s_TD64_YY_NANOSECOND, __pyx_k_TD64_YY_NANOSECOND, sizeof(__pyx_k_TD64_YY_NANOSECOND), 0, 0, 1, 1},
    {&__pyx_n_s_TD64_YY_SECOND, __pyx_k_TD64_YY_SECOND, sizeof(__pyx_k_TD64_YY_SECOND), 0, 0, 1, 1},
    {&__pyx_n_s_TIMEZONE_MAP, __pyx_k_TIMEZONE_MAP, sizeof(__pyx_k_TIMEZONE_MAP), 0, 0, 1, 1},
    {&__pyx_n_u_Thu, __pyx_k_Thu, sizeof(__pyx_k_Thu), 0, 1, 0, 1},
    {&__pyx_kp_u_Time_zones_are_not_available_fro, __pyx_k_Time_zones_are_not_available_fro, sizeof(__pyx_k_Time_zones_are_not_available_fro), 0, 1, 0, 0},
    {&__pyx_n_s_Timestamp, __pyx_k_Timestamp, sizeof(__pyx_k_Timestamp), 0, 0, 1, 1},
    {&__pyx_n_u_True, __pyx_k_True, sizeof(__pyx_k_True), 0, 1, 0, 1},
    {&__pyx_n_u_Tue, __pyx_k_Tue, sizeof(__pyx_k_Tue), 0, 1, 0, 1},
    {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
    {&__pyx_n_s_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_US_MILLISECOND, __pyx_k_US_MILLISECOND, sizeof(__pyx_k_US_MILLISECOND), 0, 0, 1, 1},
    {&__pyx_n_s_US_MINUTE, __pyx_k_US_MINUTE, sizeof(__pyx_k_US_MINUTE), 0, 0, 1, 1},
    {&__pyx_n_s_US_SECOND, __pyx_k_US_SECOND, sizeof(__pyx_k_US_SECOND), 0, 0, 1, 1},
    {&__pyx_n_s_UTC, __pyx_k_UTC, sizeof(__pyx_k_UTC), 0, 0, 1, 1},
    {&__pyx_n_u_UTC, __pyx_k_UTC, sizeof(__pyx_k_UTC), 0, 1, 0, 1},
    {&__pyx_n_u_Universal, __pyx_k_Universal, sizeof(__pyx_k_Universal), 0, 1, 0, 1},
    {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
    {&__pyx_n_u_W, __pyx_k_W, sizeof(__pyx_k_W), 0, 1, 0, 1},
    {&__pyx_n_u_Wed, __pyx_k_Wed, sizeof(__pyx_k_Wed), 0, 1, 0, 1},
    {&__pyx_n_u_Y, __pyx_k_Y, sizeof(__pyx_k_Y), 0, 1, 0, 1},
    {&__pyx_n_s_ZeroDivisionError, __pyx_k_ZeroDivisionError, sizeof(__pyx_k_ZeroDivisionError), 0, 0, 1, 1},
    {&__pyx_n_s_ZoneInfo, __pyx_k_ZoneInfo, sizeof(__pyx_k_ZoneInfo), 0, 0, 1, 1},
    {&__pyx_n_u_Zulu, __pyx_k_Zulu, sizeof(__pyx_k_Zulu), 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_kp_u__117, __pyx_k__117, sizeof(__pyx_k__117), 0, 1, 0, 0},
    {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0},
    {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0},
    {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0},
    {&__pyx_kp_u__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 1, 0, 0},
    {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0},
    {&__pyx_n_s__205, __pyx_k__205, sizeof(__pyx_k__205), 0, 0, 1, 1},
    {&__pyx_kp_u__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 1, 0, 0},
    {&__pyx_n_s__37, __pyx_k__37, sizeof(__pyx_k__37), 0, 0, 1, 1},
    {&__pyx_kp_u__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 1, 0, 0},
    {&__pyx_kp_u__40, __pyx_k__40, sizeof(__pyx_k__40), 0, 1, 0, 0},
    {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0},
    {&__pyx_n_u_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 1, 0, 1},
    {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
    {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1},
    {&__pyx_n_s_arr_i, __pyx_k_arr_i, sizeof(__pyx_k_arr_i), 0, 0, 1, 1},
    {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
    {&__pyx_kp_u_array_size_must_be_greater_than, __pyx_k_array_size_must_be_greater_than, sizeof(__pyx_k_array_size_must_be_greater_than), 0, 1, 0, 0},
    {&__pyx_n_u_as, __pyx_k_as, sizeof(__pyx_k_as), 0, 1, 0, 1},
    {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
    {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
    {&__pyx_n_s_available_timezones, __pyx_k_available_timezones, sizeof(__pyx_k_available_timezones), 0, 0, 1, 1},
    {&__pyx_n_s_babel_dates, __pyx_k_babel_dates, sizeof(__pyx_k_babel_dates), 0, 0, 1, 1},
    {&__pyx_kp_u_cannot_access_the_time_value_fro, __pyx_k_cannot_access_the_time_value_fro, sizeof(__pyx_k_cannot_access_the_time_value_fro), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_cast, __pyx_k_cannot_cast, sizeof(__pyx_k_cannot_cast), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_cast_ndarray, __pyx_k_cannot_cast_ndarray, sizeof(__pyx_k_cannot_cast_ndarray), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_cast_ndarray_2, __pyx_k_cannot_cast_ndarray_2, sizeof(__pyx_k_cannot_cast_ndarray_2), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_ceil_to_multiple_0, __pyx_k_cannot_ceil_to_multiple_0, sizeof(__pyx_k_cannot_ceil_to_multiple_0), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_check_if_ndarray_s_is_wit, __pyx_k_cannot_check_if_ndarray_s_is_wit, sizeof(__pyx_k_cannot_check_if_ndarray_s_is_wit), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_check_ndarray, __pyx_k_cannot_check_ndarray, sizeof(__pyx_k_cannot_check_ndarray), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_compare_ndarrays_with_dif, __pyx_k_cannot_compare_ndarrays_with_dif, sizeof(__pyx_k_cannot_compare_ndarrays_with_dif), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_convert_ndarray, __pyx_k_cannot_convert_ndarray, sizeof(__pyx_k_cannot_convert_ndarray), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_convert_ndarray_from_date, __pyx_k_cannot_convert_ndarray_from_date, sizeof(__pyx_k_cannot_convert_ndarray_from_date), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_floor_to_multiple_0, __pyx_k_cannot_floor_to_multiple_0, sizeof(__pyx_k_cannot_floor_to_multiple_0), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_perform_addition_on_ndarr, __pyx_k_cannot_perform_addition_on_ndarr, sizeof(__pyx_k_cannot_perform_addition_on_ndarr), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_perform_comparison_on_nda, __pyx_k_cannot_perform_comparison_on_nda, sizeof(__pyx_k_cannot_perform_comparison_on_nda), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_perform_subtraction_on_nd, __pyx_k_cannot_perform_subtraction_on_nd, sizeof(__pyx_k_cannot_perform_subtraction_on_nd), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_round_to_multiple_0, __pyx_k_cannot_round_to_multiple_0, sizeof(__pyx_k_cannot_round_to_multiple_0), 0, 1, 0, 0},
    {&__pyx_n_u_ceil, __pyx_k_ceil, sizeof(__pyx_k_ceil), 0, 1, 0, 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_cmp, __pyx_k_cmp, sizeof(__pyx_k_cmp), 0, 0, 1, 1},
    {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
    {&__pyx_n_s_cytimes, __pyx_k_cytimes, sizeof(__pyx_k_cytimes), 0, 0, 1, 1},
    {&__pyx_n_s_cytimes_utils, __pyx_k_cytimes_utils, sizeof(__pyx_k_cytimes_utils), 0, 0, 1, 1},
    {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
    {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1},
    {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1},
    {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
    {&__pyx_n_s_datetime64, __pyx_k_datetime64, sizeof(__pyx_k_datetime64), 0, 0, 1, 1},
    {&__pyx_n_u_datetime64, __pyx_k_datetime64, sizeof(__pyx_k_datetime64), 0, 1, 0, 1},
    {&__pyx_kp_u_datetime64_2, __pyx_k_datetime64_2, sizeof(__pyx_k_datetime64_2), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_D, __pyx_k_datetime64_D, sizeof(__pyx_k_datetime64_D), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_M, __pyx_k_datetime64_M, sizeof(__pyx_k_datetime64_M), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_W, __pyx_k_datetime64_W, sizeof(__pyx_k_datetime64_W), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_Y, __pyx_k_datetime64_Y, sizeof(__pyx_k_datetime64_Y), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_h, __pyx_k_datetime64_h, sizeof(__pyx_k_datetime64_h), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_m, __pyx_k_datetime64_m, sizeof(__pyx_k_datetime64_m), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_ms, __pyx_k_datetime64_ms, sizeof(__pyx_k_datetime64_ms), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_ns, __pyx_k_datetime64_ns, sizeof(__pyx_k_datetime64_ns), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_s, __pyx_k_datetime64_s, sizeof(__pyx_k_datetime64_s), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_s_2, __pyx_k_datetime64_s_2, sizeof(__pyx_k_datetime64_s_2), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_us, __pyx_k_datetime64_us, sizeof(__pyx_k_datetime64_us), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime_s_is_ambiguous, __pyx_k_datetime_s_is_ambiguous, sizeof(__pyx_k_datetime_s_is_ambiguous), 0, 1, 0, 0},
    {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1},
    {&__pyx_n_s_days_before_month, __pyx_k_days_before_month, sizeof(__pyx_k_days_before_month), 0, 0, 1, 1},
    {&__pyx_n_s_days_before_year, __pyx_k_days_before_year, sizeof(__pyx_k_days_before_year), 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_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
    {&__pyx_kp_u_division_by_zero_for_utils_arr_c, __pyx_k_division_by_zero_for_utils_arr_c, sizeof(__pyx_k_division_by_zero_for_utils_arr_c), 0, 1, 0, 0},
    {&__pyx_kp_u_division_by_zero_for_utils_arr_f, __pyx_k_division_by_zero_for_utils_arr_f, sizeof(__pyx_k_division_by_zero_for_utils_arr_f), 0, 1, 0, 0},
    {&__pyx_kp_u_division_by_zero_for_utils_arr_r, __pyx_k_division_by_zero_for_utils_arr_r, sizeof(__pyx_k_division_by_zero_for_utils_arr_r), 0, 1, 0, 0},
    {&__pyx_kp_u_division_by_zero_for_utils_math, __pyx_k_division_by_zero_for_utils_math, sizeof(__pyx_k_division_by_zero_for_utils_math), 0, 1, 0, 0},
    {&__pyx_kp_u_division_by_zero_for_utils_math_2, __pyx_k_division_by_zero_for_utils_math_2, sizeof(__pyx_k_division_by_zero_for_utils_math_2), 0, 1, 0, 0},
    {&__pyx_kp_u_division_by_zero_for_utils_math_3, __pyx_k_division_by_zero_for_utils_math_3, sizeof(__pyx_k_division_by_zero_for_utils_math_3), 0, 1, 0, 0},
    {&__pyx_kp_u_division_by_zero_for_utils_math_4, __pyx_k_division_by_zero_for_utils_math_4, sizeof(__pyx_k_division_by_zero_for_utils_math_4), 0, 1, 0, 0},
    {&__pyx_kp_u_division_by_zero_in_arr_mod, __pyx_k_division_by_zero_in_arr_mod, sizeof(__pyx_k_division_by_zero_in_arr_mod), 0, 1, 0, 0},
    {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
    {&__pyx_n_s_dst, __pyx_k_dst, sizeof(__pyx_k_dst), 0, 0, 1, 1},
    {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1},
    {&__pyx_n_s_dt2, __pyx_k_dt2, sizeof(__pyx_k_dt2), 0, 0, 1, 1},
    {&__pyx_n_s_dt64, __pyx_k_dt64, sizeof(__pyx_k_dt64), 0, 0, 1, 1},
    {&__pyx_n_s_dt_2, __pyx_k_dt_2, sizeof(__pyx_k_dt_2), 0, 0, 1, 1},
    {&__pyx_n_s_dt_c, __pyx_k_dt_c, sizeof(__pyx_k_dt_c), 0, 0, 1, 1},
    {&__pyx_n_s_dt_n, __pyx_k_dt_n, sizeof(__pyx_k_dt_n), 0, 0, 1, 1},
    {&__pyx_n_s_dt_str, __pyx_k_dt_str, sizeof(__pyx_k_dt_str), 0, 0, 1, 1},
    {&__pyx_n_s_dt_tz1, __pyx_k_dt_tz1, sizeof(__pyx_k_dt_tz1), 0, 0, 1, 1},
    {&__pyx_n_s_dt_tz2, __pyx_k_dt_tz2, sizeof(__pyx_k_dt_tz2), 0, 0, 1, 1},
    {&__pyx_n_s_dt_tz3, __pyx_k_dt_tz3, sizeof(__pyx_k_dt_tz3), 0, 0, 1, 1},
    {&__pyx_n_s_dt_tz4, __pyx_k_dt_tz4, sizeof(__pyx_k_dt_tz4), 0, 0, 1, 1},
    {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
    {&__pyx_n_s_equal, __pyx_k_equal, sizeof(__pyx_k_equal), 0, 0, 1, 1},
    {&__pyx_n_s_errors, __pyx_k_errors, sizeof(__pyx_k_errors), 0, 0, 1, 1},
    {&__pyx_kp_u_expects_datetime_tzinfo_got_s, __pyx_k_expects_datetime_tzinfo_got_s, sizeof(__pyx_k_expects_datetime_tzinfo_got_s), 0, 1, 0, 0},
    {&__pyx_kp_u_expects_np_datetime64_got_s, __pyx_k_expects_np_datetime64_got_s, sizeof(__pyx_k_expects_np_datetime64_got_s), 0, 1, 0, 0},
    {&__pyx_kp_u_expects_np_ndarray_datetime64_go, __pyx_k_expects_np_ndarray_datetime64_go, sizeof(__pyx_k_expects_np_ndarray_datetime64_go), 0, 1, 0, 0},
    {&__pyx_kp_u_expects_np_ndarray_datetime64_ti, __pyx_k_expects_np_ndarray_datetime64_ti, sizeof(__pyx_k_expects_np_ndarray_datetime64_ti), 0, 1, 0, 0},
    {&__pyx_kp_u_expects_np_ndarray_datetime64_ti_2, __pyx_k_expects_np_ndarray_datetime64_ti_2, sizeof(__pyx_k_expects_np_ndarray_datetime64_ti_2), 0, 1, 0, 0},
    {&__pyx_kp_u_expects_np_ndarray_timedelta64_g, __pyx_k_expects_np_ndarray_timedelta64_g, sizeof(__pyx_k_expects_np_ndarray_timedelta64_g), 0, 1, 0, 0},
    {&__pyx_kp_u_expects_np_timedelta64_got_s, __pyx_k_expects_np_timedelta64_got_s, sizeof(__pyx_k_expects_np_timedelta64_got_s), 0, 1, 0, 0},
    {&__pyx_kp_u_failed_to_allocate_memory_for_st, __pyx_k_failed_to_allocate_memory_for_st, sizeof(__pyx_k_failed_to_allocate_memory_for_st), 0, 1, 0, 0},
    {&__pyx_n_u_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 0, 1, 0, 1},
    {&__pyx_n_s_fold, __pyx_k_fold, sizeof(__pyx_k_fold), 0, 0, 1, 1},
    {&__pyx_n_s_fromtimestamp, __pyx_k_fromtimestamp, sizeof(__pyx_k_fromtimestamp), 0, 0, 1, 1},
    {&__pyx_n_s_fromutc, __pyx_k_fromutc, sizeof(__pyx_k_fromutc), 0, 0, 1, 1},
    {&__pyx_n_u_fs, __pyx_k_fs, sizeof(__pyx_k_fs), 0, 1, 0, 1},
    {&__pyx_n_s_gmtime, __pyx_k_gmtime, sizeof(__pyx_k_gmtime), 0, 0, 1, 1},
    {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 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_hours, __pyx_k_hours, sizeof(__pyx_k_hours), 0, 0, 1, 1},
    {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
    {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
    {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1},
    {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
    {&__pyx_n_u_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 1, 0, 1},
    {&__pyx_kp_u_int64_under_D_resolution, __pyx_k_int64_under_D_resolution, sizeof(__pyx_k_int64_under_D_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_int64_under_M_resolution, __pyx_k_int64_under_M_resolution, sizeof(__pyx_k_int64_under_M_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_int64_under_Y_resolution, __pyx_k_int64_under_Y_resolution, sizeof(__pyx_k_int64_under_Y_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_int64_under_h_resolution, __pyx_k_int64_under_h_resolution, sizeof(__pyx_k_int64_under_h_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_int64_under_m_resolution, __pyx_k_int64_under_m_resolution, sizeof(__pyx_k_int64_under_m_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_int64_under_ms_resolution, __pyx_k_int64_under_ms_resolution, sizeof(__pyx_k_int64_under_ms_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_int64_under_ns_resolution, __pyx_k_int64_under_ns_resolution, sizeof(__pyx_k_int64_under_ns_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_int64_under_s_resolution, __pyx_k_int64_under_s_resolution, sizeof(__pyx_k_int64_under_s_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_int64_under_us_resolution, __pyx_k_int64_under_us_resolution, sizeof(__pyx_k_int64_under_us_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_character_s_as_an_intege, __pyx_k_invalid_character_s_as_an_intege, sizeof(__pyx_k_invalid_character_s_as_an_intege), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_timezone, __pyx_k_invalid_timezone, sizeof(__pyx_k_invalid_timezone), 0, 1, 0, 0},
    {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
    {&__pyx_n_s_is_leap, __pyx_k_is_leap, sizeof(__pyx_k_is_leap), 0, 0, 1, 1},
    {&__pyx_kp_u_is_not_supported, __pyx_k_is_not_supported, sizeof(__pyx_k_is_not_supported), 0, 1, 0, 0},
    {&__pyx_kp_u_is_not_supported_2, __pyx_k_is_not_supported_2, sizeof(__pyx_k_is_not_supported_2), 0, 1, 0, 0},
    {&__pyx_kp_u_is_not_supported_3, __pyx_k_is_not_supported_3, sizeof(__pyx_k_is_not_supported_3), 0, 1, 0, 0},
    {&__pyx_n_s_iso_calr, __pyx_k_iso_calr, sizeof(__pyx_k_iso_calr), 0, 0, 1, 1},
    {&__pyx_n_s_iso_week, __pyx_k_iso_week, sizeof(__pyx_k_iso_week), 0, 0, 1, 1},
    {&__pyx_n_s_iso_year, __pyx_k_iso_year, sizeof(__pyx_k_iso_year), 0, 0, 1, 1},
    {&__pyx_n_s_isocalendar, __pyx_k_isocalendar, sizeof(__pyx_k_isocalendar), 0, 0, 1, 1},
    {&__pyx_n_s_isoweek1monday, __pyx_k_isoweek1monday, sizeof(__pyx_k_isoweek1monday), 0, 0, 1, 1},
    {&__pyx_n_s_isoweek_to_gregorian, __pyx_k_isoweek_to_gregorian, sizeof(__pyx_k_isoweek_to_gregorian), 0, 0, 1, 1},
    {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
    {&__pyx_n_u_local, __pyx_k_local, sizeof(__pyx_k_local), 0, 1, 0, 1},
    {&__pyx_n_u_localize, __pyx_k_localize, sizeof(__pyx_k_localize), 0, 1, 0, 1},
    {&__pyx_n_s_localtime, __pyx_k_localtime, sizeof(__pyx_k_localtime), 0, 0, 1, 1},
    {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
    {&__pyx_n_u_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 1, 0, 1},
    {&__pyx_kp_u_m_d_Y, __pyx_k_m_d_Y, sizeof(__pyx_k_m_d_Y), 0, 1, 0, 0},
    {&__pyx_kp_u_m_d_Y_f_S_M_H, __pyx_k_m_d_Y_f_S_M_H, sizeof(__pyx_k_m_d_Y_f_S_M_H), 0, 1, 0, 0},
    {&__pyx_kp_u_m_d_Y_f_S_M_H_Z, __pyx_k_m_d_Y_f_S_M_H_Z, sizeof(__pyx_k_m_d_Y_f_S_M_H_Z), 0, 1, 0, 0},
    {&__pyx_kp_u_m_d_Y_f_S_M_H_z, __pyx_k_m_d_Y_f_S_M_H_z, sizeof(__pyx_k_m_d_Y_f_S_M_H_z), 0, 1, 0, 0},
    {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
    {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
    {&__pyx_n_s_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1},
    {&__pyx_n_s_microseconds, __pyx_k_microseconds, sizeof(__pyx_k_microseconds), 0, 0, 1, 1},
    {&__pyx_n_s_milliseconds, __pyx_k_milliseconds, sizeof(__pyx_k_milliseconds), 0, 0, 1, 1},
    {&__pyx_n_u_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 1, 0, 1},
    {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1},
    {&__pyx_n_s_minutes, __pyx_k_minutes, sizeof(__pyx_k_minutes), 0, 0, 1, 1},
    {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
    {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1},
    {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1},
    {&__pyx_n_u_ms, __pyx_k_ms, sizeof(__pyx_k_ms), 0, 1, 0, 1},
    {&__pyx_n_s_my_unit, __pyx_k_my_unit, sizeof(__pyx_k_my_unit), 0, 0, 1, 1},
    {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
    {&__pyx_kp_u_nanosecond_conversion_range_dat, __pyx_k_nanosecond_conversion_range_dat, sizeof(__pyx_k_nanosecond_conversion_range_dat), 0, 1, 0, 0},
    {&__pyx_kp_u_ndarray_size_must_be_an_integer, __pyx_k_ndarray_size_must_be_an_integer, sizeof(__pyx_k_ndarray_size_must_be_an_integer), 0, 1, 0, 0},
    {&__pyx_n_s_now, __pyx_k_now, sizeof(__pyx_k_now), 0, 0, 1, 1},
    {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
    {&__pyx_n_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_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
    {&__pyx_kp_u_operation_on_ndarray_datetime64, __pyx_k_operation_on_ndarray_datetime64, sizeof(__pyx_k_operation_on_ndarray_datetime64), 0, 1, 0, 0},
    {&__pyx_n_s_ord2ymd, __pyx_k_ord2ymd, sizeof(__pyx_k_ord2ymd), 0, 0, 1, 1},
    {&__pyx_n_s_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 1, 1},
    {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
    {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
    {&__pyx_n_u_ps, __pyx_k_ps, sizeof(__pyx_k_ps), 0, 1, 0, 1},
    {&__pyx_n_s_pydatetime, __pyx_k_pydatetime, sizeof(__pyx_k_pydatetime), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1},
    {&__pyx_n_s_qtr, __pyx_k_qtr, sizeof(__pyx_k_qtr), 0, 0, 1, 1},
    {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
    {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
    {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
    {&__pyx_kp_u_resolution, __pyx_k_resolution, sizeof(__pyx_k_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_resolution_Array_with_datetime, __pyx_k_resolution_Array_with_datetime, sizeof(__pyx_k_resolution_Array_with_datetime), 0, 1, 0, 0},
    {&__pyx_kp_u_resolution_Array_with_dtype_of, __pyx_k_resolution_Array_with_dtype_of, sizeof(__pyx_k_resolution_Array_with_dtype_of), 0, 1, 0, 0},
    {&__pyx_kp_u_resolution_Supported_resolution, __pyx_k_resolution_Supported_resolution, sizeof(__pyx_k_resolution_Supported_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_resolution_is_not_supported, __pyx_k_resolution_is_not_supported, sizeof(__pyx_k_resolution_is_not_supported), 0, 1, 0, 0},
    {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1},
    {&__pyx_n_u_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 1, 0, 1},
    {&__pyx_n_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 1},
    {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1},
    {&__pyx_n_s_secs, __pyx_k_secs, sizeof(__pyx_k_secs), 0, 0, 1, 1},
    {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1},
    {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
    {&__pyx_kp_s_src_cytimes_utils_py, __pyx_k_src_cytimes_utils_py, sizeof(__pyx_k_src_cytimes_utils_py), 0, 0, 1, 0},
    {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
    {&__pyx_kp_u_strftime_format_is_too_long_s, __pyx_k_strftime_format_is_too_long_s, sizeof(__pyx_k_strftime_format_is_too_long_s), 0, 1, 0, 0},
    {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
    {&__pyx_kp_u_support_ndarray_with_1_4_dimensi, __pyx_k_support_ndarray_with_1_4_dimensi, sizeof(__pyx_k_support_ndarray_with_1_4_dimensi), 0, 1, 0, 0},
    {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
    {&__pyx_n_s_t1, __pyx_k_t1, sizeof(__pyx_k_t1), 0, 0, 1, 1},
    {&__pyx_n_s_t_c, __pyx_k_t_c, sizeof(__pyx_k_t_c), 0, 0, 1, 1},
    {&__pyx_n_s_t_n, __pyx_k_t_n, sizeof(__pyx_k_t_n), 0, 0, 1, 1},
    {&__pyx_n_s_t_tz1, __pyx_k_t_tz1, sizeof(__pyx_k_t_tz1), 0, 0, 1, 1},
    {&__pyx_n_s_td, __pyx_k_td, sizeof(__pyx_k_td), 0, 0, 1, 1},
    {&__pyx_n_s_td1, __pyx_k_td1, sizeof(__pyx_k_td1), 0, 0, 1, 1},
    {&__pyx_n_s_td2, __pyx_k_td2, sizeof(__pyx_k_td2), 0, 0, 1, 1},
    {&__pyx_n_s_td3, __pyx_k_td3, sizeof(__pyx_k_td3), 0, 0, 1, 1},
    {&__pyx_n_s_td4, __pyx_k_td4, sizeof(__pyx_k_td4), 0, 0, 1, 1},
    {&__pyx_n_s_td5, __pyx_k_td5, sizeof(__pyx_k_td5), 0, 0, 1, 1},
    {&__pyx_n_s_td6, __pyx_k_td6, sizeof(__pyx_k_td6), 0, 0, 1, 1},
    {&__pyx_n_s_td64, __pyx_k_td64, sizeof(__pyx_k_td64), 0, 0, 1, 1},
    {&__pyx_n_s_td7, __pyx_k_td7, sizeof(__pyx_k_td7), 0, 0, 1, 1},
    {&__pyx_n_s_td8, __pyx_k_td8, sizeof(__pyx_k_td8), 0, 0, 1, 1},
    {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
    {&__pyx_n_s_test_date_conversion, __pyx_k_test_date_conversion, sizeof(__pyx_k_test_date_conversion), 0, 0, 1, 1},
    {&__pyx_n_s_test_date_conversion_locals_Cus, __pyx_k_test_date_conversion_locals_Cus, sizeof(__pyx_k_test_date_conversion_locals_Cus), 0, 0, 1, 1},
    {&__pyx_n_s_test_date_generate, __pyx_k_test_date_generate, sizeof(__pyx_k_test_date_generate), 0, 0, 1, 1},
    {&__pyx_n_s_test_date_type_check, __pyx_k_test_date_type_check, sizeof(__pyx_k_test_date_type_check), 0, 0, 1, 1},
    {&__pyx_n_s_test_date_type_check_locals_Cus, __pyx_k_test_date_type_check_locals_Cus, sizeof(__pyx_k_test_date_type_check_locals_Cus), 0, 0, 1, 1},
    {&__pyx_n_s_test_datetime64_conversion, __pyx_k_test_datetime64_conversion, sizeof(__pyx_k_test_datetime64_conversion), 0, 0, 1, 1},
    {&__pyx_n_s_test_datetime64_type_check, __pyx_k_test_datetime64_type_check, sizeof(__pyx_k_test_datetime64_type_check), 0, 0, 1, 1},
    {&__pyx_n_s_test_days_bf_month, __pyx_k_test_days_bf_month, sizeof(__pyx_k_test_days_bf_month), 0, 0, 1, 1},
    {&__pyx_n_s_test_days_bf_year, __pyx_k_test_days_bf_year, sizeof(__pyx_k_test_days_bf_year), 0, 0, 1, 1},
    {&__pyx_n_s_test_days_in_month, __pyx_k_test_days_in_month, sizeof(__pyx_k_test_days_in_month), 0, 0, 1, 1},
    {&__pyx_n_s_test_days_in_quarter, __pyx_k_test_days_in_quarter, sizeof(__pyx_k_test_days_in_quarter), 0, 0, 1, 1},
    {&__pyx_n_s_test_dt_arithmetic, __pyx_k_test_dt_arithmetic, sizeof(__pyx_k_test_dt_arithmetic), 0, 0, 1, 1},
    {&__pyx_n_s_test_dt_conversion, __pyx_k_test_dt_conversion, sizeof(__pyx_k_test_dt_conversion), 0, 0, 1, 1},
    {&__pyx_n_s_test_dt_generate, __pyx_k_test_dt_generate, sizeof(__pyx_k_test_dt_generate), 0, 0, 1, 1},
    {&__pyx_n_s_test_dt_mainipulate, __pyx_k_test_dt_mainipulate, sizeof(__pyx_k_test_dt_mainipulate), 0, 0, 1, 1},
    {&__pyx_n_s_test_dt_type_check, __pyx_k_test_dt_type_check, sizeof(__pyx_k_test_dt_type_check), 0, 0, 1, 1},
    {&__pyx_n_s_test_dt_type_check_locals_Custo, __pyx_k_test_dt_type_check_locals_Custo, sizeof(__pyx_k_test_dt_type_check_locals_Custo), 0, 0, 1, 1},
    {&__pyx_n_s_test_dt_tzinfo, __pyx_k_test_dt_tzinfo, sizeof(__pyx_k_test_dt_tzinfo), 0, 0, 1, 1},
    {&__pyx_n_s_test_is_leap_year, __pyx_k_test_is_leap_year, sizeof(__pyx_k_test_is_leap_year), 0, 0, 1, 1},
    {&__pyx_n_s_test_iso_1st_monday, __pyx_k_test_iso_1st_monday, sizeof(__pyx_k_test_iso_1st_monday), 0, 0, 1, 1},
    {&__pyx_n_s_test_isocalendar, __pyx_k_test_isocalendar, sizeof(__pyx_k_test_isocalendar), 0, 0, 1, 1},
    {&__pyx_n_s_test_localtime_n_gmtime, __pyx_k_test_localtime_n_gmtime, sizeof(__pyx_k_test_localtime_n_gmtime), 0, 0, 1, 1},
    {&__pyx_n_s_test_ndarray_dt64_conversion, __pyx_k_test_ndarray_dt64_conversion, sizeof(__pyx_k_test_ndarray_dt64_conversion), 0, 0, 1, 1},
    {&__pyx_n_s_test_ndarray_dt64_type_check, __pyx_k_test_ndarray_dt64_type_check, sizeof(__pyx_k_test_ndarray_dt64_type_check), 0, 0, 1, 1},
    {&__pyx_n_s_test_ndarray_td64_conversion, __pyx_k_test_ndarray_td64_conversion, sizeof(__pyx_k_test_ndarray_td64_conversion), 0, 0, 1, 1},
    {&__pyx_n_s_test_ndarray_td64_type_check, __pyx_k_test_ndarray_td64_type_check, sizeof(__pyx_k_test_ndarray_td64_type_check), 0, 0, 1, 1},
    {&__pyx_n_s_test_ndarray_type_check, __pyx_k_test_ndarray_type_check, sizeof(__pyx_k_test_ndarray_type_check), 0, 0, 1, 1},
    {&__pyx_n_s_test_numpy_share, __pyx_k_test_numpy_share, sizeof(__pyx_k_test_numpy_share), 0, 0, 1, 1},
    {&__pyx_n_s_test_parser, __pyx_k_test_parser, sizeof(__pyx_k_test_parser), 0, 0, 1, 1},
    {&__pyx_n_s_test_quarter_of_month, __pyx_k_test_quarter_of_month, sizeof(__pyx_k_test_quarter_of_month), 0, 0, 1, 1},
    {&__pyx_n_s_test_time_conversion, __pyx_k_test_time_conversion, sizeof(__pyx_k_test_time_conversion), 0, 0, 1, 1},
    {&__pyx_n_s_test_time_conversion_locals_Cus, __pyx_k_test_time_conversion_locals_Cus, sizeof(__pyx_k_test_time_conversion_locals_Cus), 0, 0, 1, 1},
    {&__pyx_n_s_test_time_generate, __pyx_k_test_time_generate, sizeof(__pyx_k_test_time_generate), 0, 0, 1, 1},
    {&__pyx_n_s_test_time_type_check, __pyx_k_test_time_type_check, sizeof(__pyx_k_test_time_type_check), 0, 0, 1, 1},
    {&__pyx_n_s_test_time_type_check_locals_Cus, __pyx_k_test_time_type_check_locals_Cus, sizeof(__pyx_k_test_time_type_check_locals_Cus), 0, 0, 1, 1},
    {&__pyx_n_s_test_time_tzinfo, __pyx_k_test_time_tzinfo, sizeof(__pyx_k_test_time_tzinfo), 0, 0, 1, 1},
    {&__pyx_n_s_test_timedelta64_conversion, __pyx_k_test_timedelta64_conversion, sizeof(__pyx_k_test_timedelta64_conversion), 0, 0, 1, 1},
    {&__pyx_n_s_test_timedelta64_type_check, __pyx_k_test_timedelta64_type_check, sizeof(__pyx_k_test_timedelta64_type_check), 0, 0, 1, 1},
    {&__pyx_n_s_test_timedelta_conversion, __pyx_k_test_timedelta_conversion, sizeof(__pyx_k_test_timedelta_conversion), 0, 0, 1, 1},
    {&__pyx_n_s_test_timedelta_conversion_local, __pyx_k_test_timedelta_conversion_local, sizeof(__pyx_k_test_timedelta_conversion_local), 0, 0, 1, 1},
    {&__pyx_n_s_test_timedelta_generate, __pyx_k_test_timedelta_generate, sizeof(__pyx_k_test_timedelta_generate), 0, 0, 1, 1},
    {&__pyx_n_s_test_timedelta_type_check, __pyx_k_test_timedelta_type_check, sizeof(__pyx_k_test_timedelta_type_check), 0, 0, 1, 1},
    {&__pyx_n_s_test_timedelta_type_check_local, __pyx_k_test_timedelta_type_check_local, sizeof(__pyx_k_test_timedelta_type_check_local), 0, 0, 1, 1},
    {&__pyx_n_s_test_tzinfo_access, __pyx_k_test_tzinfo_access, sizeof(__pyx_k_test_tzinfo_access), 0, 0, 1, 1},
    {&__pyx_n_s_test_tzinfo_generate, __pyx_k_test_tzinfo_generate, sizeof(__pyx_k_test_tzinfo_generate), 0, 0, 1, 1},
    {&__pyx_n_s_test_tzinfo_type_check, __pyx_k_test_tzinfo_type_check, sizeof(__pyx_k_test_tzinfo_type_check), 0, 0, 1, 1},
    {&__pyx_n_s_test_utils, __pyx_k_test_utils, sizeof(__pyx_k_test_utils), 0, 0, 1, 1},
    {&__pyx_n_s_test_weekday, __pyx_k_test_weekday, sizeof(__pyx_k_test_weekday), 0, 0, 1, 1},
    {&__pyx_n_s_test_ymd_fr_isocalendar, __pyx_k_test_ymd_fr_isocalendar, sizeof(__pyx_k_test_ymd_fr_isocalendar), 0, 0, 1, 1},
    {&__pyx_n_s_test_ymd_fr_ordinal, __pyx_k_test_ymd_fr_ordinal, sizeof(__pyx_k_test_ymd_fr_ordinal), 0, 0, 1, 1},
    {&__pyx_n_s_test_ymd_to_ordinal, __pyx_k_test_ymd_to_ordinal, sizeof(__pyx_k_test_ymd_to_ordinal), 0, 0, 1, 1},
    {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
    {&__pyx_n_s_time1, __pyx_k_time1, sizeof(__pyx_k_time1), 0, 0, 1, 1},
    {&__pyx_n_s_time2, __pyx_k_time2, sizeof(__pyx_k_time2), 0, 0, 1, 1},
    {&__pyx_n_s_time_tz1, __pyx_k_time_tz1, sizeof(__pyx_k_time_tz1), 0, 0, 1, 1},
    {&__pyx_n_s_time_tz2, __pyx_k_time_tz2, sizeof(__pyx_k_time_tz2), 0, 0, 1, 1},
    {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1},
    {&__pyx_n_s_timedelta64, __pyx_k_timedelta64, sizeof(__pyx_k_timedelta64), 0, 0, 1, 1},
    {&__pyx_n_u_timedelta64, __pyx_k_timedelta64, sizeof(__pyx_k_timedelta64), 0, 1, 0, 1},
    {&__pyx_kp_u_timedelta64_2, __pyx_k_timedelta64_2, sizeof(__pyx_k_timedelta64_2), 0, 1, 0, 0},
    {&__pyx_kp_u_timedelta64_ns, __pyx_k_timedelta64_ns, sizeof(__pyx_k_timedelta64_ns), 0, 1, 0, 0},
    {&__pyx_kp_u_timedelta64_s, __pyx_k_timedelta64_s, sizeof(__pyx_k_timedelta64_s), 0, 1, 0, 0},
    {&__pyx_kp_u_timedelta64_us, __pyx_k_timedelta64_us, sizeof(__pyx_k_timedelta64_us), 0, 1, 0, 0},
    {&__pyx_n_s_timestamp, __pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 0, 1, 1},
    {&__pyx_n_s_timetuple, __pyx_k_timetuple, sizeof(__pyx_k_timetuple), 0, 0, 1, 1},
    {&__pyx_n_s_timetz, __pyx_k_timetz, sizeof(__pyx_k_timetz), 0, 0, 1, 1},
    {&__pyx_n_s_timezone, __pyx_k_timezone, sizeof(__pyx_k_timezone), 0, 0, 1, 1},
    {&__pyx_kp_u_timezone_offset_s_seconds_out_of, __pyx_k_timezone_offset_s_seconds_out_of, sizeof(__pyx_k_timezone_offset_s_seconds_out_of), 0, 1, 0, 0},
    {&__pyx_n_s_tm, __pyx_k_tm, sizeof(__pyx_k_tm), 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_tmp, __pyx_k_tmp, sizeof(__pyx_k_tmp), 0, 0, 1, 1},
    {&__pyx_n_s_tmp1, __pyx_k_tmp1, sizeof(__pyx_k_tmp1), 0, 0, 1, 1},
    {&__pyx_n_s_tmp2, __pyx_k_tmp2, sizeof(__pyx_k_tmp2), 0, 0, 1, 1},
    {&__pyx_n_s_tmp3, __pyx_k_tmp3, sizeof(__pyx_k_tmp3), 0, 0, 1, 1},
    {&__pyx_kp_u_to, __pyx_k_to, sizeof(__pyx_k_to), 0, 1, 0, 0},
    {&__pyx_kp_u_to_2, __pyx_k_to_2, sizeof(__pyx_k_to_2), 0, 1, 0, 0},
    {&__pyx_kp_u_to_an_integer_under, __pyx_k_to_an_integer_under, sizeof(__pyx_k_to_an_integer_under), 0, 1, 0, 0},
    {&__pyx_kp_u_to_an_integer_under_2, __pyx_k_to_an_integer_under_2, sizeof(__pyx_k_to_an_integer_under_2), 0, 1, 0, 0},
    {&__pyx_kp_u_to_datetime64, __pyx_k_to_datetime64, sizeof(__pyx_k_to_datetime64), 0, 1, 0, 0},
    {&__pyx_kp_u_to_int64_under, __pyx_k_to_int64_under, sizeof(__pyx_k_to_int64_under), 0, 1, 0, 0},
    {&__pyx_kp_u_to_int64_under_2, __pyx_k_to_int64_under_2, sizeof(__pyx_k_to_int64_under_2), 0, 1, 0, 0},
    {&__pyx_kp_u_to_int64_under_3, __pyx_k_to_int64_under_3, sizeof(__pyx_k_to_int64_under_3), 0, 1, 0, 0},
    {&__pyx_n_s_to_unit, __pyx_k_to_unit, sizeof(__pyx_k_to_unit), 0, 0, 1, 1},
    {&__pyx_n_s_today, __pyx_k_today, sizeof(__pyx_k_today), 0, 0, 1, 1},
    {&__pyx_n_s_toordinal, __pyx_k_toordinal, sizeof(__pyx_k_toordinal), 0, 0, 1, 1},
    {&__pyx_n_s_total_seconds, __pyx_k_total_seconds, sizeof(__pyx_k_total_seconds), 0, 0, 1, 1},
    {&__pyx_n_s_ts, __pyx_k_ts, sizeof(__pyx_k_ts), 0, 0, 1, 1},
    {&__pyx_n_s_typeref, __pyx_k_typeref, sizeof(__pyx_k_typeref), 0, 0, 1, 1},
    {&__pyx_n_s_tz, __pyx_k_tz, sizeof(__pyx_k_tz), 0, 0, 1, 1},
    {&__pyx_n_s_tz1, __pyx_k_tz1, sizeof(__pyx_k_tz1), 0, 0, 1, 1},
    {&__pyx_n_s_tz2, __pyx_k_tz2, sizeof(__pyx_k_tz2), 0, 0, 1, 1},
    {&__pyx_n_s_tz3, __pyx_k_tz3, sizeof(__pyx_k_tz3), 0, 0, 1, 1},
    {&__pyx_n_s_tz4, __pyx_k_tz4, sizeof(__pyx_k_tz4), 0, 0, 1, 1},
    {&__pyx_n_s_tz_str, __pyx_k_tz_str, sizeof(__pyx_k_tz_str), 0, 0, 1, 1},
    {&__pyx_n_s_tzinfo, __pyx_k_tzinfo, sizeof(__pyx_k_tzinfo), 0, 0, 1, 1},
    {&__pyx_n_s_tzname, __pyx_k_tzname, sizeof(__pyx_k_tzname), 0, 0, 1, 1},
    {&__pyx_kp_u_unable_to_parse_datetime_unit_fr, __pyx_k_unable_to_parse_datetime_unit_fr, sizeof(__pyx_k_unable_to_parse_datetime_unit_fr), 0, 1, 0, 0},
    {&__pyx_n_s_unit, __pyx_k_unit, sizeof(__pyx_k_unit), 0, 0, 1, 1},
    {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 0, 0, 1, 1},
    {&__pyx_kp_u_unknown_datetime_unit_d, __pyx_k_unknown_datetime_unit_d, sizeof(__pyx_k_unknown_datetime_unit_d), 0, 1, 0, 0},
    {&__pyx_kp_u_unknown_datetime_unit_s, __pyx_k_unknown_datetime_unit_s, sizeof(__pyx_k_unknown_datetime_unit_s), 0, 1, 0, 0},
    {&__pyx_kp_u_unsupported_datetime_unit_s, __pyx_k_unsupported_datetime_unit_s, sizeof(__pyx_k_unsupported_datetime_unit_s), 0, 1, 0, 0},
    {&__pyx_kp_u_unsupported_factor_d_for_timedel, __pyx_k_unsupported_factor_d_for_timedel, sizeof(__pyx_k_unsupported_factor_d_for_timedel), 0, 1, 0, 0},
    {&__pyx_kp_u_unsupported_factor_d_for_timedel_2, __pyx_k_unsupported_factor_d_for_timedel_2, sizeof(__pyx_k_unsupported_factor_d_for_timedel_2), 0, 1, 0, 0},
    {&__pyx_n_s_us, __pyx_k_us, sizeof(__pyx_k_us), 0, 0, 1, 1},
    {&__pyx_n_u_us, __pyx_k_us, sizeof(__pyx_k_us), 0, 1, 0, 1},
    {&__pyx_n_s_utc, __pyx_k_utc, sizeof(__pyx_k_utc), 0, 0, 1, 1},
    {&__pyx_n_s_utcoffset, __pyx_k_utcoffset, sizeof(__pyx_k_utcoffset), 0, 0, 1, 1},
    {&__pyx_n_s_utctimetuple, __pyx_k_utctimetuple, sizeof(__pyx_k_utctimetuple), 0, 0, 1, 1},
    {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1},
    {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
    {&__pyx_n_s_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_kp_u_with_datetime_unit, __pyx_k_with_datetime_unit, sizeof(__pyx_k_with_datetime_unit), 0, 1, 0, 0},
    {&__pyx_kp_u_without_specifying_the_array_da, __pyx_k_without_specifying_the_array_da, sizeof(__pyx_k_without_specifying_the_array_da), 0, 1, 0, 0},
    {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
    {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1},
    {&__pyx_n_s_ymd2ord, __pyx_k_ymd2ord, sizeof(__pyx_k_ymd2ord), 0, 0, 1, 1},
    {&__pyx_n_s_zone, __pyx_k_zone, sizeof(__pyx_k_zone), 0, 0, 1, 1},
    {&__pyx_n_s_zoneinfo, __pyx_k_zoneinfo, sizeof(__pyx_k_zoneinfo), 0, 0, 1, 1},
    {0, 0, 0, 0, 0, 0, 0}
  };
  return __Pyx_InitStrings(__pyx_string_tab);
}
/* #### Code section: cached_builtins ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_ZeroDivisionError = __Pyx_GetBuiltinName(__pyx_n_s_ZeroDivisionError); if (!__pyx_builtin_ZeroDivisionError) __PYX_ERR(0, 145, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 304, __pyx_L1_error)
  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 646, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 655, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 738, __pyx_L1_error)
  __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(0, 754, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2357, __pyx_L1_error)
  __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 2730, __pyx_L1_error)
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(1, 311, __pyx_L1_error)
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1043, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1043
 *         __pyx_import_array()
 *     except Exception:
 *         raise ImportError("numpy._core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_numpy__core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(2, 1043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1049
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy._core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_numpy__core_umath_failed_to_impo); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(2, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "datetime.pxd":308
 * cdef inline object timezone_new(object offset, object name=None):
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')             # <<<<<<<<<<<<<<
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)
 * 
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Time_zones_are_not_available_fro); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(4, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "cytimes/utils.pxd":145
 *     """
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.math_mod()'.")             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_division_by_zero_for_utils_math); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "cytimes/utils.pxd":171
 *     """
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.math_round_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_division_by_zero_for_utils_math_2); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "cytimes/utils.pxd":198
 *     """
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.math_ceil_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     cdef long long q, r
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_division_by_zero_for_utils_math_3); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "cytimes/utils.pxd":222
 *     """
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.math_floor_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     cdef long long q, r
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_division_by_zero_for_utils_math_4); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "cytimes/utils.pxd":646
 *     cdef char* buffer = <char*> malloc(size + 1)
 *     if buffer == NULL:
 *         raise MemoryError("failed to allocate memory for string slice.")             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t i
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_failed_to_allocate_memory_for_st); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "cytimes/utils.pxd":2520
 *         if arr.shape[1] == 0:
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     if ndim == 3:
 *         if arr.shape[2] == 0:
 */
  __pyx_tuple__16 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 2520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "cytimes/utils.pxd":2524
 *         if arr.shape[2] == 0:
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     if ndim == 4:
 *         if arr.shape[3] == 0:
 */
  __pyx_tuple__17 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 2524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "cytimes/utils.pxd":2528
 *         if arr.shape[3] == 0:
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     # Invalid
 *     raise ValueError("support <'ndarray'> with 1-4 dimensions, got ndim '%d'." % ndim)
 */
  __pyx_tuple__18 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 2528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "cytimes/utils.pxd":2820
 *     # Validate
 *     if size < 1:
 *         raise ValueError("ndarray size must be an integer greater than 0.")             # <<<<<<<<<<<<<<
 * 
 *     # New array
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_ndarray_size_must_be_an_integer); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 2820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "cytimes/utils.pxd":2939
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot compare ndarrays with different shapes.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_cannot_compare_ndarrays_with_dif); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 2939, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "cytimes/utils.pxd":3112
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero in 'arr_mod()'.")             # <<<<<<<<<<<<<<
 * 
 *     # Prepare for computation
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_division_by_zero_in_arr_mod); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 3112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "cytimes/utils.pxd":3154
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.arr_round_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_division_by_zero_for_utils_arr_r); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 3154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "cytimes/utils.pxd":3198
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.arr_ceil_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_division_by_zero_for_utils_arr_c); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 3198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "cytimes/utils.pxd":3242
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.arr_floor_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_division_by_zero_for_utils_arr_f); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 3242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "cytimes/utils.pxd":3288
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot round to multiple 0.")             # <<<<<<<<<<<<<<
 *     if multiple == 0:
 *         multiple = factor
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_cannot_round_to_multiple_0); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 3288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "cytimes/utils.pxd":3336
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot ceil to multiple 0.")             # <<<<<<<<<<<<<<
 *     if multiple == 0:
 *         multiple = factor
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_cannot_ceil_to_multiple_0); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 3336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "cytimes/utils.pxd":3384
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot floor to multiple 0.")             # <<<<<<<<<<<<<<
 *     if multiple == 0:
 *         multiple = factor
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_cannot_floor_to_multiple_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 3384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "cytimes/utils.pxd":3424
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform addition on ndarrays with different shapes.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_u_cannot_perform_addition_on_ndarr); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 3424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "cytimes/utils.pxd":3452
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform subtraction on ndarrays with different shapes.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_u_cannot_perform_subtraction_on_nd); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 3452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "cytimes/utils.pxd":3550
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform comparison on ndarrays with different shapes.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_u_cannot_perform_comparison_on_nda); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 3550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "cytimes/utils.pxd":4184
 *     # Validate
 *     if size < 1:
 *         raise ValueError("array size must be greater than 0.")             # <<<<<<<<<<<<<<
 *     unit = map_nptime_unit_int2str(map_nptime_unit_str2int(unit))
 * 
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_u_array_size_must_be_greater_than); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 4184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "cytimes/utils.pxd":5690
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]
 *     if arr1_size <= 0 or arr2_size <= 0:
 *         raise ValueError("For comparision, array size must be > 0.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_u_For_comparision_array_size_must); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 5690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "cytimes/utils.py":135
 *     # UTC timezone aliases
 *     for tz in (
 *         "UTC",             # <<<<<<<<<<<<<<
 *         "Universal",
 *         "GMT",
 */
  __pyx_tuple__34 = PyTuple_Pack(8, __pyx_n_u_UTC, __pyx_n_u_Universal, __pyx_n_u_GMT, __pyx_kp_u_GMT_0, __pyx_kp_u_GMT_0_2, __pyx_n_u_GMT0, __pyx_n_u_Greenwich, __pyx_n_u_Zulu); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "cytimes/utils.py":311
 *     assert parse_isoyearday(t, 5, 0) == -1  # type: ignore
 * 
 *     print("Passed: parser")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_u_Passed_parser); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "cytimes/utils.py":343
 *     assert val.tm_isdst == cmp.tm_isdst, f"{val.tm_sec} != {cmp.tm_sec}"
 * 
 *     print("Passed: localtime & gmtime")             # <<<<<<<<<<<<<<
 * 
 *     del time
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_u_Passed_localtime_gmtime); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "cytimes/utils.py":356
 *         cmp = _is_leap(i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     print("Passed: is_leap_year")             # <<<<<<<<<<<<<<
 * 
 *     del _is_leap
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_u_Passed_is_leap_year); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "cytimes/utils.py":368
 *         cmp = _days_before_year(i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     print("Passed: days_bf_year")             # <<<<<<<<<<<<<<
 * 
 *     del _days_before_year
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_u_Passed_days_bf_year); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "cytimes/utils.py":384
 *             count = 0
 *             value += 1
 *     print("Passed: quarter_of_month")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_u_Passed_quarter_of_month); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "cytimes/utils.py":405
 *             cmp = DAYS_IN_QUARTER[qtr]
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     print("Passed: days_in_quarter")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_u_Passed_days_in_quarter); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "cytimes/utils.py":423
 *         cmp = _days_in_month(year, i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     print("Passed: days_in_month")             # <<<<<<<<<<<<<<
 * 
 *     del _days_in_month
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_u_Passed_days_in_month); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "cytimes/utils.py":443
 *         cmp = _days_before_month(year, i)
 *         assert val == cmp, f"{i}: {val} != {cmp}"
 *     print("Passed: days_bf_month")             # <<<<<<<<<<<<<<
 * 
 *     del _days_before_month
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_u_Passed_days_bf_month); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "cytimes/utils.py":462
 *                 cmp = date(year, month, day).weekday()
 *                 assert val == cmp, f"{year}-{month}-{day}: {val} != {cmp}"
 *     print("Passed: weekday")             # <<<<<<<<<<<<<<
 * 
 *     del date
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_u_Passed_weekday); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "cytimes/utils.py":491
 *                     iso_calr.weekday == cmp.weekday
 *                 ), f"{year}-{month}-{day}: {iso_calr.weekday} != {cmp.weekday}"
 *     print("Passed: isocalendar")             # <<<<<<<<<<<<<<
 * 
 *     del date
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_u_Passed_isocalendar); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "cytimes/utils.py":503
 *         cmp = _isoweek1monday(year)
 *         assert val == cmp, f"{year}: {val} != {cmp}"
 *     print("Passed: iso_1st_monday")             # <<<<<<<<<<<<<<
 * 
 *     del _isoweek1monday
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_u_Passed_iso_1st_monday); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "cytimes/utils.py":522
 *                 cmp = _ymd2ord(year, month, day)
 *                 assert val == cmp, f"{year}-{month}-{day}: {val} != {cmp}"
 *     print("Passed: ymd_to_ordinal")             # <<<<<<<<<<<<<<
 * 
 *     del _ymd2ord
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_u_Passed_ymd_to_ordinal); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "cytimes/utils.py":536
 *             val.year == y and val.month == m and val.day == d
 *         ), f"{i}: {val} != {y}-{m}-{d}"
 *     print("Passed: ymd_fr_ordinal")             # <<<<<<<<<<<<<<
 * 
 *     del _ord2ymd, _MAXORDINAL
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_u_Passed_ymd_fr_ordinal); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "cytimes/utils.py":561
 *                 ), f"{year}-{week}-{weekday}: {val} != {y}-{m}-{d}"
 * 
 *     print("Passed: ymd_fr_isocalendar")             # <<<<<<<<<<<<<<
 * 
 *     del _isoweek_to_gregorian
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_u_Passed_ymd_fr_isocalendar); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "cytimes/utils.py":573
 * 
 *     # New
 *     assert datetime.date(1, 1, 1) == date_new()  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.date(1, 1, 1) == date_new(1)  # type: ignore
 *     assert datetime.date(1, 1, 1) == date_new(1, 1)  # type: ignore
 */
  __pyx_tuple__53 = PyTuple_Pack(3, __pyx_int_1, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "cytimes/utils.py":584
 *     assert datetime.datetime.now(tz).date() == date_now(tz)  # type: ignore
 * 
 *     print("Passed: date_generate")             # <<<<<<<<<<<<<<
 * 
 *     del datetime
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_u_Passed_date_generate); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "cytimes/utils.py":603
 *     assert not is_date_exact(date)  # type: ignore
 * 
 *     print("Passed: date_type_check")             # <<<<<<<<<<<<<<
 * 
 *     del CustomDate, datetime
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_u_Passed_date_type_check); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "cytimes/utils.py":611
 *     import datetime
 * 
 *     date = datetime.date(2021, 1, 2)             # <<<<<<<<<<<<<<
 *     dt = datetime.datetime(2021, 1, 2)
 * 
 */
  __pyx_tuple__56 = PyTuple_Pack(3, __pyx_int_2021, __pyx_int_1, __pyx_int_2); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);

  /* "cytimes/utils.py":654
 *     assert date == tmp and type(tmp) is datetime.date
 * 
 *     print("Passed: date_conversion")             # <<<<<<<<<<<<<<
 * 
 *     del CustomDate, datetime
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_u_Passed_date_conversion); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "cytimes/utils.py":666
 * 
 *     # New
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new()  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1, 1)  # type: ignore
 */
  __pyx_tuple__58 = PyTuple_Pack(7, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "cytimes/utils.py":670
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 0, 0, 0) == dt_new(1, 1, 1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(1, 1, 1, 1, 1, 0, 0) == dt_new(1, 1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 0) == dt_new(1, 1, 1, 1, 1, 1)  # type: ignore
 */
  __pyx_tuple__59 = PyTuple_Pack(7, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

  /* "cytimes/utils.py":671
 *     assert datetime.datetime(1, 1, 1, 0, 0, 0, 0) == dt_new(1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 0, 0, 0) == dt_new(1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 0, 0) == dt_new(1, 1, 1, 1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 0) == dt_new(1, 1, 1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 1) == dt_new(1, 1, 1, 1, 1, 1, 1)  # type: ignore
 */
  __pyx_tuple__60 = PyTuple_Pack(7, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(1, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);

  /* "cytimes/utils.py":672
 *     assert datetime.datetime(1, 1, 1, 1, 0, 0, 0) == dt_new(1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 0, 0) == dt_new(1, 1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 0) == dt_new(1, 1, 1, 1, 1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 1) == dt_new(1, 1, 1, 1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 1, tz) == dt_new(1, 1, 1, 1, 1, 1, 1, tz)  # type: ignore
 */
  __pyx_tuple__61 = PyTuple_Pack(7, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_0); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(1, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "cytimes/utils.py":673
 *     assert datetime.datetime(1, 1, 1, 1, 1, 0, 0) == dt_new(1, 1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 0) == dt_new(1, 1, 1, 1, 1, 1)  # type: ignore
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 1) == dt_new(1, 1, 1, 1, 1, 1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(1, 1, 1, 1, 1, 1, 1, tz) == dt_new(1, 1, 1, 1, 1, 1, 1, tz)  # type: ignore
 * 
 */
  __pyx_tuple__62 = PyTuple_Pack(7, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(1, 673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "cytimes/utils.py":694
 *         ), f"{dt_n} != {dt_c}"
 * 
 *     print("Passed: dt_generate")             # <<<<<<<<<<<<<<
 * 
 *     del datetime
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_u_Passed_dt_generate); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(1, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "cytimes/utils.py":713
 *     assert not is_dt_exact(dt)  # type: ignore
 * 
 *     print("Passed: dt_type_check")             # <<<<<<<<<<<<<<
 * 
 *     del CustomDateTime, datetime
 */
  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_u_Passed_dt_type_check); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(1, 713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "cytimes/utils.py":722
 *     from zoneinfo import ZoneInfo
 * 
 *     dt = datetime.datetime(2021, 1, 2, 3, 4, 5, 6)             # <<<<<<<<<<<<<<
 *     tz = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     dt_tz1 = datetime.datetime(2021, 1, 2, 3, 4, 5, 6, tz)
 */
  __pyx_tuple__65 = PyTuple_Pack(7, __pyx_int_2021, __pyx_int_1, __pyx_int_2, __pyx_int_3, __pyx_int_4, __pyx_int_5, __pyx_int_6); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(1, 722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "cytimes/utils.py":732
 *         assert t.utcoffset() == dt_utcoffset(t)  # type: ignore
 * 
 *     print("Passed: dt_tzinfo")             # <<<<<<<<<<<<<<
 * 
 *     del datetime, ZoneInfo
 */
  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_u_Passed_dt_tzinfo); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(1, 732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "cytimes/utils.py":808
 * 
 *     date = datetime.date(2021, 1, 2)
 *     time1 = datetime.time(3, 4, 5, 6)             # <<<<<<<<<<<<<<
 *     time2 = datetime.time(3, 4, 5, 6, tz1)
 *     assert dt == dt_combine(date, time1)  # type: ignore
 */
  __pyx_tuple__67 = PyTuple_Pack(4, __pyx_int_3, __pyx_int_4, __pyx_int_5, __pyx_int_6); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(1, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "cytimes/utils.py":828
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt.toordinal())  # type: ignore
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt_to_ordinal(dt_tz2, False))  # type: ignore
 *     assert datetime.datetime(2021, 1, 1) == dt_fr_ordinal(dt_to_ordinal(dt_tz2, True))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt_to_ordinal(dt_tz3, False))  # type: ignore
 *     assert datetime.datetime(2021, 1, 3) == dt_fr_ordinal(dt_to_ordinal(dt_tz3, True))  # type: ignore
 */
  __pyx_tuple__68 = PyTuple_Pack(3, __pyx_int_2021, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(1, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "cytimes/utils.py":830
 *     assert datetime.datetime(2021, 1, 1) == dt_fr_ordinal(dt_to_ordinal(dt_tz2, True))  # type: ignore
 *     assert datetime.datetime(2021, 1, 2) == dt_fr_ordinal(dt_to_ordinal(dt_tz3, False))  # type: ignore
 *     assert datetime.datetime(2021, 1, 3) == dt_fr_ordinal(dt_to_ordinal(dt_tz3, True))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert dt == dt_fr_seconds(dt_to_seconds(dt))  # type: ignore
 *     assert dt_tz1 == dt_fr_seconds(dt_to_seconds(dt_tz1, False), tz1)  # type: ignore
 */
  __pyx_tuple__69 = PyTuple_Pack(3, __pyx_int_2021, __pyx_int_1, __pyx_int_3); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(1, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);

  /* "cytimes/utils.py":846
 *         assert datetime.datetime.fromtimestamp(ts, tz) == dt_fr_ts(ts, tz)  # type: ignore
 * 
 *     print("Passed: dt_conversion")             # <<<<<<<<<<<<<<
 * 
 *     del datetime, ZoneInfo, Timestamp
 */
  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_u_Passed_dt_conversion); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(1, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);

  /* "cytimes/utils.py":865
 *     assert 1 == dt_replace_fold(dt.replace(tzinfo=tz1, fold=0), 1).fold  # type: ignore
 * 
 *     print("Passed: dt_manipulate")             # <<<<<<<<<<<<<<
 * 
 *     del datetime, ZoneInfo
 */
  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_u_Passed_dt_manipulate); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(1, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);

  /* "cytimes/utils.py":877
 *     assert dt_add(dt, 1, 1, 1) == dt + td1  # type: ignore
 * 
 *     td2 = datetime.timedelta(1, 86400, 1)             # <<<<<<<<<<<<<<
 *     assert dt_add(dt, 1, 86400, 1) == dt + td2  # type: ignore
 * 
 */
  __pyx_tuple__72 = PyTuple_Pack(3, __pyx_int_1, __pyx_int_86400, __pyx_int_1); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(1, 877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);

  /* "cytimes/utils.py":880
 *     assert dt_add(dt, 1, 86400, 1) == dt + td2  # type: ignore
 * 
 *     td3 = datetime.timedelta(1, 86399, 1)             # <<<<<<<<<<<<<<
 *     assert dt_add(dt, 1, 86399, 1) == dt + td3  # type: ignore
 * 
 */
  __pyx_tuple__73 = PyTuple_Pack(3, __pyx_int_1, __pyx_int_86399, __pyx_int_1); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(1, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

  /* "cytimes/utils.py":883
 *     assert dt_add(dt, 1, 86399, 1) == dt + td3  # type: ignore
 * 
 *     td4 = datetime.timedelta(-1, -1, -1)             # <<<<<<<<<<<<<<
 *     assert dt_add(dt, -1, -1, -1) == dt + td4  # type: ignore
 * 
 */
  __pyx_tuple__74 = PyTuple_Pack(3, __pyx_int_neg_1, __pyx_int_neg_1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(1, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);

  /* "cytimes/utils.py":886
 *     assert dt_add(dt, -1, -1, -1) == dt + td4  # type: ignore
 * 
 *     td5 = datetime.timedelta(-1, -86400, -1)             # <<<<<<<<<<<<<<
 *     assert dt_add(dt, -1, -86400, -1) == dt + td5  # type: ignore
 * 
 */
  __pyx_tuple__75 = PyTuple_Pack(3, __pyx_int_neg_1, __pyx_int_neg_86400, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(1, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "cytimes/utils.py":889
 *     assert dt_add(dt, -1, -86400, -1) == dt + td5  # type: ignore
 * 
 *     td6 = datetime.timedelta(-1, -86399, -1)             # <<<<<<<<<<<<<<
 *     assert dt_add(dt, -1, -86399, -1) == dt + td6  # type: ignore
 * 
 */
  __pyx_tuple__76 = PyTuple_Pack(3, __pyx_int_neg_1, __pyx_int_neg_86399, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(1, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

  /* "cytimes/utils.py":892
 *     assert dt_add(dt, -1, -86399, -1) == dt + td6  # type: ignore
 * 
 *     td7 = datetime.timedelta(1, 60, 100000)             # <<<<<<<<<<<<<<
 *     assert dt_add(dt, 1, 60, 100000) == dt + td7  # type: ignore
 * 
 */
  __pyx_tuple__77 = PyTuple_Pack(3, __pyx_int_1, __pyx_int_60, __pyx_int_100000); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(1, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "cytimes/utils.py":895
 *     assert dt_add(dt, 1, 60, 100000) == dt + td7  # type: ignore
 * 
 *     td8 = datetime.timedelta(-1, -60, -100000)             # <<<<<<<<<<<<<<
 *     assert dt_add(dt, -1, -60, -100000) == dt + td8  # type: ignore
 * 
 */
  __pyx_tuple__78 = PyTuple_Pack(3, __pyx_int_neg_1, __pyx_int_neg_60, __pyx_int_neg_100000); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(1, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "cytimes/utils.py":898
 *     assert dt_add(dt, -1, -60, -100000) == dt + td8  # type: ignore
 * 
 *     print("Passed: date_arithmetic")             # <<<<<<<<<<<<<<
 * 
 *     del datetime
 */
  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_u_Passed_date_arithmetic); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(1, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

  /* "cytimes/utils.py":915
 *     assert datetime.time(0, 0, 0, 0) == time_new(0, 0, 0)  # type: ignore
 *     assert datetime.time(0, 0, 0, 0) == time_new(0, 0, 0, 0)  # type: ignore
 *     assert datetime.time(1, 0, 0, 0) == time_new(1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.time(1, 1, 0, 0) == time_new(1, 1)  # type: ignore
 *     assert datetime.time(1, 1, 1, 0) == time_new(1, 1, 1)  # type: ignore
 */
  __pyx_tuple__80 = PyTuple_Pack(4, __pyx_int_1, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(1, 915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);

  /* "cytimes/utils.py":916
 *     assert datetime.time(0, 0, 0, 0) == time_new(0, 0, 0, 0)  # type: ignore
 *     assert datetime.time(1, 0, 0, 0) == time_new(1)  # type: ignore
 *     assert datetime.time(1, 1, 0, 0) == time_new(1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.time(1, 1, 1, 0) == time_new(1, 1, 1)  # type: ignore
 *     assert datetime.time(1, 1, 1, 1) == time_new(1, 1, 1, 1)  # type: ignore
 */
  __pyx_tuple__81 = PyTuple_Pack(4, __pyx_int_1, __pyx_int_1, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(1, 916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);

  /* "cytimes/utils.py":917
 *     assert datetime.time(1, 0, 0, 0) == time_new(1)  # type: ignore
 *     assert datetime.time(1, 1, 0, 0) == time_new(1, 1)  # type: ignore
 *     assert datetime.time(1, 1, 1, 0) == time_new(1, 1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.time(1, 1, 1, 1) == time_new(1, 1, 1, 1)  # type: ignore
 *     assert datetime.time(1, 1, 1, 1, tz) == time_new(1, 1, 1, 1, tz)  # type: ignore
 */
  __pyx_tuple__82 = PyTuple_Pack(4, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_0); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(1, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);

  /* "cytimes/utils.py":918
 *     assert datetime.time(1, 1, 0, 0) == time_new(1, 1)  # type: ignore
 *     assert datetime.time(1, 1, 1, 0) == time_new(1, 1, 1)  # type: ignore
 *     assert datetime.time(1, 1, 1, 1) == time_new(1, 1, 1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.time(1, 1, 1, 1, tz) == time_new(1, 1, 1, 1, tz)  # type: ignore
 * 
 */
  __pyx_tuple__83 = PyTuple_Pack(4, __pyx_int_1, __pyx_int_1, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(1, 918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "cytimes/utils.py":936
 *         ), f"{t_n} != {t_c}"
 * 
 *     print("Passed: time_generate")             # <<<<<<<<<<<<<<
 * 
 *     del datetime
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_u_Passed_time_generate); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(1, 936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);

  /* "cytimes/utils.py":955
 *     assert not is_time_exact(time)  # type: ignore
 * 
 *     print("Passed: time_type_check")             # <<<<<<<<<<<<<<
 * 
 *     del CustomTime, datetime
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_u_Passed_time_type_check); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(1, 955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);

  /* "cytimes/utils.py":975
 *         assert t.utcoffset() == time_utcoffset(t)  # type: ignore
 * 
 *     print("Passed: time_tzinfo")             # <<<<<<<<<<<<<<
 * 
 *     del datetime, ZoneInfo
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_u_Passed_time_tzinfo); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(1, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);

  /* "cytimes/utils.py":986
 *     tz1 = datetime.timezone(datetime.timedelta(hours=1, minutes=1))
 *     t_tz1 = datetime.time(3, 4, 5, 6, tz1)
 *     dt = datetime.datetime(1970, 1, 1, 3, 4, 5, 6)             # <<<<<<<<<<<<<<
 *     dt_tz1 = datetime.datetime(1970, 1, 1, 3, 4, 5, 6, tz1)
 * 
 */
  __pyx_tuple__87 = PyTuple_Pack(7, __pyx_int_1970, __pyx_int_1, __pyx_int_1, __pyx_int_3, __pyx_int_4, __pyx_int_5, __pyx_int_6); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(1, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

  /* "cytimes/utils.py":1018
 *     assert t_tz1 == time_fr_us(time_to_us(t1, False), tz1)  # type: ignore
 * 
 *     print("Passed: time_conversion")             # <<<<<<<<<<<<<<
 * 
 *     del CustomTime, datetime
 */
  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_u_Passed_time_conversion); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(1, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);

  /* "cytimes/utils.py":1032
 *     assert datetime.timedelta(0, 0, 0) == td_new(0, 0)  # type: ignore
 *     assert datetime.timedelta(0, 0, 0) == td_new(0, 0, 0)  # type: ignore
 *     assert datetime.timedelta(1, 0, 0) == td_new(1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timedelta(1, 1, 0) == td_new(1, 1)  # type: ignore
 *     assert datetime.timedelta(1, 1, 1) == td_new(1, 1, 1)  # type: ignore
 */
  __pyx_tuple__89 = PyTuple_Pack(3, __pyx_int_1, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(1, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);

  /* "cytimes/utils.py":1033
 *     assert datetime.timedelta(0, 0, 0) == td_new(0, 0, 0)  # type: ignore
 *     assert datetime.timedelta(1, 0, 0) == td_new(1)  # type: ignore
 *     assert datetime.timedelta(1, 1, 0) == td_new(1, 1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timedelta(1, 1, 1) == td_new(1, 1, 1)  # type: ignore
 *     assert datetime.timedelta(-1, 0, 0) == td_new(-1)  # type: ignore
 */
  __pyx_tuple__90 = PyTuple_Pack(3, __pyx_int_1, __pyx_int_1, __pyx_int_0); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(1, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

  /* "cytimes/utils.py":1035
 *     assert datetime.timedelta(1, 1, 0) == td_new(1, 1)  # type: ignore
 *     assert datetime.timedelta(1, 1, 1) == td_new(1, 1, 1)  # type: ignore
 *     assert datetime.timedelta(-1, 0, 0) == td_new(-1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timedelta(-1, -1, 0) == td_new(-1, -1)  # type: ignore
 *     assert datetime.timedelta(-1, -1, -1) == td_new(-1, -1, -1)  # type: ignore
 */
  __pyx_tuple__91 = PyTuple_Pack(3, __pyx_int_neg_1, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(1, 1035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);

  /* "cytimes/utils.py":1036
 *     assert datetime.timedelta(1, 1, 1) == td_new(1, 1, 1)  # type: ignore
 *     assert datetime.timedelta(-1, 0, 0) == td_new(-1)  # type: ignore
 *     assert datetime.timedelta(-1, -1, 0) == td_new(-1, -1)  # type: ignore             # <<<<<<<<<<<<<<
 *     assert datetime.timedelta(-1, -1, -1) == td_new(-1, -1, -1)  # type: ignore
 * 
 */
  __pyx_tuple__92 = PyTuple_Pack(3, __pyx_int_neg_1, __pyx_int_neg_1, __pyx_int_0); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(1, 1036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);

  /* "cytimes/utils.py":1039
 *     assert datetime.timedelta(-1, -1, -1) == td_new(-1, -1, -1)  # type: ignore
 * 
 *     print("Passed: timedelta_generate")             # <<<<<<<<<<<<<<
 * 
 *     del datetime
 */
  __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_u_Passed_timedelta_generate); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(1, 1039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);

  /* "cytimes/utils.py":1058
 *     assert not is_td_exact(td)  # type: ignore
 * 
 *     print("Passed: timedelta_type_chech")             # <<<<<<<<<<<<<<
 * 
 *     del CustomTD, datetime
 */
  __pyx_tuple__94 = PyTuple_Pack(1, __pyx_kp_u_Passed_timedelta_type_chech); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(1, 1058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);

  /* "cytimes/utils.py":1066
 *     import datetime
 * 
 *     assert "00:00:01" == td_to_isoformat(datetime.timedelta(0, 1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "00:01:01" == td_to_isoformat(datetime.timedelta(0, 1, minutes=1))  # type: ignore
 *     assert "24:01:01" == td_to_isoformat(datetime.timedelta(1, 1, minutes=1))  # type: ignore
 */
  __pyx_tuple__95 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_1); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(1, 1066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);

  /* "cytimes/utils.py":1068
 *     assert "00:00:01" == td_to_isoformat(datetime.timedelta(0, 1))  # type: ignore
 *     assert "00:01:01" == td_to_isoformat(datetime.timedelta(0, 1, minutes=1))  # type: ignore
 *     assert "24:01:01" == td_to_isoformat(datetime.timedelta(1, 1, minutes=1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "24:01:01.001000" == td_to_isoformat(datetime.timedelta(1, 1, 0, minutes=1, milliseconds=1))  # type: ignore
 *     assert "24:01:01.000001" == td_to_isoformat(datetime.timedelta(1, 1, 1, minutes=1))  # type: ignore
 */
  __pyx_tuple__96 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(1, 1068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);

  /* "cytimes/utils.py":1072
 *     assert "24:01:01.000001" == td_to_isoformat(datetime.timedelta(1, 1, 1, minutes=1))  # type: ignore
 *     assert "24:01:01.001001" == td_to_isoformat(datetime.timedelta(1, 1, 1, minutes=1, milliseconds=1))  # type: ignore
 *     assert "-00:00:01" == td_to_isoformat(datetime.timedelta(0, -1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "-00:01:01" == td_to_isoformat(datetime.timedelta(0, -1, minutes=-1))  # type: ignore
 *     assert "-24:01:01" == td_to_isoformat(datetime.timedelta(-1, -1, minutes=-1))  # type: ignore
 */
  __pyx_tuple__97 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(1, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

  /* "cytimes/utils.py":1074
 *     assert "-00:00:01" == td_to_isoformat(datetime.timedelta(0, -1))  # type: ignore
 *     assert "-00:01:01" == td_to_isoformat(datetime.timedelta(0, -1, minutes=-1))  # type: ignore
 *     assert "-24:01:01" == td_to_isoformat(datetime.timedelta(-1, -1, minutes=-1))  # type: ignore             # <<<<<<<<<<<<<<
 *     assert "-24:01:01.001000" == td_to_isoformat(datetime.timedelta(-1, -1, 0, minutes=-1, milliseconds=-1))  # type: ignore
 *     assert "-24:01:01.000001" == td_to_isoformat(datetime.timedelta(-1, -1, -1, minutes=-1))  # type: ignore
 */
  __pyx_tuple__98 = PyTuple_Pack(2, __pyx_int_neg_1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(1, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);

  /* "cytimes/utils.py":1085
 *             tz_str = dt_str[len(dt_str) - 6 :]
 *             with cython.wraparound(True):
 *                 tz_str = tz_str[:-3] + tz_str[-2:]             # <<<<<<<<<<<<<<
 *             assert tz_str == td_to_utcformat(td)  # type: ignore
 * 
 */
  __pyx_slice__99 = PySlice_New(Py_None, __pyx_int_neg_3, Py_None); if (unlikely(!__pyx_slice__99)) __PYX_ERR(1, 1085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__99);
  __Pyx_GIVEREF(__pyx_slice__99);
  __pyx_slice__100 = PySlice_New(__pyx_int_neg_2, Py_None, Py_None); if (unlikely(!__pyx_slice__100)) __PYX_ERR(1, 1085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__100);
  __Pyx_GIVEREF(__pyx_slice__100);

  /* "cytimes/utils.py":1105
 *     assert td == td_fr_us(td_to_us(td))  # type: ignore
 * 
 *     print("Passed: timedelta_conversion")             # <<<<<<<<<<<<<<
 * 
 *     del CustomTD, datetime
 */
  __pyx_tuple__101 = PyTuple_Pack(1, __pyx_kp_u_Passed_timedelta_conversion); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(1, 1105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);

  /* "cytimes/utils.py":1125
 *     assert tz_parse(LOCALTZ) == tz_local()  # type: ignore
 * 
 *     print("Passed: tzinfo_generate")             # <<<<<<<<<<<<<<
 * 
 *     del datetime, time, LOCALTZ
 */
  __pyx_tuple__102 = PyTuple_Pack(1, __pyx_kp_u_Passed_tzinfo_generate); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(1, 1125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);

  /* "cytimes/utils.py":1137
 *     assert not is_tz_exact(tz)  # type: ignore
 * 
 *     print("Passed: tzinfo_type_check")             # <<<<<<<<<<<<<<
 * 
 *     del datetime
 */
  __pyx_tuple__103 = PyTuple_Pack(1, __pyx_kp_u_Passed_tzinfo_type_check); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(1, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);

  /* "cytimes/utils.py":1174
 *     assert "-2359" == tz_utcformat(tz, dt)  # type: ignore
 * 
 *     print("Passed: tzinfo_access")             # <<<<<<<<<<<<<<
 * 
 *     del datetime, ZoneInfo
 */
  __pyx_tuple__104 = PyTuple_Pack(1, __pyx_kp_u_Passed_tzinfo_access); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(1, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);

  /* "cytimes/utils.py":1183
 *     import numpy as np
 * 
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns", "ps", "fs", "as")             # <<<<<<<<<<<<<<
 * 
 *     for unit in units:
 */
  __pyx_tuple__105 = PyTuple_Pack(13, __pyx_n_u_Y, __pyx_n_u_M, __pyx_n_u_W, __pyx_n_u_D, __pyx_n_u_h, __pyx_n_u_m, __pyx_n_u_s, __pyx_n_u_ms, __pyx_n_u_us, __pyx_n_u_ns, __pyx_n_u_ps, __pyx_n_u_fs, __pyx_n_u_as); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(1, 1183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);

  /* "cytimes/utils.py":1198
 *         assert unit == map_nptime_unit_int2str(parse_arr_nptime_unit(arr))  # type: ignore
 * 
 *     print("Passed: numpy_share")             # <<<<<<<<<<<<<<
 * 
 *     del np
 */
  __pyx_tuple__106 = PyTuple_Pack(1, __pyx_kp_u_Passed_numpy_share); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(1, 1198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);

  /* "cytimes/utils.py":1218
 *         pass
 *     else:
 *         raise AssertionError("Failed: datetime64_type_check")             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: datetime64_type_check")
 */
  __pyx_tuple__107 = PyTuple_Pack(1, __pyx_kp_u_Failed_datetime64_type_check); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(1, 1218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);

  /* "cytimes/utils.py":1220
 *         raise AssertionError("Failed: datetime64_type_check")
 * 
 *     print("Passed: datetime64_type_check")             # <<<<<<<<<<<<<<
 * 
 *     del np
 */
  __pyx_tuple__108 = PyTuple_Pack(1, __pyx_kp_u_Passed_datetime64_type_check); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(1, 1220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);

  /* "cytimes/utils.py":1228
 *     import datetime, numpy as np
 * 
 *     units = ("Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns")             # <<<<<<<<<<<<<<
 *     for unit in units:
 *         for i in range(-500, 501):
 */
  __pyx_tuple__109 = PyTuple_Pack(10, __pyx_n_u_Y, __pyx_n_u_M, __pyx_n_u_W, __pyx_n_u_D, __pyx_n_u_h, __pyx_n_u_m, __pyx_n_u_s, __pyx_n_u_ms, __pyx_n_u_us, __pyx_n_u_ns); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(1, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);

  /* "cytimes/utils.py":1236
 *             assert dt64_to_dt(dt64) == dt_fr_us(us)  # type: ignore
 * 
 *     print("Passed: datetime64_conversion")             # <<<<<<<<<<<<<<
 * 
 *     del datetime, np
 */
  __pyx_tuple__110 = PyTuple_Pack(1, __pyx_kp_u_Passed_datetime64_conversion); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(1, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);

  /* "cytimes/utils.py":1245
 *     import numpy as np
 * 
 *     td = np.timedelta64(1, "D")             # <<<<<<<<<<<<<<
 *     assert is_td64(td)  # type: ignore
 *     validate_td64(td)  # type: ignore
 */
  __pyx_tuple__111 = PyTuple_Pack(2, __pyx_int_1, __pyx_n_u_D); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(1, 1245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);

  /* "cytimes/utils.py":1256
 *         pass
 *     else:
 *         raise AssertionError("Failed: timedelta64_type_check")             # <<<<<<<<<<<<<<
 * 
 *     print("Passed: timedelta64_type_check")
 */
  __pyx_tuple__112 = PyTuple_Pack(1, __pyx_kp_u_Failed_timedelta64_type_check); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(1, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);

  /* "cytimes/utils.py":1258
 *         raise AssertionError("Failed: timedelta64_type_check")
 * 
 *     print("Passed: timedelta64_type_check")             # <<<<<<<<<<<<<<
 * 
 *     del np
 */
  __pyx_tuple__113 = PyTuple_Pack(1, __pyx_kp_u_Passed_timedelta64_type_check); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(1, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);

  /* "cytimes/utils.py":1274
 *             assert td64_to_td(td64) == datetime.timedelta(microseconds=int(us))  # type: ignore
 * 
 *     print("Passed: timedelta64_conversion")             # <<<<<<<<<<<<<<
 * 
 *     del datetime, np
 */
  __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_u_Passed_timedelta64_conversion); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(1, 1274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);

  /* "cytimes/utils.py":1287
 *     assert is_arr("a") == False  # type: ignore
 * 
 *     print("Passed: ndarray_type_check")             # <<<<<<<<<<<<<<
 * 
 *     del np
 */
  __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_u_Passed_ndarray_type_check); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(1, 1287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);

  /* "cytimes/utils.py":1301
 *     assert is_dt64arr(np.array([], dtype="int64")) == False  # type: ignore
 * 
 *     print("Passed: ndarray_dt64_type_check")             # <<<<<<<<<<<<<<
 * 
 *     del np
 */
  __pyx_tuple__116 = PyTuple_Pack(1, __pyx_kp_u_Passed_ndarray_dt64_type_check); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(1, 1301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);

  /* "cytimes/utils.py":1330
 *             assert np.equal(val, cmp).all()
 * 
 *     print("Passed: ndarray_dt64_conversion")             # <<<<<<<<<<<<<<
 * 
 *     del np
 */
  __pyx_tuple__118 = PyTuple_Pack(1, __pyx_kp_u_Passed_ndarray_dt64_conversion); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(1, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);

  /* "cytimes/utils.py":1344
 *     assert is_td64arr(np.array([], dtype="int64")) == False  # type: ignore
 * 
 *     print("Passed: ndarray_td64_type_check")             # <<<<<<<<<<<<<<
 * 
 *     del np
 */
  __pyx_tuple__119 = PyTuple_Pack(1, __pyx_kp_u_Passed_ndarray_td64_type_check); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(1, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);

  /* "cytimes/utils.py":1360
 *         assert np.equal(val, cmp).all()
 * 
 *     print("Passed: ndarray_td64_conversion")             # <<<<<<<<<<<<<<
 * 
 *     del np
 */
  __pyx_tuple__120 = PyTuple_Pack(1, __pyx_kp_u_Passed_ndarray_td64_conversion); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(1, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);

  /* "cytimes/utils.py":195
 * ########## The REST utility functions are in the utils.pxd file ##########
 * ########## The following functions are for testing purpose only ##########
 * def _test_utils() -> None:             # <<<<<<<<<<<<<<
 *     # Parser
 *     _test_parser()
 */
  __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_utils, 195, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(1, 195, __pyx_L1_error)

  /* "cytimes/utils.py":254
 * 
 * # Parser
 * def _test_parser() -> None:             # <<<<<<<<<<<<<<
 *     # boolean
 *     assert is_iso_sep("t")  # type: ignore
 */
  __pyx_tuple__122 = PyTuple_Pack(2, __pyx_n_s_i, __pyx_n_s_t); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(1, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);
  __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_parser, 254, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(1, 254, __pyx_L1_error)

  /* "cytimes/utils.py":315
 * 
 * # Time
 * def _test_localtime_n_gmtime() -> None:             # <<<<<<<<<<<<<<
 *     import time
 * 
 */
  __pyx_tuple__124 = PyTuple_Pack(4, __pyx_n_s_time, __pyx_n_s_t, __pyx_n_s_val, __pyx_n_s_cmp); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(1, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);
  __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_localtime_n_gmtime, 315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(1, 315, __pyx_L1_error)

  /* "cytimes/utils.py":349
 * 
 * # Calendar
 * def _test_is_leap_year() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _is_leap  # type: ignore
 * 
 */
  __pyx_tuple__126 = PyTuple_Pack(4, __pyx_n_s_is_leap, __pyx_n_s_i, __pyx_n_s_val, __pyx_n_s_cmp); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(1, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);
  __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_is_leap_year, 349, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(1, 349, __pyx_L1_error)

  /* "cytimes/utils.py":361
 * 
 * 
 * def _test_days_bf_year() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _days_before_year  # type: ignore
 * 
 */
  __pyx_tuple__128 = PyTuple_Pack(4, __pyx_n_s_days_before_year, __pyx_n_s_i, __pyx_n_s_val, __pyx_n_s_cmp); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(1, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);
  __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_days_bf_year, 361, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(1, 361, __pyx_L1_error)

  /* "cytimes/utils.py":373
 * 
 * 
 * def _test_quarter_of_month() -> None:             # <<<<<<<<<<<<<<
 *     count: cython.int = 0
 *     value: cython.int = 1
 */
  __pyx_tuple__130 = PyTuple_Pack(5, __pyx_n_s_count, __pyx_n_s_value, __pyx_n_s_i, __pyx_n_s_val, __pyx_n_s_cmp); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(1, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);
  __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_quarter_of_month, 373, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(1, 373, __pyx_L1_error)

  /* "cytimes/utils.py":387
 * 
 * 
 * def _test_days_in_quarter() -> None:             # <<<<<<<<<<<<<<
 *     # non-leap
 *     year: cython.int = 2021
 */
  __pyx_tuple__132 = PyTuple_Pack(5, __pyx_n_s_year, __pyx_n_s_i, __pyx_n_s_qtr, __pyx_n_s_val, __pyx_n_s_cmp); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(1, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);
  __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_days_in_quarter, 387, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(1, 387, __pyx_L1_error)

  /* "cytimes/utils.py":408
 * 
 * 
 * def _test_days_in_month() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _days_in_month  # type: ignore
 * 
 */
  __pyx_tuple__134 = PyTuple_Pack(5, __pyx_n_s_days_in_month, __pyx_n_s_year, __pyx_n_s_i, __pyx_n_s_val, __pyx_n_s_cmp); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(1, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);
  __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_days_in_month, 408, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(1, 408, __pyx_L1_error)

  /* "cytimes/utils.py":428
 * 
 * 
 * def _test_days_bf_month() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _days_before_month  # type: ignore
 * 
 */
  __pyx_tuple__136 = PyTuple_Pack(5, __pyx_n_s_days_before_month, __pyx_n_s_year, __pyx_n_s_i, __pyx_n_s_val, __pyx_n_s_cmp); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(1, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);
  __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_days_bf_month, 428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) __PYX_ERR(1, 428, __pyx_L1_error)

  /* "cytimes/utils.py":448
 * 
 * 
 * def _test_weekday() -> None:             # <<<<<<<<<<<<<<
 *     from datetime import date
 * 
 */
  __pyx_tuple__138 = PyTuple_Pack(6, __pyx_n_s_date, __pyx_n_s_year, __pyx_n_s_month, __pyx_n_s_day, __pyx_n_s_val, __pyx_n_s_cmp); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(1, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);
  __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_weekday, 448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(1, 448, __pyx_L1_error)

  /* "cytimes/utils.py":467
 * 
 * 
 * def _test_isocalendar() -> None:             # <<<<<<<<<<<<<<
 *     from datetime import date
 * 
 */
  __pyx_tuple__140 = PyTuple_Pack(8, __pyx_n_s_date, __pyx_n_s_year, __pyx_n_s_month, __pyx_n_s_day, __pyx_n_s_iso_calr, __pyx_n_s_iso_week, __pyx_n_s_iso_year, __pyx_n_s_cmp); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(1, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);
  __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_isocalendar, 467, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) __PYX_ERR(1, 467, __pyx_L1_error)

  /* "cytimes/utils.py":496
 * 
 * 
 * def _test_iso_1st_monday() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _isoweek1monday  # type: ignore
 * 
 */
  __pyx_tuple__142 = PyTuple_Pack(4, __pyx_n_s_isoweek1monday, __pyx_n_s_year, __pyx_n_s_val, __pyx_n_s_cmp); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(1, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);
  __pyx_codeobj__143 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_iso_1st_monday, 496, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__143)) __PYX_ERR(1, 496, __pyx_L1_error)

  /* "cytimes/utils.py":508
 * 
 * 
 * def _test_ymd_to_ordinal() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _ymd2ord  # type: ignore
 * 
 */
  __pyx_tuple__144 = PyTuple_Pack(6, __pyx_n_s_ymd2ord, __pyx_n_s_year, __pyx_n_s_month, __pyx_n_s_day, __pyx_n_s_val, __pyx_n_s_cmp); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(1, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);
  __pyx_codeobj__145 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__144, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_ymd_to_ordinal, 508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__145)) __PYX_ERR(1, 508, __pyx_L1_error)

  /* "cytimes/utils.py":527
 * 
 * 
 * def _test_ymd_fr_ordinal() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _ord2ymd, _MAXORDINAL  # type: ignore
 * 
 */
  __pyx_tuple__146 = PyTuple_Pack(7, __pyx_n_s_ord2ymd, __pyx_n_s_MAXORDINAL, __pyx_n_s_i, __pyx_n_s_val, __pyx_n_s_y, __pyx_n_s_m, __pyx_n_s_d); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(1, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);
  __pyx_codeobj__147 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__146, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_ymd_fr_ordinal, 527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__147)) __PYX_ERR(1, 527, __pyx_L1_error)

  /* "cytimes/utils.py":541
 * 
 * 
 * def _test_ymd_fr_isocalendar() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _isoweek_to_gregorian  # type: ignore
 * 
 */
  __pyx_tuple__148 = PyTuple_Pack(8, __pyx_n_s_isoweek_to_gregorian, __pyx_n_s_year, __pyx_n_s_week, __pyx_n_s_weekday, __pyx_n_s_y, __pyx_n_s_m, __pyx_n_s_d, __pyx_n_s_val); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(1, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);
  __pyx_codeobj__149 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__148, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_ymd_fr_isocalendar, 541, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__149)) __PYX_ERR(1, 541, __pyx_L1_error)

  /* "cytimes/utils.py":567
 * 
 * # datetime.date
 * def _test_date_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_tuple__150 = PyTuple_Pack(2, __pyx_n_s_datetime, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(1, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__150);
  __Pyx_GIVEREF(__pyx_tuple__150);
  __pyx_codeobj__151 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__150, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_date_generate, 567, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__151)) __PYX_ERR(1, 567, __pyx_L1_error)

  /* "cytimes/utils.py":589
 * 
 * 
 * def _test_date_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_tuple__152 = PyTuple_Pack(3, __pyx_n_s_datetime, __pyx_n_s_CustomDate, __pyx_n_s_date); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(1, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);
  __pyx_codeobj__153 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__152, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_date_type_check, 589, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__153)) __PYX_ERR(1, 589, __pyx_L1_error)

  /* "cytimes/utils.py":608
 * 
 * 
 * def _test_date_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_tuple__154 = PyTuple_Pack(6, __pyx_n_s_datetime, __pyx_n_s_date, __pyx_n_s_dt, __pyx_n_s_tm, __pyx_n_s_CustomDate, __pyx_n_s_tmp); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(1, 608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__154);
  __Pyx_GIVEREF(__pyx_tuple__154);
  __pyx_codeobj__155 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__154, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_date_conversion, 608, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__155)) __PYX_ERR(1, 608, __pyx_L1_error)

  /* "cytimes/utils.py":660
 * 
 * # datetime.datetime
 * def _test_dt_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_tuple__156 = PyTuple_Pack(4, __pyx_n_s_datetime, __pyx_n_s_tz, __pyx_n_s_dt_n, __pyx_n_s_dt_c); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(1, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__156);
  __Pyx_GIVEREF(__pyx_tuple__156);
  __pyx_codeobj__157 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__156, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_dt_generate, 660, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__157)) __PYX_ERR(1, 660, __pyx_L1_error)

  /* "cytimes/utils.py":699
 * 
 * 
 * def _test_dt_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_tuple__158 = PyTuple_Pack(3, __pyx_n_s_datetime, __pyx_n_s_CustomDateTime, __pyx_n_s_dt); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(1, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__158);
  __Pyx_GIVEREF(__pyx_tuple__158);
  __pyx_codeobj__159 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_dt_type_check, 699, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__159)) __PYX_ERR(1, 699, __pyx_L1_error)

  /* "cytimes/utils.py":718
 * 
 * 
 * def _test_dt_tzinfo() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */
  __pyx_tuple__160 = PyTuple_Pack(7, __pyx_n_s_datetime, __pyx_n_s_ZoneInfo, __pyx_n_s_dt, __pyx_n_s_tz, __pyx_n_s_dt_tz1, __pyx_n_s_dt_tz2, __pyx_n_s_t); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(1, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__160);
  __Pyx_GIVEREF(__pyx_tuple__160);
  __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_dt_tzinfo, 718, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(1, 718, __pyx_L1_error)

  /* "cytimes/utils.py":737
 * 
 * 
 * def _test_dt_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */
  __pyx_tuple__162 = PyTuple_Pack(28, __pyx_n_s_datetime, __pyx_n_s_ZoneInfo, __pyx_n_s_Timestamp, __pyx_n_s_dt, __pyx_n_s_tz1, __pyx_n_s_dt_tz1, __pyx_n_s_tz2, __pyx_n_s_dt_tz2, __pyx_n_s_tz3, __pyx_n_s_dt_tz3, __pyx_n_s_dt_tz4, __pyx_n_s_d, __pyx_n_s_tm, __pyx_n_s_secs, __pyx_n_s_offset, __pyx_n_s_us, __pyx_n_s_t, __pyx_n_s_date, __pyx_n_s_time1, __pyx_n_s_time2, __pyx_n_s_tmp, __pyx_n_s_tmp1, __pyx_n_s_tmp2, __pyx_n_s_tmp3, __pyx_n_s_tz4, __pyx_n_s_tz, __pyx_n_s_dt_2, __pyx_n_s_ts); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(1, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);
  __pyx_codeobj__163 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 28, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_dt_conversion, 737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__163)) __PYX_ERR(1, 737, __pyx_L1_error)

  /* "cytimes/utils.py":851
 * 
 * 
 * def _test_dt_mainipulate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */
  __pyx_tuple__164 = PyTuple_Pack(8, __pyx_n_s_datetime, __pyx_n_s_ZoneInfo, __pyx_n_s_dt, __pyx_n_s_tz1, __pyx_n_s_tz2, __pyx_n_s_tz3, __pyx_n_s_tz4, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(1, 851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__164);
  __Pyx_GIVEREF(__pyx_tuple__164);
  __pyx_codeobj__165 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_dt_mainipulate, 851, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) __PYX_ERR(1, 851, __pyx_L1_error)

  /* "cytimes/utils.py":870
 * 
 * 
 * def _test_dt_arithmetic() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_tuple__166 = PyTuple_Pack(10, __pyx_n_s_datetime, __pyx_n_s_dt, __pyx_n_s_td1, __pyx_n_s_td2, __pyx_n_s_td3, __pyx_n_s_td4, __pyx_n_s_td5, __pyx_n_s_td6, __pyx_n_s_td7, __pyx_n_s_td8); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(1, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__166);
  __Pyx_GIVEREF(__pyx_tuple__166);
  __pyx_codeobj__167 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_dt_arithmetic, 870, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__167)) __PYX_ERR(1, 870, __pyx_L1_error)

  /* "cytimes/utils.py":904
 * 
 * # datetime.time
 * def _test_time_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_tuple__168 = PyTuple_Pack(4, __pyx_n_s_datetime, __pyx_n_s_tz, __pyx_n_s_t_n, __pyx_n_s_t_c); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(1, 904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__168);
  __Pyx_GIVEREF(__pyx_tuple__168);
  __pyx_codeobj__169 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_time_generate, 904, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__169)) __PYX_ERR(1, 904, __pyx_L1_error)

  /* "cytimes/utils.py":941
 * 
 * 
 * def _test_time_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_tuple__170 = PyTuple_Pack(3, __pyx_n_s_datetime, __pyx_n_s_CustomTime, __pyx_n_s_time); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(1, 941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__170);
  __Pyx_GIVEREF(__pyx_tuple__170);
  __pyx_codeobj__171 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__170, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_time_type_check, 941, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) __PYX_ERR(1, 941, __pyx_L1_error)

  /* "cytimes/utils.py":960
 * 
 * 
 * def _test_time_tzinfo() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */
  __pyx_tuple__172 = PyTuple_Pack(8, __pyx_n_s_datetime, __pyx_n_s_ZoneInfo, __pyx_n_s_time, __pyx_n_s_tz1, __pyx_n_s_time_tz1, __pyx_n_s_tz2, __pyx_n_s_time_tz2, __pyx_n_s_t); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(1, 960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__172);
  __Pyx_GIVEREF(__pyx_tuple__172);
  __pyx_codeobj__173 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__172, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_time_tzinfo, 960, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__173)) __PYX_ERR(1, 960, __pyx_L1_error)

  /* "cytimes/utils.py":980
 * 
 * 
 * def _test_time_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_tuple__174 = PyTuple_Pack(11, __pyx_n_s_datetime, __pyx_n_s_t1, __pyx_n_s_tz1, __pyx_n_s_t_tz1, __pyx_n_s_dt, __pyx_n_s_dt_tz1, __pyx_n_s_secs, __pyx_n_s_offset, __pyx_n_s_us, __pyx_n_s_CustomTime, __pyx_n_s_tmp); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(1, 980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__174);
  __Pyx_GIVEREF(__pyx_tuple__174);
  __pyx_codeobj__175 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_time_conversion, 980, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__175)) __PYX_ERR(1, 980, __pyx_L1_error)

  /* "cytimes/utils.py":1024
 * 
 * # datetime.timedelta
 * def _test_timedelta_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_tuple__176 = PyTuple_Pack(1, __pyx_n_s_datetime); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(1, 1024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__176);
  __Pyx_GIVEREF(__pyx_tuple__176);
  __pyx_codeobj__177 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_timedelta_generate, 1024, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__177)) __PYX_ERR(1, 1024, __pyx_L1_error)

  /* "cytimes/utils.py":1044
 * 
 * 
 * def _test_timedelta_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_tuple__178 = PyTuple_Pack(3, __pyx_n_s_datetime, __pyx_n_s_CustomTD, __pyx_n_s_td); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(1, 1044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__178);
  __Pyx_GIVEREF(__pyx_tuple__178);
  __pyx_codeobj__179 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__178, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_timedelta_type_check, 1044, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__179)) __PYX_ERR(1, 1044, __pyx_L1_error)

  /* "cytimes/utils.py":1063
 * 
 * 
 * def _test_timedelta_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_tuple__180 = PyTuple_Pack(9, __pyx_n_s_datetime, __pyx_n_s_h, __pyx_n_s_m, __pyx_n_s_td, __pyx_n_s_dt_str, __pyx_n_s_tz_str, __pyx_n_s_secs, __pyx_n_s_CustomTD, __pyx_n_s_tmp); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(1, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__180);
  __Pyx_GIVEREF(__pyx_tuple__180);
  __pyx_codeobj__181 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__180, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_timedelta_conversion, 1063, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__181)) __PYX_ERR(1, 1063, __pyx_L1_error)

  /* "cytimes/utils.py":1111
 * 
 * # datetime.tzinfo
 * def _test_tzinfo_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime, time
 *     from babel.dates import LOCALTZ
 */
  __pyx_tuple__182 = PyTuple_Pack(3, __pyx_n_s_datetime, __pyx_n_s_time, __pyx_n_s_LOCALTZ); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(1, 1111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__182);
  __Pyx_GIVEREF(__pyx_tuple__182);
  __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__182, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_tzinfo_generate, 1111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) __PYX_ERR(1, 1111, __pyx_L1_error)

  /* "cytimes/utils.py":1130
 * 
 * 
 * def _test_tzinfo_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__150, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_tzinfo_type_check, 1130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(1, 1130, __pyx_L1_error)

  /* "cytimes/utils.py":1142
 * 
 * 
 * def _test_tzinfo_access() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */
  __pyx_tuple__185 = PyTuple_Pack(4, __pyx_n_s_datetime, __pyx_n_s_ZoneInfo, __pyx_n_s_dt, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(1, 1142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__185);
  __Pyx_GIVEREF(__pyx_tuple__185);
  __pyx_codeobj__186 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_tzinfo_access, 1142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) __PYX_ERR(1, 1142, __pyx_L1_error)

  /* "cytimes/utils.py":1180
 * 
 * # . numpy.share
 * def _test_numpy_share() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */
  __pyx_tuple__187 = PyTuple_Pack(4, __pyx_n_s_np, __pyx_n_s_units, __pyx_n_s_unit, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(1, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__187);
  __Pyx_GIVEREF(__pyx_tuple__187);
  __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_numpy_share, 1180, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(1, 1180, __pyx_L1_error)

  /* "cytimes/utils.py":1204
 * 
 * # . numpy.datetime64
 * def _test_datetime64_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */
  __pyx_tuple__189 = PyTuple_Pack(3, __pyx_n_s_np, __pyx_n_s_dt, __pyx_n_s_dt2); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(1, 1204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__189);
  __Pyx_GIVEREF(__pyx_tuple__189);
  __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_datetime64_type_check, 1204, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(1, 1204, __pyx_L1_error)

  /* "cytimes/utils.py":1225
 * 
 * 
 * def _test_datetime64_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime, numpy as np
 * 
 */
  __pyx_tuple__191 = PyTuple_Pack(7, __pyx_n_s_datetime, __pyx_n_s_np, __pyx_n_s_units, __pyx_n_s_unit, __pyx_n_s_i, __pyx_n_s_dt64, __pyx_n_s_us); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(1, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);
  __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_datetime64_conversion, 1225, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) __PYX_ERR(1, 1225, __pyx_L1_error)

  /* "cytimes/utils.py":1242
 * 
 * # . numpy.timedelta64
 * def _test_timedelta64_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */
  __pyx_tuple__193 = PyTuple_Pack(3, __pyx_n_s_np, __pyx_n_s_td, __pyx_n_s_td2); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(1, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);
  __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_timedelta64_type_check, 1242, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(1, 1242, __pyx_L1_error)

  /* "cytimes/utils.py":1263
 * 
 * 
 * def _test_timedelta64_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime, numpy as np
 * 
 */
  __pyx_tuple__195 = PyTuple_Pack(7, __pyx_n_s_datetime, __pyx_n_s_np, __pyx_n_s_units, __pyx_n_s_unit, __pyx_n_s_i, __pyx_n_s_td64, __pyx_n_s_us); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(1, 1263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);
  __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__195, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_timedelta64_conversion, 1263, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(1, 1263, __pyx_L1_error)

  /* "cytimes/utils.py":1280
 * 
 * # . numpy.ndarray
 * def _test_ndarray_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */
  __pyx_tuple__197 = PyTuple_Pack(1, __pyx_n_s_np); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(1, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);
  __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_ndarray_type_check, 1280, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) __PYX_ERR(1, 1280, __pyx_L1_error)

  /* "cytimes/utils.py":1293
 * 
 * # . numpy.ndarray[datetime64]
 * def _test_ndarray_dt64_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */
  __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_ndarray_dt64_type_check, 1293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) __PYX_ERR(1, 1293, __pyx_L1_error)

  /* "cytimes/utils.py":1306
 * 
 * 
 * def _test_ndarray_dt64_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */
  __pyx_tuple__200 = PyTuple_Pack(10, __pyx_n_s_np, __pyx_n_s_units, __pyx_n_s_my_unit, __pyx_n_s_arr, __pyx_n_s_arr_i, __pyx_n_s_to_unit, __pyx_n_s_cmp, __pyx_n_s_val, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(1, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__200);
  __Pyx_GIVEREF(__pyx_tuple__200);
  __pyx_codeobj__201 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__200, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_ndarray_dt64_conversion, 1306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__201)) __PYX_ERR(1, 1306, __pyx_L1_error)

  /* "cytimes/utils.py":1336
 * 
 * # . numpy.ndarray[timedelta64]
 * def _test_ndarray_td64_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */
  __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_ndarray_td64_type_check, 1336, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) __PYX_ERR(1, 1336, __pyx_L1_error)

  /* "cytimes/utils.py":1349
 * 
 * 
 * def _test_ndarray_td64_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */
  __pyx_tuple__203 = PyTuple_Pack(7, __pyx_n_s_np, __pyx_n_s_units, __pyx_n_s_my_unit, __pyx_n_s_arr, __pyx_n_s_cmp, __pyx_n_s_val, __pyx_n_s_i); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(1, 1349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__203);
  __Pyx_GIVEREF(__pyx_tuple__203);
  __pyx_codeobj__204 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__203, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_utils_py, __pyx_n_s_test_ndarray_td64_conversion, 1349, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__204)) __PYX_ERR(1, 1349, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
  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_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __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_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_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_1970 = PyInt_FromLong(1970); if (unlikely(!__pyx_int_1970)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_2021 = PyInt_FromLong(2021); if (unlikely(!__pyx_int_2021)) __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_10000 = PyInt_FromLong(10000L); if (unlikely(!__pyx_int_10000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_86399 = PyInt_FromLong(86399L); if (unlikely(!__pyx_int_86399)) __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_100000 = PyInt_FromLong(100000L); if (unlikely(!__pyx_int_100000)) __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_86400000000 = PyInt_FromString((char *)"86400000000", 0, 0); if (unlikely(!__pyx_int_86400000000)) __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)
  __pyx_int_neg_2 = PyInt_FromLong(-2); if (unlikely(!__pyx_int_neg_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_neg_3 = PyInt_FromLong(-3); if (unlikely(!__pyx_int_neg_3)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_neg_23 = PyInt_FromLong(-23); if (unlikely(!__pyx_int_neg_23)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_neg_59 = PyInt_FromLong(-59); if (unlikely(!__pyx_int_neg_59)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_neg_60 = PyInt_FromLong(-60); if (unlikely(!__pyx_int_neg_60)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_neg_1000 = PyInt_FromLong(-1000); if (unlikely(!__pyx_int_neg_1000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_neg_86399 = PyInt_FromLong(-86399L); if (unlikely(!__pyx_int_neg_86399)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_neg_86400 = PyInt_FromLong(-86400L); if (unlikely(!__pyx_int_neg_86400)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_neg_100000 = PyInt_FromLong(-100000L); if (unlikely(!__pyx_int_neg_100000)) __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_5utils_EPOCH_DT = ((PyDateTime_DateTime *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7cytimes_5utils_UTC = ((PyDateTime_TZInfo *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7cytimes_5utils__LOCAL_TZ = Py_None; Py_INCREF(Py_None);
  __pyx_v_7cytimes_5utils__TIMEZONE_MAP = ((PyObject*)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_5utils_DAYS_BR_MONTH, "int [13]") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DAYS_IN_MONTH, (void *)&__pyx_v_7cytimes_5utils_DAYS_IN_MONTH, "int [13]") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DAYS_BR_QUARTER, (void *)&__pyx_v_7cytimes_5utils_DAYS_BR_QUARTER, "int [5]") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DAYS_IN_QUARTER, (void *)&__pyx_v_7cytimes_5utils_DAYS_IN_QUARTER, "int [5]") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_ORDINAL_MAX, (void *)&__pyx_v_7cytimes_5utils_ORDINAL_MAX, "int") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_EPOCH_DT, (void *)&__pyx_v_7cytimes_5utils_EPOCH_DT, "PyDateTime_DateTime *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_EPOCH_YEAR, (void *)&__pyx_v_7cytimes_5utils_EPOCH_YEAR, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_EPOCH_MONTH, (void *)&__pyx_v_7cytimes_5utils_EPOCH_MONTH, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_EPOCH_DAY, (void *)&__pyx_v_7cytimes_5utils_EPOCH_DAY, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_EPOCH_HOUR, (void *)&__pyx_v_7cytimes_5utils_EPOCH_HOUR, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_EPOCH_MINUTE, (void *)&__pyx_v_7cytimes_5utils_EPOCH_MINUTE, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_EPOCH_SECOND, (void *)&__pyx_v_7cytimes_5utils_EPOCH_SECOND, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_EPOCH_MILLISECOND, (void *)&__pyx_v_7cytimes_5utils_EPOCH_MILLISECOND, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_EPOCH_MICROSECOND, (void *)&__pyx_v_7cytimes_5utils_EPOCH_MICROSECOND, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_UTC, (void *)&__pyx_v_7cytimes_5utils_UTC, "PyDateTime_TZInfo *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_LOCAL_TZ, (void *)&__pyx_v_7cytimes_5utils__LOCAL_TZ, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_TIMEZONE_MAP, (void *)&__pyx_v_7cytimes_5utils__TIMEZONE_MAP, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_SS_MINUTE, (void *)&__pyx_v_7cytimes_5utils_SS_MINUTE, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_SS_HOUR, (void *)&__pyx_v_7cytimes_5utils_SS_HOUR, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_SS_DAY, (void *)&__pyx_v_7cytimes_5utils_SS_DAY, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_MS_SECOND, (void *)&__pyx_v_7cytimes_5utils_MS_SECOND, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_MS_MINUTE, (void *)&__pyx_v_7cytimes_5utils_MS_MINUTE, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_MS_HOUR, (void *)&__pyx_v_7cytimes_5utils_MS_HOUR, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_MS_DAY, (void *)&__pyx_v_7cytimes_5utils_MS_DAY, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_US_MILLISECOND, (void *)&__pyx_v_7cytimes_5utils_US_MILLISECOND, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_US_SECOND, (void *)&__pyx_v_7cytimes_5utils_US_SECOND, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_US_MINUTE, (void *)&__pyx_v_7cytimes_5utils_US_MINUTE, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_US_HOUR, (void *)&__pyx_v_7cytimes_5utils_US_HOUR, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_US_DAY, (void *)&__pyx_v_7cytimes_5utils_US_DAY, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_NS_MICROSECOND, (void *)&__pyx_v_7cytimes_5utils_NS_MICROSECOND, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_NS_MILLISECOND, (void *)&__pyx_v_7cytimes_5utils_NS_MILLISECOND, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_NS_SECOND, (void *)&__pyx_v_7cytimes_5utils_NS_SECOND, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_NS_MINUTE, (void *)&__pyx_v_7cytimes_5utils_NS_MINUTE, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_NS_HOUR, (void *)&__pyx_v_7cytimes_5utils_NS_HOUR, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_NS_DAY, (void *)&__pyx_v_7cytimes_5utils_NS_DAY, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_TD64_YY_DAY, (void *)&__pyx_v_7cytimes_5utils_TD64_YY_DAY, "double") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_TD64_YY_SECOND, (void *)&__pyx_v_7cytimes_5utils_TD64_YY_SECOND, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_TD64_YY_MILLISECOND, (void *)&__pyx_v_7cytimes_5utils_TD64_YY_MILLISECOND, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_TD64_YY_MICROSECOND, (void *)&__pyx_v_7cytimes_5utils_TD64_YY_MICROSECOND, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_TD64_YY_NANOSECOND, (void *)&__pyx_v_7cytimes_5utils_TD64_YY_NANOSECOND, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_TD64_MM_DAY, (void *)&__pyx_v_7cytimes_5utils_TD64_MM_DAY, "double") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_TD64_MM_SECOND, (void *)&__pyx_v_7cytimes_5utils_TD64_MM_SECOND, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_TD64_MM_MILLISECOND, (void *)&__pyx_v_7cytimes_5utils_TD64_MM_MILLISECOND, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_TD64_MM_MICROSECOND, (void *)&__pyx_v_7cytimes_5utils_TD64_MM_MICROSECOND, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_TD64_MM_NANOSECOND, (void *)&__pyx_v_7cytimes_5utils_TD64_MM_NANOSECOND, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_YY_MIN, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_YY_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_MM_MIN, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_MM_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_WW_MIN, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_WW_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_DD_MIN, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_DD_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_HH_MIN, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_HH_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_MI_MIN, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_MI_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_SS_MIN, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_SS_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_MS_MIN, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_MS_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_US_MIN, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_US_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_NS_MIN, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_NS_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_YY_MAX, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_YY_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_MM_MAX, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_MM_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_WW_MAX, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_WW_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_DD_MAX, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_DD_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_HH_MAX, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_HH_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_MI_MAX, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_MI_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_SS_MAX, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_SS_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_MS_MAX, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_MS_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_US_MAX, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_US_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT64_NS_NS_MAX, (void *)&__pyx_v_7cytimes_5utils_DT64_NS_NS_MAX, "PY_LONG_LONG") < 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("tz_parse", (void (*)(void))__pyx_f_7cytimes_5utils_tz_parse, "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_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", 
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(6, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyBoolObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(7, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyComplexObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(8, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_12); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 272, __pyx_L1_error)
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_12); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 317, __pyx_L1_error)
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_12); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 321, __pyx_L1_error)
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_12); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 360, __pyx_L1_error)
  __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 865, __pyx_L1_error)
  __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 867, __pyx_L1_error)
  __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 869, __pyx_L1_error)
  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 871, __pyx_L1_error)
  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 873, __pyx_L1_error)
  __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 875, __pyx_L1_error)
  __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 877, __pyx_L1_error)
  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 879, __pyx_L1_error)
  __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 881, __pyx_L1_error)
  __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 883, __pyx_L1_error)
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_12); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 947, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("datetime"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_8datetime_date = __Pyx_ImportType_3_0_12(__pyx_t_1, "datetime", "date", sizeof(PyDateTime_Date), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyDateTime_Date),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_8datetime_date) __PYX_ERR(4, 70, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_time = __Pyx_ImportType_3_0_12(__pyx_t_1, "datetime", "time", sizeof(PyDateTime_Time), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyDateTime_Time),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_8datetime_time) __PYX_ERR(4, 83, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_datetime = __Pyx_ImportType_3_0_12(__pyx_t_1, "datetime", "datetime", sizeof(PyDateTime_DateTime), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyDateTime_DateTime),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_8datetime_datetime) __PYX_ERR(4, 109, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_timedelta = __Pyx_ImportType_3_0_12(__pyx_t_1, "datetime", "timedelta", sizeof(PyDateTime_Delta), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyDateTime_Delta),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_8datetime_timedelta) __PYX_ERR(4, 147, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_tzinfo = __Pyx_ImportType_3_0_12(__pyx_t_1, "datetime", "tzinfo", sizeof(PyDateTime_TZInfo), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyDateTime_TZInfo),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_8datetime_tzinfo) __PYX_ERR(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_12(__pyx_t_1, "ZONEINFO", (void **)&__pyx_vp_7cytimes_7typeref_ZONEINFO, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "TIMEZONE", (void **)&__pyx_vp_7cytimes_7typeref_TIMEZONE, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "PARSERINFO", (void **)&__pyx_vp_7cytimes_7typeref_PARSERINFO, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__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_utils(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_utils},
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "utils",
      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 initutils(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initutils(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_utils(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_utils(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#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_utils(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 int __pyx_t_5[13];
  static int __pyx_t_6[13];
  static int __pyx_t_7[5];
  static int __pyx_t_8[5];
  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_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'utils' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("utils", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  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 "utils" 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_utils(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__utils) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "cytimes.utils")) {
      if (unlikely((PyDict_SetItemString(modules, "cytimes.utils", __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/utils.py":11
 * 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, 11, __pyx_L1_error)

  /* "cytimes/utils.py":12
 * 
 * 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, 12, __pyx_L1_error)

  /* "cytimes/utils.py":13
 * np.import_array()
 * np.import_umath()
 * datetime.import_datetime()             # <<<<<<<<<<<<<<
 * 
 * # Python imports
 */
  __pyx_f_7cpython_8datetime_import_datetime();

  /* "cytimes/utils.py":16
 * 
 * # Python imports
 * import datetime, numpy as np             # <<<<<<<<<<<<<<
 * from zoneinfo import ZoneInfo
 * from cytimes import typeref, errors
 */
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_3) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_3) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":17
 * # Python imports
 * import datetime, numpy as np
 * from zoneinfo import ZoneInfo             # <<<<<<<<<<<<<<
 * from cytimes import typeref, errors
 * 
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_ZoneInfo);
  __Pyx_GIVEREF(__pyx_n_s_ZoneInfo);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ZoneInfo)) __PYX_ERR(1, 17, __pyx_L1_error);
  __pyx_t_4 = __Pyx_Import(__pyx_n_s_zoneinfo, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 17, __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_ZoneInfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ZoneInfo, __pyx_t_3) < 0) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":18
 * import datetime, numpy as np
 * from zoneinfo import ZoneInfo
 * from cytimes import typeref, errors             # <<<<<<<<<<<<<<
 * 
 * # Constants --------------------------------------------------------------------------------------------
 */
  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 18, __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, 18, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_s_errors);
  __Pyx_GIVEREF(__pyx_n_s_errors);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_errors)) __PYX_ERR(1, 18, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_cytimes, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 18, __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, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_typeref, __pyx_t_4) < 0) __PYX_ERR(1, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_errors, __pyx_t_4) < 0) __PYX_ERR(1, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":23
 * # . calendar
 * # fmt: off
 * DAYS_BR_MONTH: cython.int[13] = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]             # <<<<<<<<<<<<<<
 * DAYS_IN_MONTH: cython.int[13] = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
 * DAYS_BR_QUARTER: cython.int[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_5utils_DAYS_BR_MONTH[0]), __pyx_t_5, sizeof(__pyx_v_7cytimes_5utils_DAYS_BR_MONTH[0]) * (13));

  /* "cytimes/utils.py":24
 * # fmt: off
 * DAYS_BR_MONTH: cython.int[13] = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]
 * DAYS_IN_MONTH: cython.int[13] = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]             # <<<<<<<<<<<<<<
 * DAYS_BR_QUARTER: cython.int[5] = [0, 90, 181, 273, 365]
 * DAYS_IN_QUARTER: cython.int[5] = [0, 90, 91, 92, 92]
 */
  __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_5utils_DAYS_IN_MONTH[0]), __pyx_t_6, sizeof(__pyx_v_7cytimes_5utils_DAYS_IN_MONTH[0]) * (13));

  /* "cytimes/utils.py":25
 * DAYS_BR_MONTH: cython.int[13] = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]
 * DAYS_IN_MONTH: cython.int[13] = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
 * DAYS_BR_QUARTER: cython.int[5] = [0, 90, 181, 273, 365]             # <<<<<<<<<<<<<<
 * DAYS_IN_QUARTER: cython.int[5] = [0, 90, 91, 92, 92]
 * # fmt: on
 */
  __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_5utils_DAYS_BR_QUARTER[0]), __pyx_t_7, sizeof(__pyx_v_7cytimes_5utils_DAYS_BR_QUARTER[0]) * (5));

  /* "cytimes/utils.py":26
 * DAYS_IN_MONTH: cython.int[13] = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
 * DAYS_BR_QUARTER: cython.int[5] = [0, 90, 181, 273, 365]
 * DAYS_IN_QUARTER: cython.int[5] = [0, 90, 91, 92, 92]             # <<<<<<<<<<<<<<
 * # fmt: on
 * # . date
 */
  __pyx_t_8[0] = 0;
  __pyx_t_8[1] = 90;
  __pyx_t_8[2] = 91;
  __pyx_t_8[3] = 92;
  __pyx_t_8[4] = 92;
  memcpy(&(__pyx_v_7cytimes_5utils_DAYS_IN_QUARTER[0]), __pyx_t_8, sizeof(__pyx_v_7cytimes_5utils_DAYS_IN_QUARTER[0]) * (5));

  /* "cytimes/utils.py":29
 * # fmt: on
 * # . date
 * ORDINAL_MAX: cython.int = 3_652_059             # <<<<<<<<<<<<<<
 * # . datetime
 * #: EPOCH (1970-01-01)
 */
  __pyx_v_7cytimes_5utils_ORDINAL_MAX = 0x37B9DB;

  /* "cytimes/utils.py":33
 * #: EPOCH (1970-01-01)
 * EPOCH_DT: datetime.datetime = datetime.datetime_new(
 *     1970, 1, 1, 0, 0, 0, 0, datetime.get_utc(), 0             # <<<<<<<<<<<<<<
 * )
 * EPOCH_YEAR: cython.longlong = 1970
 */
  __pyx_t_3 = __pyx_f_7cpython_8datetime_get_utc(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cytimes/utils.py":32
 * # . datetime
 * #: EPOCH (1970-01-01)
 * EPOCH_DT: datetime.datetime = datetime.datetime_new(             # <<<<<<<<<<<<<<
 *     1970, 1, 1, 0, 0, 0, 0, datetime.get_utc(), 0
 * )
 */
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.fold = 0;
  __pyx_t_4 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x7B2, 1, 1, 0, 0, 0, 0, __pyx_t_3, &__pyx_t_9)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_XGOTREF((PyObject *)__pyx_v_7cytimes_5utils_EPOCH_DT);
  __Pyx_DECREF_SET(__pyx_v_7cytimes_5utils_EPOCH_DT, ((PyDateTime_DateTime *)__pyx_t_4));
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":35
 *     1970, 1, 1, 0, 0, 0, 0, datetime.get_utc(), 0
 * )
 * EPOCH_YEAR: cython.longlong = 1970             # <<<<<<<<<<<<<<
 * EPOCH_MONTH: cython.longlong = 23_628
 * EPOCH_DAY: cython.longlong = 719_163
 */
  __pyx_v_7cytimes_5utils_EPOCH_YEAR = 0x7B2;

  /* "cytimes/utils.py":36
 * )
 * EPOCH_YEAR: cython.longlong = 1970
 * EPOCH_MONTH: cython.longlong = 23_628             # <<<<<<<<<<<<<<
 * EPOCH_DAY: cython.longlong = 719_163
 * EPOCH_HOUR: cython.longlong = EPOCH_DAY * 24
 */
  __pyx_v_7cytimes_5utils_EPOCH_MONTH = 0x5C4C;

  /* "cytimes/utils.py":37
 * EPOCH_YEAR: cython.longlong = 1970
 * EPOCH_MONTH: cython.longlong = 23_628
 * EPOCH_DAY: cython.longlong = 719_163             # <<<<<<<<<<<<<<
 * EPOCH_HOUR: cython.longlong = EPOCH_DAY * 24
 * EPOCH_MINUTE: cython.longlong = EPOCH_HOUR * 60
 */
  __pyx_v_7cytimes_5utils_EPOCH_DAY = 0xAF93B;

  /* "cytimes/utils.py":38
 * EPOCH_MONTH: cython.longlong = 23_628
 * EPOCH_DAY: cython.longlong = 719_163
 * EPOCH_HOUR: cython.longlong = EPOCH_DAY * 24             # <<<<<<<<<<<<<<
 * EPOCH_MINUTE: cython.longlong = EPOCH_HOUR * 60
 * EPOCH_SECOND: cython.longlong = EPOCH_MINUTE * 60
 */
  __pyx_v_7cytimes_5utils_EPOCH_HOUR = (__pyx_v_7cytimes_5utils_EPOCH_DAY * 24);

  /* "cytimes/utils.py":39
 * EPOCH_DAY: cython.longlong = 719_163
 * EPOCH_HOUR: cython.longlong = EPOCH_DAY * 24
 * EPOCH_MINUTE: cython.longlong = EPOCH_HOUR * 60             # <<<<<<<<<<<<<<
 * EPOCH_SECOND: cython.longlong = EPOCH_MINUTE * 60
 * EPOCH_MILLISECOND: cython.longlong = EPOCH_SECOND * 1_000
 */
  __pyx_v_7cytimes_5utils_EPOCH_MINUTE = (__pyx_v_7cytimes_5utils_EPOCH_HOUR * 60);

  /* "cytimes/utils.py":40
 * EPOCH_HOUR: cython.longlong = EPOCH_DAY * 24
 * EPOCH_MINUTE: cython.longlong = EPOCH_HOUR * 60
 * EPOCH_SECOND: cython.longlong = EPOCH_MINUTE * 60             # <<<<<<<<<<<<<<
 * EPOCH_MILLISECOND: cython.longlong = EPOCH_SECOND * 1_000
 * EPOCH_MICROSECOND: cython.longlong = EPOCH_MILLISECOND * 1_000
 */
  __pyx_v_7cytimes_5utils_EPOCH_SECOND = (__pyx_v_7cytimes_5utils_EPOCH_MINUTE * 60);

  /* "cytimes/utils.py":41
 * EPOCH_MINUTE: cython.longlong = EPOCH_HOUR * 60
 * EPOCH_SECOND: cython.longlong = EPOCH_MINUTE * 60
 * EPOCH_MILLISECOND: cython.longlong = EPOCH_SECOND * 1_000             # <<<<<<<<<<<<<<
 * EPOCH_MICROSECOND: cython.longlong = EPOCH_MILLISECOND * 1_000
 * # . timezone
 */
  __pyx_v_7cytimes_5utils_EPOCH_MILLISECOND = (__pyx_v_7cytimes_5utils_EPOCH_SECOND * 0x3E8);

  /* "cytimes/utils.py":42
 * EPOCH_SECOND: cython.longlong = EPOCH_MINUTE * 60
 * EPOCH_MILLISECOND: cython.longlong = EPOCH_SECOND * 1_000
 * EPOCH_MICROSECOND: cython.longlong = EPOCH_MILLISECOND * 1_000             # <<<<<<<<<<<<<<
 * # . timezone
 * UTC: datetime.tzinfo = datetime.get_utc()
 */
  __pyx_v_7cytimes_5utils_EPOCH_MICROSECOND = (__pyx_v_7cytimes_5utils_EPOCH_MILLISECOND * 0x3E8);

  /* "cytimes/utils.py":44
 * EPOCH_MICROSECOND: cython.longlong = EPOCH_MILLISECOND * 1_000
 * # . timezone
 * UTC: datetime.tzinfo = datetime.get_utc()             # <<<<<<<<<<<<<<
 * # . conversion for seconds
 * SS_MINUTE: cython.longlong = 60
 */
  __pyx_t_4 = __pyx_f_7cpython_8datetime_get_utc(); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7cpython_8datetime_tzinfo))))) __PYX_ERR(1, 44, __pyx_L1_error)
  __Pyx_XGOTREF((PyObject *)__pyx_v_7cytimes_5utils_UTC);
  __Pyx_DECREF_SET(__pyx_v_7cytimes_5utils_UTC, ((PyDateTime_TZInfo *)__pyx_t_4));
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":46
 * UTC: datetime.tzinfo = datetime.get_utc()
 * # . conversion for seconds
 * SS_MINUTE: cython.longlong = 60             # <<<<<<<<<<<<<<
 * SS_HOUR: cython.longlong = SS_MINUTE * 60
 * SS_DAY: cython.longlong = SS_HOUR * 24
 */
  __pyx_v_7cytimes_5utils_SS_MINUTE = 60;

  /* "cytimes/utils.py":47
 * # . conversion for seconds
 * SS_MINUTE: cython.longlong = 60
 * SS_HOUR: cython.longlong = SS_MINUTE * 60             # <<<<<<<<<<<<<<
 * SS_DAY: cython.longlong = SS_HOUR * 24
 * # . conversion for milliseconds
 */
  __pyx_v_7cytimes_5utils_SS_HOUR = (__pyx_v_7cytimes_5utils_SS_MINUTE * 60);

  /* "cytimes/utils.py":48
 * SS_MINUTE: cython.longlong = 60
 * SS_HOUR: cython.longlong = SS_MINUTE * 60
 * SS_DAY: cython.longlong = SS_HOUR * 24             # <<<<<<<<<<<<<<
 * # . conversion for milliseconds
 * MS_SECOND: cython.longlong = 1_000
 */
  __pyx_v_7cytimes_5utils_SS_DAY = (__pyx_v_7cytimes_5utils_SS_HOUR * 24);

  /* "cytimes/utils.py":50
 * SS_DAY: cython.longlong = SS_HOUR * 24
 * # . conversion for milliseconds
 * MS_SECOND: cython.longlong = 1_000             # <<<<<<<<<<<<<<
 * MS_MINUTE: cython.longlong = MS_SECOND * 60
 * MS_HOUR: cython.longlong = MS_MINUTE * 60
 */
  __pyx_v_7cytimes_5utils_MS_SECOND = 0x3E8;

  /* "cytimes/utils.py":51
 * # . conversion for milliseconds
 * MS_SECOND: cython.longlong = 1_000
 * MS_MINUTE: cython.longlong = MS_SECOND * 60             # <<<<<<<<<<<<<<
 * MS_HOUR: cython.longlong = MS_MINUTE * 60
 * MS_DAY: cython.longlong = MS_HOUR * 24
 */
  __pyx_v_7cytimes_5utils_MS_MINUTE = (__pyx_v_7cytimes_5utils_MS_SECOND * 60);

  /* "cytimes/utils.py":52
 * MS_SECOND: cython.longlong = 1_000
 * MS_MINUTE: cython.longlong = MS_SECOND * 60
 * MS_HOUR: cython.longlong = MS_MINUTE * 60             # <<<<<<<<<<<<<<
 * MS_DAY: cython.longlong = MS_HOUR * 24
 * # . conversion for microseconds
 */
  __pyx_v_7cytimes_5utils_MS_HOUR = (__pyx_v_7cytimes_5utils_MS_MINUTE * 60);

  /* "cytimes/utils.py":53
 * MS_MINUTE: cython.longlong = MS_SECOND * 60
 * MS_HOUR: cython.longlong = MS_MINUTE * 60
 * MS_DAY: cython.longlong = MS_HOUR * 24             # <<<<<<<<<<<<<<
 * # . conversion for microseconds
 * US_MILLISECOND: cython.longlong = 1_000
 */
  __pyx_v_7cytimes_5utils_MS_DAY = (__pyx_v_7cytimes_5utils_MS_HOUR * 24);

  /* "cytimes/utils.py":55
 * MS_DAY: cython.longlong = MS_HOUR * 24
 * # . conversion for microseconds
 * US_MILLISECOND: cython.longlong = 1_000             # <<<<<<<<<<<<<<
 * US_SECOND: cython.longlong = US_MILLISECOND * 1_000
 * US_MINUTE: cython.longlong = US_SECOND * 60
 */
  __pyx_v_7cytimes_5utils_US_MILLISECOND = 0x3E8;

  /* "cytimes/utils.py":56
 * # . conversion for microseconds
 * US_MILLISECOND: cython.longlong = 1_000
 * US_SECOND: cython.longlong = US_MILLISECOND * 1_000             # <<<<<<<<<<<<<<
 * US_MINUTE: cython.longlong = US_SECOND * 60
 * US_HOUR: cython.longlong = US_MINUTE * 60
 */
  __pyx_v_7cytimes_5utils_US_SECOND = (__pyx_v_7cytimes_5utils_US_MILLISECOND * 0x3E8);

  /* "cytimes/utils.py":57
 * US_MILLISECOND: cython.longlong = 1_000
 * US_SECOND: cython.longlong = US_MILLISECOND * 1_000
 * US_MINUTE: cython.longlong = US_SECOND * 60             # <<<<<<<<<<<<<<
 * US_HOUR: cython.longlong = US_MINUTE * 60
 * US_DAY: cython.longlong = US_HOUR * 24
 */
  __pyx_v_7cytimes_5utils_US_MINUTE = (__pyx_v_7cytimes_5utils_US_SECOND * 60);

  /* "cytimes/utils.py":58
 * US_SECOND: cython.longlong = US_MILLISECOND * 1_000
 * US_MINUTE: cython.longlong = US_SECOND * 60
 * US_HOUR: cython.longlong = US_MINUTE * 60             # <<<<<<<<<<<<<<
 * US_DAY: cython.longlong = US_HOUR * 24
 * # . conversion for nanoseconds
 */
  __pyx_v_7cytimes_5utils_US_HOUR = (__pyx_v_7cytimes_5utils_US_MINUTE * 60);

  /* "cytimes/utils.py":59
 * US_MINUTE: cython.longlong = US_SECOND * 60
 * US_HOUR: cython.longlong = US_MINUTE * 60
 * US_DAY: cython.longlong = US_HOUR * 24             # <<<<<<<<<<<<<<
 * # . conversion for nanoseconds
 * NS_MICROSECOND: cython.longlong = 1_000
 */
  __pyx_v_7cytimes_5utils_US_DAY = (__pyx_v_7cytimes_5utils_US_HOUR * 24);

  /* "cytimes/utils.py":61
 * US_DAY: cython.longlong = US_HOUR * 24
 * # . conversion for nanoseconds
 * NS_MICROSECOND: cython.longlong = 1_000             # <<<<<<<<<<<<<<
 * NS_MILLISECOND: cython.longlong = NS_MICROSECOND * 1_000
 * NS_SECOND: cython.longlong = NS_MILLISECOND * 1_000
 */
  __pyx_v_7cytimes_5utils_NS_MICROSECOND = 0x3E8;

  /* "cytimes/utils.py":62
 * # . conversion for nanoseconds
 * NS_MICROSECOND: cython.longlong = 1_000
 * NS_MILLISECOND: cython.longlong = NS_MICROSECOND * 1_000             # <<<<<<<<<<<<<<
 * NS_SECOND: cython.longlong = NS_MILLISECOND * 1_000
 * NS_MINUTE: cython.longlong = NS_SECOND * 60
 */
  __pyx_v_7cytimes_5utils_NS_MILLISECOND = (__pyx_v_7cytimes_5utils_NS_MICROSECOND * 0x3E8);

  /* "cytimes/utils.py":63
 * NS_MICROSECOND: cython.longlong = 1_000
 * NS_MILLISECOND: cython.longlong = NS_MICROSECOND * 1_000
 * NS_SECOND: cython.longlong = NS_MILLISECOND * 1_000             # <<<<<<<<<<<<<<
 * NS_MINUTE: cython.longlong = NS_SECOND * 60
 * NS_HOUR: cython.longlong = NS_MINUTE * 60
 */
  __pyx_v_7cytimes_5utils_NS_SECOND = (__pyx_v_7cytimes_5utils_NS_MILLISECOND * 0x3E8);

  /* "cytimes/utils.py":64
 * NS_MILLISECOND: cython.longlong = NS_MICROSECOND * 1_000
 * NS_SECOND: cython.longlong = NS_MILLISECOND * 1_000
 * NS_MINUTE: cython.longlong = NS_SECOND * 60             # <<<<<<<<<<<<<<
 * NS_HOUR: cython.longlong = NS_MINUTE * 60
 * NS_DAY: cython.longlong = NS_HOUR * 24
 */
  __pyx_v_7cytimes_5utils_NS_MINUTE = (__pyx_v_7cytimes_5utils_NS_SECOND * 60);

  /* "cytimes/utils.py":65
 * NS_SECOND: cython.longlong = NS_MILLISECOND * 1_000
 * NS_MINUTE: cython.longlong = NS_SECOND * 60
 * NS_HOUR: cython.longlong = NS_MINUTE * 60             # <<<<<<<<<<<<<<
 * NS_DAY: cython.longlong = NS_HOUR * 24
 * # . conversion for timedelta64
 */
  __pyx_v_7cytimes_5utils_NS_HOUR = (__pyx_v_7cytimes_5utils_NS_MINUTE * 60);

  /* "cytimes/utils.py":66
 * NS_MINUTE: cython.longlong = NS_SECOND * 60
 * NS_HOUR: cython.longlong = NS_MINUTE * 60
 * NS_DAY: cython.longlong = NS_HOUR * 24             # <<<<<<<<<<<<<<
 * # . conversion for timedelta64
 * TD64_YY_DAY: cython.double = 365.2425  # Exact days in a year for td64
 */
  __pyx_v_7cytimes_5utils_NS_DAY = (__pyx_v_7cytimes_5utils_NS_HOUR * 24);

  /* "cytimes/utils.py":68
 * NS_DAY: cython.longlong = NS_HOUR * 24
 * # . conversion for timedelta64
 * TD64_YY_DAY: cython.double = 365.2425  # Exact days in a year for td64             # <<<<<<<<<<<<<<
 * TD64_YY_SECOND: cython.longlong = int(TD64_YY_DAY * SS_DAY)
 * TD64_YY_MILLISECOND: cython.longlong = TD64_YY_SECOND * 1_000
 */
  __pyx_v_7cytimes_5utils_TD64_YY_DAY = 365.2425;

  /* "cytimes/utils.py":69
 * # . conversion for timedelta64
 * TD64_YY_DAY: cython.double = 365.2425  # Exact days in a year for td64
 * TD64_YY_SECOND: cython.longlong = int(TD64_YY_DAY * SS_DAY)             # <<<<<<<<<<<<<<
 * TD64_YY_MILLISECOND: cython.longlong = TD64_YY_SECOND * 1_000
 * TD64_YY_MICROSECOND: cython.longlong = TD64_YY_MILLISECOND * 1_000
 */
  __pyx_v_7cytimes_5utils_TD64_YY_SECOND = ((PY_LONG_LONG)(__pyx_v_7cytimes_5utils_TD64_YY_DAY * __pyx_v_7cytimes_5utils_SS_DAY));

  /* "cytimes/utils.py":70
 * TD64_YY_DAY: cython.double = 365.2425  # Exact days in a year for td64
 * TD64_YY_SECOND: cython.longlong = int(TD64_YY_DAY * SS_DAY)
 * TD64_YY_MILLISECOND: cython.longlong = TD64_YY_SECOND * 1_000             # <<<<<<<<<<<<<<
 * TD64_YY_MICROSECOND: cython.longlong = TD64_YY_MILLISECOND * 1_000
 * TD64_YY_NANOSECOND: cython.longlong = TD64_YY_MICROSECOND * 1_000
 */
  __pyx_v_7cytimes_5utils_TD64_YY_MILLISECOND = (__pyx_v_7cytimes_5utils_TD64_YY_SECOND * 0x3E8);

  /* "cytimes/utils.py":71
 * TD64_YY_SECOND: cython.longlong = int(TD64_YY_DAY * SS_DAY)
 * TD64_YY_MILLISECOND: cython.longlong = TD64_YY_SECOND * 1_000
 * TD64_YY_MICROSECOND: cython.longlong = TD64_YY_MILLISECOND * 1_000             # <<<<<<<<<<<<<<
 * TD64_YY_NANOSECOND: cython.longlong = TD64_YY_MICROSECOND * 1_000
 * TD64_MM_DAY: cython.double = 30.436875  # Exact days in a month for td64
 */
  __pyx_v_7cytimes_5utils_TD64_YY_MICROSECOND = (__pyx_v_7cytimes_5utils_TD64_YY_MILLISECOND * 0x3E8);

  /* "cytimes/utils.py":72
 * TD64_YY_MILLISECOND: cython.longlong = TD64_YY_SECOND * 1_000
 * TD64_YY_MICROSECOND: cython.longlong = TD64_YY_MILLISECOND * 1_000
 * TD64_YY_NANOSECOND: cython.longlong = TD64_YY_MICROSECOND * 1_000             # <<<<<<<<<<<<<<
 * TD64_MM_DAY: cython.double = 30.436875  # Exact days in a month for td64
 * TD64_MM_SECOND: cython.longlong = int(TD64_MM_DAY * SS_DAY)
 */
  __pyx_v_7cytimes_5utils_TD64_YY_NANOSECOND = (__pyx_v_7cytimes_5utils_TD64_YY_MICROSECOND * 0x3E8);

  /* "cytimes/utils.py":73
 * TD64_YY_MICROSECOND: cython.longlong = TD64_YY_MILLISECOND * 1_000
 * TD64_YY_NANOSECOND: cython.longlong = TD64_YY_MICROSECOND * 1_000
 * TD64_MM_DAY: cython.double = 30.436875  # Exact days in a month for td64             # <<<<<<<<<<<<<<
 * TD64_MM_SECOND: cython.longlong = int(TD64_MM_DAY * SS_DAY)
 * TD64_MM_MILLISECOND: cython.longlong = TD64_MM_SECOND * 1_000
 */
  __pyx_v_7cytimes_5utils_TD64_MM_DAY = 30.436875;

  /* "cytimes/utils.py":74
 * TD64_YY_NANOSECOND: cython.longlong = TD64_YY_MICROSECOND * 1_000
 * TD64_MM_DAY: cython.double = 30.436875  # Exact days in a month for td64
 * TD64_MM_SECOND: cython.longlong = int(TD64_MM_DAY * SS_DAY)             # <<<<<<<<<<<<<<
 * TD64_MM_MILLISECOND: cython.longlong = TD64_MM_SECOND * 1_000
 * TD64_MM_MICROSECOND: cython.longlong = TD64_MM_MILLISECOND * 1_000
 */
  __pyx_v_7cytimes_5utils_TD64_MM_SECOND = ((PY_LONG_LONG)(__pyx_v_7cytimes_5utils_TD64_MM_DAY * __pyx_v_7cytimes_5utils_SS_DAY));

  /* "cytimes/utils.py":75
 * TD64_MM_DAY: cython.double = 30.436875  # Exact days in a month for td64
 * TD64_MM_SECOND: cython.longlong = int(TD64_MM_DAY * SS_DAY)
 * TD64_MM_MILLISECOND: cython.longlong = TD64_MM_SECOND * 1_000             # <<<<<<<<<<<<<<
 * TD64_MM_MICROSECOND: cython.longlong = TD64_MM_MILLISECOND * 1_000
 * TD64_MM_NANOSECOND: cython.longlong = TD64_MM_MICROSECOND * 1_000
 */
  __pyx_v_7cytimes_5utils_TD64_MM_MILLISECOND = (__pyx_v_7cytimes_5utils_TD64_MM_SECOND * 0x3E8);

  /* "cytimes/utils.py":76
 * TD64_MM_SECOND: cython.longlong = int(TD64_MM_DAY * SS_DAY)
 * TD64_MM_MILLISECOND: cython.longlong = TD64_MM_SECOND * 1_000
 * TD64_MM_MICROSECOND: cython.longlong = TD64_MM_MILLISECOND * 1_000             # <<<<<<<<<<<<<<
 * TD64_MM_NANOSECOND: cython.longlong = TD64_MM_MICROSECOND * 1_000
 * # . datetime64 range
 */
  __pyx_v_7cytimes_5utils_TD64_MM_MICROSECOND = (__pyx_v_7cytimes_5utils_TD64_MM_MILLISECOND * 0x3E8);

  /* "cytimes/utils.py":77
 * TD64_MM_MILLISECOND: cython.longlong = TD64_MM_SECOND * 1_000
 * TD64_MM_MICROSECOND: cython.longlong = TD64_MM_MILLISECOND * 1_000
 * TD64_MM_NANOSECOND: cython.longlong = TD64_MM_MICROSECOND * 1_000             # <<<<<<<<<<<<<<
 * # . datetime64 range
 * #: Minimum datetime64 in nanoseconds (1677-09-21 00:12:43.145224193)
 */
  __pyx_v_7cytimes_5utils_TD64_MM_NANOSECOND = (__pyx_v_7cytimes_5utils_TD64_MM_MICROSECOND * 0x3E8);

  /* "cytimes/utils.py":80
 * # . datetime64 range
 * #: Minimum datetime64 in nanoseconds (1677-09-21 00:12:43.145224193)
 * DT64_NS_YY_MIN: cython.longlong = -293  # >= 1678             # <<<<<<<<<<<<<<
 * DT64_NS_MM_MIN: cython.longlong = -3_508  # >= 1677-10
 * DT64_NS_WW_MIN: cython.longlong = -15_251  # >= 1677-09-30
 */
  __pyx_v_7cytimes_5utils_DT64_NS_YY_MIN = -293LL;

  /* "cytimes/utils.py":81
 * #: Minimum datetime64 in nanoseconds (1677-09-21 00:12:43.145224193)
 * DT64_NS_YY_MIN: cython.longlong = -293  # >= 1678
 * DT64_NS_MM_MIN: cython.longlong = -3_508  # >= 1677-10             # <<<<<<<<<<<<<<
 * DT64_NS_WW_MIN: cython.longlong = -15_251  # >= 1677-09-30
 * DT64_NS_DD_MIN: cython.longlong = -106_751  # >= 1677-09-22
 */
  __pyx_v_7cytimes_5utils_DT64_NS_MM_MIN = -3508LL;

  /* "cytimes/utils.py":82
 * DT64_NS_YY_MIN: cython.longlong = -293  # >= 1678
 * DT64_NS_MM_MIN: cython.longlong = -3_508  # >= 1677-10
 * DT64_NS_WW_MIN: cython.longlong = -15_251  # >= 1677-09-30             # <<<<<<<<<<<<<<
 * DT64_NS_DD_MIN: cython.longlong = -106_751  # >= 1677-09-22
 * DT64_NS_HH_MIN: cython.longlong = DT64_NS_DD_MIN * 24
 */
  __pyx_v_7cytimes_5utils_DT64_NS_WW_MIN = -15251LL;

  /* "cytimes/utils.py":83
 * DT64_NS_MM_MIN: cython.longlong = -3_508  # >= 1677-10
 * DT64_NS_WW_MIN: cython.longlong = -15_251  # >= 1677-09-30
 * DT64_NS_DD_MIN: cython.longlong = -106_751  # >= 1677-09-22             # <<<<<<<<<<<<<<
 * DT64_NS_HH_MIN: cython.longlong = DT64_NS_DD_MIN * 24
 * DT64_NS_MI_MIN: cython.longlong = DT64_NS_HH_MIN * 60
 */
  __pyx_v_7cytimes_5utils_DT64_NS_DD_MIN = -106751LL;

  /* "cytimes/utils.py":84
 * DT64_NS_WW_MIN: cython.longlong = -15_251  # >= 1677-09-30
 * DT64_NS_DD_MIN: cython.longlong = -106_751  # >= 1677-09-22
 * DT64_NS_HH_MIN: cython.longlong = DT64_NS_DD_MIN * 24             # <<<<<<<<<<<<<<
 * DT64_NS_MI_MIN: cython.longlong = DT64_NS_HH_MIN * 60
 * DT64_NS_SS_MIN: cython.longlong = DT64_NS_MI_MIN * 60
 */
  __pyx_v_7cytimes_5utils_DT64_NS_HH_MIN = (__pyx_v_7cytimes_5utils_DT64_NS_DD_MIN * 24);

  /* "cytimes/utils.py":85
 * DT64_NS_DD_MIN: cython.longlong = -106_751  # >= 1677-09-22
 * DT64_NS_HH_MIN: cython.longlong = DT64_NS_DD_MIN * 24
 * DT64_NS_MI_MIN: cython.longlong = DT64_NS_HH_MIN * 60             # <<<<<<<<<<<<<<
 * DT64_NS_SS_MIN: cython.longlong = DT64_NS_MI_MIN * 60
 * DT64_NS_MS_MIN: cython.longlong = DT64_NS_SS_MIN * 1_000
 */
  __pyx_v_7cytimes_5utils_DT64_NS_MI_MIN = (__pyx_v_7cytimes_5utils_DT64_NS_HH_MIN * 60);

  /* "cytimes/utils.py":86
 * DT64_NS_HH_MIN: cython.longlong = DT64_NS_DD_MIN * 24
 * DT64_NS_MI_MIN: cython.longlong = DT64_NS_HH_MIN * 60
 * DT64_NS_SS_MIN: cython.longlong = DT64_NS_MI_MIN * 60             # <<<<<<<<<<<<<<
 * DT64_NS_MS_MIN: cython.longlong = DT64_NS_SS_MIN * 1_000
 * DT64_NS_US_MIN: cython.longlong = DT64_NS_MS_MIN * 1_000
 */
  __pyx_v_7cytimes_5utils_DT64_NS_SS_MIN = (__pyx_v_7cytimes_5utils_DT64_NS_MI_MIN * 60);

  /* "cytimes/utils.py":87
 * DT64_NS_MI_MIN: cython.longlong = DT64_NS_HH_MIN * 60
 * DT64_NS_SS_MIN: cython.longlong = DT64_NS_MI_MIN * 60
 * DT64_NS_MS_MIN: cython.longlong = DT64_NS_SS_MIN * 1_000             # <<<<<<<<<<<<<<
 * DT64_NS_US_MIN: cython.longlong = DT64_NS_MS_MIN * 1_000
 * DT64_NS_NS_MIN: cython.longlong = DT64_NS_US_MIN * 1_000
 */
  __pyx_v_7cytimes_5utils_DT64_NS_MS_MIN = (__pyx_v_7cytimes_5utils_DT64_NS_SS_MIN * 0x3E8);

  /* "cytimes/utils.py":88
 * DT64_NS_SS_MIN: cython.longlong = DT64_NS_MI_MIN * 60
 * DT64_NS_MS_MIN: cython.longlong = DT64_NS_SS_MIN * 1_000
 * DT64_NS_US_MIN: cython.longlong = DT64_NS_MS_MIN * 1_000             # <<<<<<<<<<<<<<
 * DT64_NS_NS_MIN: cython.longlong = DT64_NS_US_MIN * 1_000
 * #: Maximum datetime64 in nanoseconds (2262-04-11 23:47:16.854775807)
 */
  __pyx_v_7cytimes_5utils_DT64_NS_US_MIN = (__pyx_v_7cytimes_5utils_DT64_NS_MS_MIN * 0x3E8);

  /* "cytimes/utils.py":89
 * DT64_NS_MS_MIN: cython.longlong = DT64_NS_SS_MIN * 1_000
 * DT64_NS_US_MIN: cython.longlong = DT64_NS_MS_MIN * 1_000
 * DT64_NS_NS_MIN: cython.longlong = DT64_NS_US_MIN * 1_000             # <<<<<<<<<<<<<<
 * #: Maximum datetime64 in nanoseconds (2262-04-11 23:47:16.854775807)
 * DT64_NS_YY_MAX: cython.longlong = 292  # <= 2262
 */
  __pyx_v_7cytimes_5utils_DT64_NS_NS_MIN = (__pyx_v_7cytimes_5utils_DT64_NS_US_MIN * 0x3E8);

  /* "cytimes/utils.py":91
 * DT64_NS_NS_MIN: cython.longlong = DT64_NS_US_MIN * 1_000
 * #: Maximum datetime64 in nanoseconds (2262-04-11 23:47:16.854775807)
 * DT64_NS_YY_MAX: cython.longlong = 292  # <= 2262             # <<<<<<<<<<<<<<
 * DT64_NS_MM_MAX: cython.longlong = 3_507  # <= 2262-03
 * DT64_NS_WW_MAX: cython.longlong = 15_250  # <= 2262-04-03
 */
  __pyx_v_7cytimes_5utils_DT64_NS_YY_MAX = 0x124;

  /* "cytimes/utils.py":92
 * #: Maximum datetime64 in nanoseconds (2262-04-11 23:47:16.854775807)
 * DT64_NS_YY_MAX: cython.longlong = 292  # <= 2262
 * DT64_NS_MM_MAX: cython.longlong = 3_507  # <= 2262-03             # <<<<<<<<<<<<<<
 * DT64_NS_WW_MAX: cython.longlong = 15_250  # <= 2262-04-03
 * DT64_NS_DD_MAX: cython.longlong = 106_750  # <= 2262-04-10
 */
  __pyx_v_7cytimes_5utils_DT64_NS_MM_MAX = 0xDB3;

  /* "cytimes/utils.py":93
 * DT64_NS_YY_MAX: cython.longlong = 292  # <= 2262
 * DT64_NS_MM_MAX: cython.longlong = 3_507  # <= 2262-03
 * DT64_NS_WW_MAX: cython.longlong = 15_250  # <= 2262-04-03             # <<<<<<<<<<<<<<
 * DT64_NS_DD_MAX: cython.longlong = 106_750  # <= 2262-04-10
 * DT64_NS_HH_MAX: cython.longlong = DT64_NS_DD_MAX * 24
 */
  __pyx_v_7cytimes_5utils_DT64_NS_WW_MAX = 0x3B92;

  /* "cytimes/utils.py":94
 * DT64_NS_MM_MAX: cython.longlong = 3_507  # <= 2262-03
 * DT64_NS_WW_MAX: cython.longlong = 15_250  # <= 2262-04-03
 * DT64_NS_DD_MAX: cython.longlong = 106_750  # <= 2262-04-10             # <<<<<<<<<<<<<<
 * DT64_NS_HH_MAX: cython.longlong = DT64_NS_DD_MAX * 24
 * DT64_NS_MI_MAX: cython.longlong = DT64_NS_HH_MAX * 60
 */
  __pyx_v_7cytimes_5utils_DT64_NS_DD_MAX = 0x1A0FE;

  /* "cytimes/utils.py":95
 * DT64_NS_WW_MAX: cython.longlong = 15_250  # <= 2262-04-03
 * DT64_NS_DD_MAX: cython.longlong = 106_750  # <= 2262-04-10
 * DT64_NS_HH_MAX: cython.longlong = DT64_NS_DD_MAX * 24             # <<<<<<<<<<<<<<
 * DT64_NS_MI_MAX: cython.longlong = DT64_NS_HH_MAX * 60
 * DT64_NS_SS_MAX: cython.longlong = DT64_NS_MI_MAX * 60
 */
  __pyx_v_7cytimes_5utils_DT64_NS_HH_MAX = (__pyx_v_7cytimes_5utils_DT64_NS_DD_MAX * 24);

  /* "cytimes/utils.py":96
 * DT64_NS_DD_MAX: cython.longlong = 106_750  # <= 2262-04-10
 * DT64_NS_HH_MAX: cython.longlong = DT64_NS_DD_MAX * 24
 * DT64_NS_MI_MAX: cython.longlong = DT64_NS_HH_MAX * 60             # <<<<<<<<<<<<<<
 * DT64_NS_SS_MAX: cython.longlong = DT64_NS_MI_MAX * 60
 * DT64_NS_MS_MAX: cython.longlong = DT64_NS_SS_MAX * 1_000
 */
  __pyx_v_7cytimes_5utils_DT64_NS_MI_MAX = (__pyx_v_7cytimes_5utils_DT64_NS_HH_MAX * 60);

  /* "cytimes/utils.py":97
 * DT64_NS_HH_MAX: cython.longlong = DT64_NS_DD_MAX * 24
 * DT64_NS_MI_MAX: cython.longlong = DT64_NS_HH_MAX * 60
 * DT64_NS_SS_MAX: cython.longlong = DT64_NS_MI_MAX * 60             # <<<<<<<<<<<<<<
 * DT64_NS_MS_MAX: cython.longlong = DT64_NS_SS_MAX * 1_000
 * DT64_NS_US_MAX: cython.longlong = DT64_NS_MS_MAX * 1_000
 */
  __pyx_v_7cytimes_5utils_DT64_NS_SS_MAX = (__pyx_v_7cytimes_5utils_DT64_NS_MI_MAX * 60);

  /* "cytimes/utils.py":98
 * DT64_NS_MI_MAX: cython.longlong = DT64_NS_HH_MAX * 60
 * DT64_NS_SS_MAX: cython.longlong = DT64_NS_MI_MAX * 60
 * DT64_NS_MS_MAX: cython.longlong = DT64_NS_SS_MAX * 1_000             # <<<<<<<<<<<<<<
 * DT64_NS_US_MAX: cython.longlong = DT64_NS_MS_MAX * 1_000
 * DT64_NS_NS_MAX: cython.longlong = DT64_NS_US_MAX * 1_000
 */
  __pyx_v_7cytimes_5utils_DT64_NS_MS_MAX = (__pyx_v_7cytimes_5utils_DT64_NS_SS_MAX * 0x3E8);

  /* "cytimes/utils.py":99
 * DT64_NS_SS_MAX: cython.longlong = DT64_NS_MI_MAX * 60
 * DT64_NS_MS_MAX: cython.longlong = DT64_NS_SS_MAX * 1_000
 * DT64_NS_US_MAX: cython.longlong = DT64_NS_MS_MAX * 1_000             # <<<<<<<<<<<<<<
 * DT64_NS_NS_MAX: cython.longlong = DT64_NS_US_MAX * 1_000
 * 
 */
  __pyx_v_7cytimes_5utils_DT64_NS_US_MAX = (__pyx_v_7cytimes_5utils_DT64_NS_MS_MAX * 0x3E8);

  /* "cytimes/utils.py":100
 * DT64_NS_MS_MAX: cython.longlong = DT64_NS_SS_MAX * 1_000
 * DT64_NS_US_MAX: cython.longlong = DT64_NS_MS_MAX * 1_000
 * DT64_NS_NS_MAX: cython.longlong = DT64_NS_US_MAX * 1_000             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_7cytimes_5utils_DT64_NS_NS_MAX = (__pyx_v_7cytimes_5utils_DT64_NS_US_MAX * 0x3E8);

  /* "cytimes/utils.py":120
 * 
 * 
 * _LOCAL_TZ: object = _get_localtimezone()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __pyx_f_7cytimes_5utils__get_localtimezone(); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_XGOTREF(__pyx_v_7cytimes_5utils__LOCAL_TZ);
  __Pyx_DECREF_SET(__pyx_v_7cytimes_5utils__LOCAL_TZ, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":148
 * 
 * 
 * _TIMEZONE_MAP: dict = _prep_timezone_map()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __pyx_f_7cytimes_5utils__prep_timezone_map(); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_XGOTREF(__pyx_v_7cytimes_5utils__TIMEZONE_MAP);
  __Pyx_DECREF_SET(__pyx_v_7cytimes_5utils__TIMEZONE_MAP, ((PyObject*)__pyx_t_4));
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytimes/utils.py":195
 * ########## The REST utility functions are in the utils.pxd file ##########
 * ########## The following functions are for testing purpose only ##########
 * def _test_utils() -> None:             # <<<<<<<<<<<<<<
 *     # Parser
 *     _test_parser()
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 195, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_1_test_utils, 0, __pyx_n_s_test_utils, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_utils, __pyx_t_3) < 0) __PYX_ERR(1, 195, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":254
 * 
 * # Parser
 * def _test_parser() -> None:             # <<<<<<<<<<<<<<
 *     # boolean
 *     assert is_iso_sep("t")  # type: ignore
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 254, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_3_test_parser, 0, __pyx_n_s_test_parser, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_parser, __pyx_t_4) < 0) __PYX_ERR(1, 254, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":315
 * 
 * # Time
 * def _test_localtime_n_gmtime() -> None:             # <<<<<<<<<<<<<<
 *     import time
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 315, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_5_test_localtime_n_gmtime, 0, __pyx_n_s_test_localtime_n_gmtime, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_localtime_n_gmtime, __pyx_t_3) < 0) __PYX_ERR(1, 315, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":349
 * 
 * # Calendar
 * def _test_is_leap_year() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _is_leap  # type: ignore
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 349, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_7_test_is_leap_year, 0, __pyx_n_s_test_is_leap_year, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__127)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_is_leap_year, __pyx_t_4) < 0) __PYX_ERR(1, 349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":361
 * 
 * 
 * def _test_days_bf_year() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _days_before_year  # type: ignore
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 361, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_9_test_days_bf_year, 0, __pyx_n_s_test_days_bf_year, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__129)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_days_bf_year, __pyx_t_3) < 0) __PYX_ERR(1, 361, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":373
 * 
 * 
 * def _test_quarter_of_month() -> None:             # <<<<<<<<<<<<<<
 *     count: cython.int = 0
 *     value: cython.int = 1
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 373, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_11_test_quarter_of_month, 0, __pyx_n_s_test_quarter_of_month, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_quarter_of_month, __pyx_t_4) < 0) __PYX_ERR(1, 373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":387
 * 
 * 
 * def _test_days_in_quarter() -> None:             # <<<<<<<<<<<<<<
 *     # non-leap
 *     year: cython.int = 2021
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 387, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_13_test_days_in_quarter, 0, __pyx_n_s_test_days_in_quarter, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_days_in_quarter, __pyx_t_3) < 0) __PYX_ERR(1, 387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":408
 * 
 * 
 * def _test_days_in_month() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _days_in_month  # type: ignore
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 408, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_15_test_days_in_month, 0, __pyx_n_s_test_days_in_month, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__135)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_days_in_month, __pyx_t_4) < 0) __PYX_ERR(1, 408, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":428
 * 
 * 
 * def _test_days_bf_month() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _days_before_month  # type: ignore
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 428, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_17_test_days_bf_month, 0, __pyx_n_s_test_days_bf_month, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__137)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_days_bf_month, __pyx_t_3) < 0) __PYX_ERR(1, 428, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":448
 * 
 * 
 * def _test_weekday() -> None:             # <<<<<<<<<<<<<<
 *     from datetime import date
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 448, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_19_test_weekday, 0, __pyx_n_s_test_weekday, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__139)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_weekday, __pyx_t_4) < 0) __PYX_ERR(1, 448, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":467
 * 
 * 
 * def _test_isocalendar() -> None:             # <<<<<<<<<<<<<<
 *     from datetime import date
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 467, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_21_test_isocalendar, 0, __pyx_n_s_test_isocalendar, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__141)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_isocalendar, __pyx_t_3) < 0) __PYX_ERR(1, 467, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":496
 * 
 * 
 * def _test_iso_1st_monday() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _isoweek1monday  # type: ignore
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 496, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_23_test_iso_1st_monday, 0, __pyx_n_s_test_iso_1st_monday, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__143)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_iso_1st_monday, __pyx_t_4) < 0) __PYX_ERR(1, 496, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":508
 * 
 * 
 * def _test_ymd_to_ordinal() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _ymd2ord  # type: ignore
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 508, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_25_test_ymd_to_ordinal, 0, __pyx_n_s_test_ymd_to_ordinal, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__145)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_ymd_to_ordinal, __pyx_t_3) < 0) __PYX_ERR(1, 508, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":527
 * 
 * 
 * def _test_ymd_fr_ordinal() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _ord2ymd, _MAXORDINAL  # type: ignore
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 527, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_27_test_ymd_fr_ordinal, 0, __pyx_n_s_test_ymd_fr_ordinal, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__147)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_ymd_fr_ordinal, __pyx_t_4) < 0) __PYX_ERR(1, 527, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":541
 * 
 * 
 * def _test_ymd_fr_isocalendar() -> None:             # <<<<<<<<<<<<<<
 *     from _pydatetime import _isoweek_to_gregorian  # type: ignore
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 541, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_29_test_ymd_fr_isocalendar, 0, __pyx_n_s_test_ymd_fr_isocalendar, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__149)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_ymd_fr_isocalendar, __pyx_t_3) < 0) __PYX_ERR(1, 541, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":567
 * 
 * # datetime.date
 * def _test_date_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 567, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_31_test_date_generate, 0, __pyx_n_s_test_date_generate, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__151)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_date_generate, __pyx_t_4) < 0) __PYX_ERR(1, 567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":589
 * 
 * 
 * def _test_date_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 589, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_33_test_date_type_check, 0, __pyx_n_s_test_date_type_check, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__153)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_date_type_check, __pyx_t_3) < 0) __PYX_ERR(1, 589, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":608
 * 
 * 
 * def _test_date_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 608, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_35_test_date_conversion, 0, __pyx_n_s_test_date_conversion, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__155)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_date_conversion, __pyx_t_4) < 0) __PYX_ERR(1, 608, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":660
 * 
 * # datetime.datetime
 * def _test_dt_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 660, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_37_test_dt_generate, 0, __pyx_n_s_test_dt_generate, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__157)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_dt_generate, __pyx_t_3) < 0) __PYX_ERR(1, 660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":699
 * 
 * 
 * def _test_dt_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 699, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_39_test_dt_type_check, 0, __pyx_n_s_test_dt_type_check, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__159)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_dt_type_check, __pyx_t_4) < 0) __PYX_ERR(1, 699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":718
 * 
 * 
 * def _test_dt_tzinfo() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 718, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_41_test_dt_tzinfo, 0, __pyx_n_s_test_dt_tzinfo, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__161)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_dt_tzinfo, __pyx_t_3) < 0) __PYX_ERR(1, 718, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":737
 * 
 * 
 * def _test_dt_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 737, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_43_test_dt_conversion, 0, __pyx_n_s_test_dt_conversion, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__163)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_dt_conversion, __pyx_t_4) < 0) __PYX_ERR(1, 737, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":851
 * 
 * 
 * def _test_dt_mainipulate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 851, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_45_test_dt_mainipulate, 0, __pyx_n_s_test_dt_mainipulate, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__165)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_dt_mainipulate, __pyx_t_3) < 0) __PYX_ERR(1, 851, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":870
 * 
 * 
 * def _test_dt_arithmetic() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 870, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_47_test_dt_arithmetic, 0, __pyx_n_s_test_dt_arithmetic, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__167)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_dt_arithmetic, __pyx_t_4) < 0) __PYX_ERR(1, 870, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":904
 * 
 * # datetime.time
 * def _test_time_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 904, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_49_test_time_generate, 0, __pyx_n_s_test_time_generate, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__169)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_time_generate, __pyx_t_3) < 0) __PYX_ERR(1, 904, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":941
 * 
 * 
 * def _test_time_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 941, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_51_test_time_type_check, 0, __pyx_n_s_test_time_type_check, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__171)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_time_type_check, __pyx_t_4) < 0) __PYX_ERR(1, 941, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":960
 * 
 * 
 * def _test_time_tzinfo() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_53_test_time_tzinfo, 0, __pyx_n_s_test_time_tzinfo, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__173)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_time_tzinfo, __pyx_t_3) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":980
 * 
 * 
 * def _test_time_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 980, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_55_test_time_conversion, 0, __pyx_n_s_test_time_conversion, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__175)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_time_conversion, __pyx_t_4) < 0) __PYX_ERR(1, 980, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":1024
 * 
 * # datetime.timedelta
 * def _test_timedelta_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 1024, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_57_test_timedelta_generate, 0, __pyx_n_s_test_timedelta_generate, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__177)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_timedelta_generate, __pyx_t_3) < 0) __PYX_ERR(1, 1024, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":1044
 * 
 * 
 * def _test_timedelta_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 1044, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_59_test_timedelta_type_check, 0, __pyx_n_s_test_timedelta_type_check, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__179)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_timedelta_type_check, __pyx_t_4) < 0) __PYX_ERR(1, 1044, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":1063
 * 
 * 
 * def _test_timedelta_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 1063, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_61_test_timedelta_conversion, 0, __pyx_n_s_test_timedelta_conversion, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__181)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_timedelta_conversion, __pyx_t_3) < 0) __PYX_ERR(1, 1063, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":1111
 * 
 * # datetime.tzinfo
 * def _test_tzinfo_generate() -> None:             # <<<<<<<<<<<<<<
 *     import datetime, time
 *     from babel.dates import LOCALTZ
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 1111, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_63_test_tzinfo_generate, 0, __pyx_n_s_test_tzinfo_generate, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__183)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_tzinfo_generate, __pyx_t_4) < 0) __PYX_ERR(1, 1111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":1130
 * 
 * 
 * def _test_tzinfo_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 1130, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_65_test_tzinfo_type_check, 0, __pyx_n_s_test_tzinfo_type_check, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_tzinfo_type_check, __pyx_t_3) < 0) __PYX_ERR(1, 1130, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":1142
 * 
 * 
 * def _test_tzinfo_access() -> None:             # <<<<<<<<<<<<<<
 *     import datetime
 *     from zoneinfo import ZoneInfo
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 1142, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_67_test_tzinfo_access, 0, __pyx_n_s_test_tzinfo_access, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__186)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_tzinfo_access, __pyx_t_4) < 0) __PYX_ERR(1, 1142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":1180
 * 
 * # . numpy.share
 * def _test_numpy_share() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 1180, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_69_test_numpy_share, 0, __pyx_n_s_test_numpy_share, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_numpy_share, __pyx_t_3) < 0) __PYX_ERR(1, 1180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":1204
 * 
 * # . numpy.datetime64
 * def _test_datetime64_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 1204, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_71_test_datetime64_type_check, 0, __pyx_n_s_test_datetime64_type_check, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_datetime64_type_check, __pyx_t_4) < 0) __PYX_ERR(1, 1204, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":1225
 * 
 * 
 * def _test_datetime64_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime, numpy as np
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 1225, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_73_test_datetime64_conversion, 0, __pyx_n_s_test_datetime64_conversion, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_datetime64_conversion, __pyx_t_3) < 0) __PYX_ERR(1, 1225, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":1242
 * 
 * # . numpy.timedelta64
 * def _test_timedelta64_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 1242, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_75_test_timedelta64_type_check, 0, __pyx_n_s_test_timedelta64_type_check, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_timedelta64_type_check, __pyx_t_4) < 0) __PYX_ERR(1, 1242, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":1263
 * 
 * 
 * def _test_timedelta64_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import datetime, numpy as np
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 1263, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_77_test_timedelta64_conversion, 0, __pyx_n_s_test_timedelta64_conversion, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_timedelta64_conversion, __pyx_t_3) < 0) __PYX_ERR(1, 1263, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":1280
 * 
 * # . numpy.ndarray
 * def _test_ndarray_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 1280, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_79_test_ndarray_type_check, 0, __pyx_n_s_test_ndarray_type_check, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_ndarray_type_check, __pyx_t_4) < 0) __PYX_ERR(1, 1280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":1293
 * 
 * # . numpy.ndarray[datetime64]
 * def _test_ndarray_dt64_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 1293, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_81_test_ndarray_dt64_type_check, 0, __pyx_n_s_test_ndarray_dt64_type_check, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__199)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_ndarray_dt64_type_check, __pyx_t_3) < 0) __PYX_ERR(1, 1293, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":1306
 * 
 * 
 * def _test_ndarray_dt64_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 1306, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_83_test_ndarray_dt64_conversion, 0, __pyx_n_s_test_ndarray_dt64_conversion, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__201)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_ndarray_dt64_conversion, __pyx_t_4) < 0) __PYX_ERR(1, 1306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":1336
 * 
 * # . numpy.ndarray[timedelta64]
 * def _test_ndarray_td64_type_check() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 1336, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_85_test_ndarray_td64_type_check, 0, __pyx_n_s_test_ndarray_td64_type_check, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_ndarray_td64_type_check, __pyx_t_3) < 0) __PYX_ERR(1, 1336, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/utils.py":1349
 * 
 * 
 * def _test_ndarray_td64_conversion() -> None:             # <<<<<<<<<<<<<<
 *     import numpy as np
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(1, 1349, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_5utils_87_test_ndarray_td64_conversion, 0, __pyx_n_s_test_ndarray_td64_conversion, NULL, __pyx_n_s_cytimes_utils, __pyx_d, ((PyObject *)__pyx_codeobj__204)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_ndarray_td64_conversion, __pyx_t_4) < 0) __PYX_ERR(1, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/utils.py":1
 * # cython: language_level=3             # <<<<<<<<<<<<<<
 * # cython: wraparound=False
 * # cython: boundscheck=False
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  if (__pyx_m) {
    if (__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init cytimes.utils", __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.utils");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#ifdef _MSC_VER
#pragma warning( push )
/* Warning 4127: conditional expression is constant
 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
 * compile-time, so this warning is not useful
 */
#pragma warning( disable : 4127 )
#endif



/* #### Code section: utility_code_def ### */

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *tmp_value;
    assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
    if (value) {
        #if CYTHON_COMPILING_IN_CPYTHON
        if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
        #endif
            PyException_SetTraceback(value, tb);
    }
    tmp_value = tstate->current_exception;
    tstate->current_exception = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
#else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject* exc_value;
    exc_value = tstate->current_exception;
    tstate->current_exception = 0;
    *value = exc_value;
    *type = NULL;
    *tb = NULL;
    if (exc_value) {
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        #if CYTHON_COMPILING_IN_CPYTHON
        *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
        Py_XINCREF(*tb);
        #else
        *tb = PyException_GetTraceback(exc_value);
        #endif
    }
#else
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#endif
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError */
#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    PyObject *exc_value = exc_info->exc_value;
    if (exc_value == NULL || exc_value == Py_None) {
        *value = NULL;
        *type = NULL;
        *tb = NULL;
    } else {
        *value = exc_value;
        Py_INCREF(*value);
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        *tb = PyException_GetTraceback(exc_value);
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #endif
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    PyObject *tmp_value = exc_info->exc_value;
    exc_info->exc_value = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
  #else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
  #endif
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type = NULL, *local_value, *local_tb = NULL;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if PY_VERSION_HEX >= 0x030C00A6
    local_value = tstate->current_exception;
    tstate->current_exception = 0;
    if (likely(local_value)) {
        local_type = (PyObject*) Py_TYPE(local_value);
        Py_INCREF(local_type);
        local_tb = PyException_GetTraceback(local_value);
    }
  #else
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
  #endif
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
    if (unlikely(tstate->current_exception))
#elif CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
      #if PY_VERSION_HEX >= 0x030B00a4
        tmp_value = exc_info->exc_value;
        exc_info->exc_value = local_value;
        tmp_type = NULL;
        tmp_tb = NULL;
        Py_XDECREF(local_type);
        Py_XDECREF(local_tb);
      #else
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
      #endif
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    #endif
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    __Pyx_PyThreadState_declare
    CYTHON_UNUSED_VAR(cause);
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
      #if PY_VERSION_HEX >= 0x030C00A6
        PyException_SetTraceback(value, tb);
      #elif CYTHON_FAST_THREAD_STATE
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#else
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    __Pyx_TypeName obj_type_name;
    __Pyx_TypeName type_name;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    type_name = __Pyx_PyType_GetName(type);
    PyErr_Format(PyExc_TypeError,
                 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
                 obj_type_name, type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
}

/* ModInt[long] */
static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
    long r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
        return NULL;
    }
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
        return NULL;
    }
    #endif
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
    self = __Pyx_CyOrPyCFunction_GET_SELF(func);
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    #endif
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectFastCall */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
            return __Pyx_PyObject_CallMethO(func, NULL);
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
            return __Pyx_PyObject_CallMethO(func, args[0]);
    }
#endif
    #if PY_VERSION_HEX < 0x030800B1
    #if CYTHON_FAST_PYCCALL
    if (PyCFunction_Check(func)) {
        if (kwargs) {
            return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
        } else {
            return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
        }
    }
    #if PY_VERSION_HEX >= 0x030700A1
    if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
        return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
    }
    #endif
    #endif
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
    }
    #endif
    #endif
    if (kwargs == NULL) {
        #if CYTHON_VECTORCALL
        #if PY_VERSION_HEX < 0x03090000
        vectorcallfunc f = _PyVectorcall_Function(func);
        #else
        vectorcallfunc f = PyVectorcall_Function(func);
        #endif
        if (f) {
            return f(func, args, (size_t)nargs, NULL);
        }
        #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
        if (__Pyx_CyFunction_CheckExact(func)) {
            __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
            if (f) return f(func, args, (size_t)nargs, NULL);
        }
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
    }
    #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
    #else
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #endif
}

/* PyObjectCallOneArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_value = exc_info->exc_value;
    exc_info->exc_value = *value;
    if (tmp_value == NULL || tmp_value == Py_None) {
        Py_XDECREF(tmp_value);
        tmp_value = NULL;
        tmp_type = NULL;
        tmp_tb = NULL;
    } else {
        tmp_type = (PyObject*) Py_TYPE(tmp_value);
        Py_INCREF(tmp_type);
        #if CYTHON_COMPILING_IN_CPYTHON
        tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
        Py_XINCREF(tmp_tb);
        #else
        tmp_tb = PyException_GetTraceback(tmp_value);
        #endif
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
  #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
  #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* DivInt[long] */
static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
    long q = a / b;
    long r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* CIntToDigits */
static const char DIGIT_PAIRS_10[2*10*10+1] = {
    "00010203040506070809"
    "10111213141516171819"
    "20212223242526272829"
    "30313233343536373839"
    "40414243444546474849"
    "50515253545556575859"
    "60616263646566676869"
    "70717273747576777879"
    "80818283848586878889"
    "90919293949596979899"
};
static const char DIGIT_PAIRS_8[2*8*8+1] = {
    "0001020304050607"
    "1011121314151617"
    "2021222324252627"
    "3031323334353637"
    "4041424344454647"
    "5051525354555657"
    "6061626364656667"
    "7071727374757677"
};
static const char DIGITS_HEX[2*16+1] = {
    "0123456789abcdef"
    "0123456789ABCDEF"
};

/* BuildPyUnicode */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
                                                int prepend_sign, char padding_char) {
    PyObject *uval;
    Py_ssize_t uoffset = ulength - clength;
#if CYTHON_USE_UNICODE_INTERNALS
    Py_ssize_t i;
#if CYTHON_PEP393_ENABLED
    void *udata;
    uval = PyUnicode_New(ulength, 127);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_DATA(uval);
#else
    Py_UNICODE *udata;
    uval = PyUnicode_FromUnicode(NULL, ulength);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_AS_UNICODE(uval);
#endif
    if (uoffset > 0) {
        i = 0;
        if (prepend_sign) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
            i++;
        }
        for (; i < uoffset; i++) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
        }
    }
    for (i=0; i < clength; i++) {
        __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
    }
#else
    {
        PyObject *sign = NULL, *padding = NULL;
        uval = NULL;
        if (uoffset > 0) {
            prepend_sign = !!prepend_sign;
            if (uoffset > prepend_sign) {
                padding = PyUnicode_FromOrdinal(padding_char);
                if (likely(padding) && uoffset > prepend_sign + 1) {
                    PyObject *tmp;
                    PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign);
                    if (unlikely(!repeat)) goto done_or_error;
                    tmp = PyNumber_Multiply(padding, repeat);
                    Py_DECREF(repeat);
                    Py_DECREF(padding);
                    padding = tmp;
                }
                if (unlikely(!padding)) goto done_or_error;
            }
            if (prepend_sign) {
                sign = PyUnicode_FromOrdinal('-');
                if (unlikely(!sign)) goto done_or_error;
            }
        }
        uval = PyUnicode_DecodeASCII(chars, clength, NULL);
        if (likely(uval) && padding) {
            PyObject *tmp = PyNumber_Add(padding, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
        if (likely(uval) && sign) {
            PyObject *tmp = PyNumber_Add(sign, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
done_or_error:
        Py_XDECREF(padding);
        Py_XDECREF(sign);
    }
#endif
    return uval;
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(int)*3+2];
    char *dpos, *end = digits + sizeof(int)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    int remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (int) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (int) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (int) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    CYTHON_MAYBE_UNUSED_VAR(max_char);
#if CYTHON_PEP393_ENABLED
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_DATA(result_uval);
#else
    result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = sizeof(Py_UNICODE);
    kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
        if (unlikely(__Pyx_PyUnicode_READY(uval)))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        if (unlikely(!ulength))
            continue;
        if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
            memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if PY_VERSION_HEX >= 0x030d0000
            if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
            #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    CYTHON_UNUSED_VAR(value_count);
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

/* DivInt[PY_LONG_LONG] */
static CYTHON_INLINE PY_LONG_LONG __Pyx_div_PY_LONG_LONG(PY_LONG_LONG a, PY_LONG_LONG b) {
    PY_LONG_LONG q = a / b;
    PY_LONG_LONG r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* ModInt[PY_LONG_LONG] */
static CYTHON_INLINE PY_LONG_LONG __Pyx_mod_PY_LONG_LONG(PY_LONG_LONG a, PY_LONG_LONG b) {
    PY_LONG_LONG r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
                 expected, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* PyUnicode_Unicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) {
    if (unlikely(obj == Py_None))
        obj = __pyx_kp_u_None;
    return __Pyx_NewRef(obj);
}

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_PY_LONG_LONG(PY_LONG_LONG value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(PY_LONG_LONG)*3+2];
    char *dpos, *end = digits + sizeof(PY_LONG_LONG)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    PY_LONG_LONG remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (PY_LONG_LONG) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (PY_LONG_LONG) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (PY_LONG_LONG) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (unlikely(!j)) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (mm && mm->mp_subscript) {
            PyObject *r, *key = PyInt_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (likely(sm && sm->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return sm->sq_item(o, i);
        }
    }
#else
    if (is_list || !PyMapping_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
    PyObject *runerr = NULL;
    Py_ssize_t key_value;
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index));
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError,
            "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
        __Pyx_DECREF_TypeName(index_type_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
    __Pyx_TypeName obj_type_name;
    if (likely(PyType_Check(obj))) {
        PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem);
        if (!meth) {
            PyErr_Clear();
        } else {
            PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
            Py_DECREF(meth);
            return result;
        }
    }
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
    PyTypeObject *tp = Py_TYPE(obj);
    PyMappingMethods *mm = tp->tp_as_mapping;
    PySequenceMethods *sm = tp->tp_as_sequence;
    if (likely(mm && mm->mp_subscript)) {
        return mm->mp_subscript(obj, key);
    }
    if (likely(sm && sm->sq_item)) {
        return __Pyx_PyObject_GetIndex(obj, key);
    }
    return __Pyx_PyObject_GetItem_Slow(obj, key);
}
#endif

/* DivInt[npy_int64] */
static CYTHON_INLINE npy_int64 __Pyx_div_npy_int64(npy_int64 a, npy_int64 b) {
    npy_int64 q = a / b;
    npy_int64 r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* ModInt[npy_int64] */
static CYTHON_INLINE npy_int64 __Pyx_mod_npy_int64(npy_int64 a, npy_int64 b) {
    npy_int64 r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyString_CheckExact(s))) {
        PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
        Py_DECREF(s);
        return result;
    }
    #endif
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result;
    if (unlikely(!s)) return NULL;
    result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* RaiseUnboundLocalError */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* 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__14);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400)
        {
            PyObject *modules = PyImport_GetModuleDict();
            if (unlikely(!modules))
                goto modbad;
            value = PyObject_GetItem(modules, full_name);
        }
        #else
        value = PyImport_GetModule(full_name);
        #endif
      modbad:
        Py_XDECREF(full_name);
        Py_XDECREF(module_dot);
        Py_XDECREF(module_name);
    }
    if (unlikely(!value)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* 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);
}

/* DictGetItem */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            if (unlikely(PyTuple_Check(key))) {
                PyObject* args = PyTuple_Pack(1, key);
                if (likely(args)) {
                    PyErr_SetObject(PyExc_KeyError, args);
                    Py_DECREF(args);
                }
            } else {
                PyErr_SetObject(PyExc_KeyError, key);
            }
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#endif

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (!r) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* TupleAndListFromArray */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        Py_INCREF(__pyx_empty_tuple);
        return __pyx_empty_tuple;
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* fastcall */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
    for (i = 0; i < n; i++)
    {
        if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;
            return kwvalues[i];
        }
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
    PyObject *dict;
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* 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__37;
    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);
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(long)*3+2];
    char *dpos, *end = digits + sizeof(long)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    long remaining;
#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 (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 = (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 = (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 = (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);
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
        
            x = (long)((unsigned long)a + (unsigned long)b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        if (unlikely(__Pyx_PyLong_IsZero(op1))) {
            return __Pyx_NewRef(op2);
        }
        if (likely(__Pyx_PyLong_IsCompact(op1))) {
            a = __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
            double result;
            
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return -1;
        __Pyx_PyErr_Clear();
        return 0;
    }
    return 0;
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    }
    return __Pyx_IterFinish();
}

/* PyIntCompare */
static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        return 1;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        return (a == b);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        const digit* digits = __Pyx_PyLong_Digits(op1);
        if (intval == 0) {
            return (__Pyx_PyLong_IsZero(op1) == 1);
        } else if (intval < 0) {
            if (__Pyx_PyLong_IsNonNeg(op1))
                return 0;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                return 0;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        return (unequal == 0);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
        return ((double)a == (double)b);
    }
    return __Pyx_PyObject_IsTrueAndDecref(
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* Py3UpdateBases */
static PyObject*
__Pyx_PEP560_update_bases(PyObject *bases)
{
    Py_ssize_t i, j, size_bases;
    PyObject *base, *meth, *new_base, *result, *new_bases = NULL;
    size_bases = PyTuple_GET_SIZE(bases);
    for (i = 0; i < size_bases; i++) {
        base  = PyTuple_GET_ITEM(bases, i);
        if (PyType_Check(base)) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries);
        if (!meth && PyErr_Occurred()) {
            goto error;
        }
        if (!meth) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        new_base = __Pyx_PyObject_CallOneArg(meth, bases);
        Py_DECREF(meth);
        if (!new_base) {
            goto error;
        }
        if (!PyTuple_Check(new_base)) {
            PyErr_SetString(PyExc_TypeError,
                            "__mro_entries__ must return a tuple");
            Py_DECREF(new_base);
            goto error;
        }
        if (!new_bases) {
            if (!(new_bases = PyList_New(i))) {
                goto error;
            }
            for (j = 0; j < i; j++) {
                base = PyTuple_GET_ITEM(bases, j);
                PyList_SET_ITEM(new_bases, j, base);
                Py_INCREF(base);
            }
        }
        j = PyList_GET_SIZE(new_bases);
        if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
            goto error;
        }
        Py_DECREF(new_base);
    }
    if (!new_bases) {
        Py_INCREF(bases);
        return bases;
    }
    result = PyList_AsTuple(new_bases);
    Py_DECREF(new_bases);
    return result;
error:
    Py_XDECREF(new_bases);
    return NULL;
}

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases;
#if CYTHON_ASSUME_SAFE_MACROS
    nbases = PyTuple_GET_SIZE(bases);
#else
    nbases = PyTuple_Size(bases);
    if (nbases < 0) return NULL;
#endif
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
#if CYTHON_ASSUME_SAFE_MACROS
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *tmp = PyTuple_GetItem(bases, i);
        if (!tmp) return NULL;
#endif
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* PyObjectCall2Args */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args[3] = {NULL, arg1, arg2};
    return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectLookupSpecial */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else if (with_error) {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#endif

/* Py3ClassCreate */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs[3] = {NULL, name, bases};
            ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
            Py_DECREF(prep);
        } else {
            if (unlikely(PyErr_Occurred()))
                return NULL;
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
#if PY_VERSION_HEX >= 0x03030000
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
#else
    CYTHON_MAYBE_UNUSED_VAR(qualname);
#endif
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
static int __Pyx_SetNamesPEP487(PyObject *type_obj) {
    PyTypeObject *type = (PyTypeObject*) type_obj;
    PyObject *names_to_set, *key, *value, *set_name, *tmp;
    Py_ssize_t i = 0;
#if CYTHON_USE_TYPE_SLOTS
    names_to_set = PyDict_Copy(type->tp_dict);
#else
    {
        PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict);
        names_to_set = NULL;
        if (likely(d)) {
            PyObject *names_to_set = PyDict_New();
            int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1;
            Py_DECREF(d);
            if (unlikely(ret < 0))
                Py_CLEAR(names_to_set);
        }
    }
#endif
    if (unlikely(names_to_set == NULL))
        goto bad;
    while (PyDict_Next(names_to_set, &i, &key, &value)) {
        set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name);
        if (unlikely(set_name != NULL)) {
            tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key);
            Py_DECREF(set_name);
            if (unlikely(tmp == NULL)) {
                __Pyx_TypeName value_type_name =
                    __Pyx_PyType_GetName(Py_TYPE(value));
                __Pyx_TypeName type_name = __Pyx_PyType_GetName(type);
                PyErr_Format(PyExc_RuntimeError,
#if PY_MAJOR_VERSION >= 3
                    "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'",
                    value_type_name, key, type_name);
#else
                    "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'",
                    value_type_name,
                    PyString_Check(key) ? PyString_AS_STRING(key) : "?",
                    type_name);
#endif
                goto bad;
            } else {
                Py_DECREF(tmp);
            }
        }
        else if (unlikely(PyErr_Occurred())) {
            goto bad;
        }
    }
    Py_DECREF(names_to_set);
    return 0;
bad:
    Py_XDECREF(names_to_set);
    return -1;
}
static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) {
#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyTypeObject *type = (PyTypeObject*) type_obj;
    PyObject *mro = type->tp_mro;
    Py_ssize_t i, nbases;
    if (unlikely(!mro)) goto done;
    (void) &__Pyx_GetBuiltinName;
    Py_INCREF(mro);
    nbases = PyTuple_GET_SIZE(mro);
    assert(PyTuple_GET_ITEM(mro, 0) == type_obj);
    for (i = 1; i < nbases-1; i++) {
        PyObject *base, *dict, *meth;
        base = PyTuple_GET_ITEM(mro, i);
        dict = ((PyTypeObject *)base)->tp_dict;
        meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass);
        if (unlikely(meth)) {
            descrgetfunc f = Py_TYPE(meth)->tp_descr_get;
            PyObject *res;
            Py_INCREF(meth);
            if (likely(f)) {
                res = f(meth, NULL, type_obj);
                Py_DECREF(meth);
                if (unlikely(!res)) goto bad;
                meth = res;
            }
            res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw);
            Py_DECREF(meth);
            if (unlikely(!res)) goto bad;
            Py_DECREF(res);
            goto done;
        } else if (unlikely(PyErr_Occurred())) {
            goto bad;
        }
    }
done:
    Py_XDECREF(mro);
    return type_obj;
bad:
    Py_XDECREF(mro);
    Py_DECREF(type_obj);
    return NULL;
#else
    PyObject *super_type, *super, *func, *res;
#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
    super_type = __Pyx_GetBuiltinName(__pyx_n_s_super);
#else
    super_type = (PyObject*) &PySuper_Type;
    (void) &__Pyx_GetBuiltinName;
#endif
    super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL;
#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
    Py_XDECREF(super_type);
#endif
    if (unlikely(!super)) {
        Py_CLEAR(type_obj);
        goto done;
    }
    func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass);
    Py_DECREF(super);
    if (likely(!func)) {
        if (unlikely(PyErr_Occurred()))
            Py_CLEAR(type_obj);
        goto done;
    }
    res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw);
    Py_DECREF(func);
    if (unlikely(!res))
        Py_CLEAR(type_obj);
    Py_XDECREF(res);
done:
    return type_obj;
#endif
}
#endif
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result;
    PyObject *owned_metaclass = NULL;
    PyObject *margs[4] = {NULL, name, bases, dict};
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET,
#if PY_VERSION_HEX < 0x030600A4
        (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw
#else
        mkw
#endif
    );
    Py_XDECREF(owned_metaclass);
#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
    if (likely(result) && likely(PyType_Check(result))) {
        if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) {
            Py_CLEAR(result);
        } else {
            result = __Pyx_InitSubclassPEP487(result, mkw);
        }
    }
#else
    (void) &__Pyx_GetBuiltinName;
#endif
    return result;
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        
#ifdef HAVE_LONG_LONG
            if (sizeof(PY_LONG_LONG) > sizeof(long)) {
                PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b;
                return (result >= LONG_MIN && result <= LONG_MAX) ?
                    PyInt_FromLong((long)result) : PyLong_FromLongLong(result);
            }
#endif
#if CYTHON_USE_TYPE_SLOTS
            return PyInt_Type.tp_as_number->nb_multiply(op1, op2);
#else
            return PyNumber_Multiply(op1, op2);
#endif
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        if (unlikely(__Pyx_PyLong_IsZero(op1))) {
            return __Pyx_NewRef(op1);
        }
        if (likely(__Pyx_PyLong_IsCompact(op1))) {
            a = __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
            }
        }
                CYTHON_UNUSED_VAR(a);
                CYTHON_UNUSED_VAR(b);
                #ifdef HAVE_LONG_LONG
                lla = a;
                goto long_long;
                #else
                return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
                #endif
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla * llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
            double result;
            
            PyFPE_START_PROTECT("multiply", return NULL)
            result = ((double)a) * (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2);
}
#endif

/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
        
            x = (long)((unsigned long)a - (unsigned long)b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        if (unlikely(__Pyx_PyLong_IsZero(op1))) {
            return PyLong_FromLong(-intval);
        }
        if (likely(__Pyx_PyLong_IsCompact(op1))) {
            a = __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
            double result;
            
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        
            if (8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) {
                return PyFloat_FromDouble((double)a / (double)b);
            }
            return PyInt_Type.tp_as_number->nb_true_divide(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        }
        if (likely(__Pyx_PyLong_IsCompact(op1))) {
            a = __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
            }
        }
                if ((8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53)))
                        || __Pyx_PyLong_DigitCount(op1) <= 52 / PyLong_SHIFT) {
                    return PyFloat_FromDouble((double)a / (double)b);
                }
                return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
            return PyLong_FromLong(x);
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
            double result;
            
            PyFPE_START_PROTECT("divide", return NULL)
            result = ((double)a) / (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
}
#endif

/* SliceObject */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, int wraparound) {
    __Pyx_TypeName obj_type_name;
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#else
    CYTHON_UNUSED_VAR(wraparound);
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#else
    CYTHON_UNUSED_VAR(wraparound);
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
bad:
    return NULL;
}

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType_3_0_12
#define __PYX_HAVE_RT_ImportType_3_0_12
static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
    Py_ssize_t itemsize;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    PyObject *py_itemsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#if !CYTHON_COMPILING_IN_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
    itemsize = ((PyTypeObject *)result)->tp_itemsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
    py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
    if (!py_itemsize)
        goto bad;
    itemsize = PyLong_AsSsize_t(py_itemsize);
    Py_DECREF(py_itemsize);
    py_itemsize = 0;
    if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (itemsize) {
        if (size % alignment) {
            alignment = size % alignment;
        }
        if (itemsize < (Py_ssize_t)alignment)
            itemsize = (Py_ssize_t)alignment;
    }
    if ((size_t)(basicsize + itemsize) < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize+itemsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 &&
            ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd-%zd from PyObject",
            module_name, class_name, size, basicsize, basicsize+itemsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* FixUpExtensionType */
#if CYTHON_USE_TYPE_SPECS
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
#else
    const PyType_Slot *slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
        int changed = 0;
#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
        const
#endif
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
#if PY_VERSION_HEX < 0x030900b1
                if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_weaklistoffset = memb->offset;
                    changed = 1;
                }
                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_dictoffset = memb->offset;
                    changed = 1;
                }
#if CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
#if PY_VERSION_HEX >= 0x030800b4
                    type->tp_vectorcall_offset = memb->offset;
#else
                    type->tp_print = (printfunc) memb->offset;
#endif
                    changed = 1;
                }
#endif
#else
                if ((0));
#endif
#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
                else if (strcmp(memb->name, "__module__") == 0) {
                    PyObject *descr;
                    assert(memb->type == T_OBJECT);
                    assert(memb->flags == 0 || memb->flags == READONLY);
                    descr = PyDescr_NewMember(type, memb);
                    if (unlikely(!descr))
                        return -1;
                    if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
                        Py_DECREF(descr);
                        return -1;
                    }
                    Py_DECREF(descr);
                    changed = 1;
                }
#endif
            }
            memb++;
        }
        if (changed)
            PyType_Modified(type);
    }
#endif
    return 0;
}
#endif

/* FetchSharedCythonModule */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
}

/* FetchCommonType */
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t basicsize,
                               Py_ssize_t expected_basicsize) {
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
#if !CYTHON_USE_TYPE_SPECS
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* abi_module;
    const char* object_name;
    PyTypeObject *cached_type = NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    object_name = strrchr(type->tp_name, '.');
    object_name = object_name ? object_name+1 : type->tp_name;
    cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
    if (cached_type) {
        if (__Pyx_VerifyCachedType(
              (PyObject *)cached_type,
              object_name,
              cached_type->tp_basicsize,
              type->tp_basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    if (PyType_Ready(type) < 0) goto bad;
    if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
        goto bad;
    Py_INCREF(type);
    cached_type = type;
done:
    Py_DECREF(abi_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#else
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module, *cached_type = NULL;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    cached_type = PyObject_GetAttrString(abi_module, object_name);
    if (cached_type) {
        Py_ssize_t basicsize;
#if CYTHON_COMPILING_IN_LIMITED_API
        PyObject *py_basicsize;
        py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
        if (unlikely(!py_basicsize)) goto bad;
        basicsize = PyLong_AsSsize_t(py_basicsize);
        Py_DECREF(py_basicsize);
        py_basicsize = 0;
        if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
#else
        basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
#endif
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              basicsize,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    CYTHON_UNUSED_VAR(module);
    cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
    if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
done:
    Py_DECREF(abi_module);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#endif

/* PyVectorcallFastCallDict */
#if CYTHON_METH_FASTCALL
static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    PyObject *res = NULL;
    PyObject *kwnames;
    PyObject **newargs;
    PyObject **kwvalues;
    Py_ssize_t i, pos;
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
    if (unlikely(newargs == NULL)) {
        PyErr_NoMemory();
        return NULL;
    }
    for (j = 0; j < nargs; j++) newargs[j] = args[j];
    kwnames = PyTuple_New(nkw);
    if (unlikely(kwnames == NULL)) {
        PyMem_Free(newargs);
        return NULL;
    }
    kwvalues = newargs + nargs;
    pos = i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (PyDict_Next(kw, &pos, &key, &value)) {
        keys_are_strings &= Py_TYPE(key)->tp_flags;
        Py_INCREF(key);
        Py_INCREF(value);
        PyTuple_SET_ITEM(kwnames, i, key);
        kwvalues[i] = value;
        i++;
    }
    if (unlikely(!keys_are_strings)) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        goto cleanup;
    }
    res = vc(func, newargs, nargs, kwnames);
cleanup:
    Py_DECREF(kwnames);
    for (i = 0; i < nkw; i++)
        Py_DECREF(kwvalues[i]);
    PyMem_Free(newargs);
    return res;
}
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
        return vc(func, args, nargs, NULL);
    }
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
    if (__Pyx_CyFunction_Check(func)) {
        return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
    } else if (PyCFunction_Check(func)) {
        return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
    }
    return 0;
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
    return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
}
#endif
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    __Pyx_Py_XDECREF_SET(
        __Pyx_CyFunction_GetClassObj(f),
            ((classobj) ? __Pyx_NewRef(classobj) : NULL));
#else
    __Pyx_Py_XDECREF_SET(
        ((PyCMethodObject *) (f))->mm_class,
        (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
#endif
}
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
{
    CYTHON_UNUSED_VAR(closure);
    if (unlikely(op->func_doc == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
        if (unlikely(!op->func_doc)) return NULL;
#else
        if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
#endif
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_name = PyObject_GetAttrString(op->func, "__name__");
#elif PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_dict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_tuple;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_kwdict;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value || value == Py_None) {
        value = NULL;
    } else if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->func_annotations;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    int is_coroutine;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
#if PY_VERSION_HEX >= 0x03050000
    if (is_coroutine) {
        PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
#if CYTHON_ASSUME_SAFE_MACROS
        PyList_SET_ITEM(fromlist, 0, marker);
#else
        if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
            Py_DECREF(marker);
            Py_DECREF(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(op->func_is_coroutine)) {
            return __Pyx_NewRef(op->func_is_coroutine);
        }
ignore:
        PyErr_Clear();
    }
#endif
    op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
    return __Pyx_NewRef(op->func_is_coroutine);
}
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_GetAttrString(op->func, "__module__");
}
static int
__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_SetAttrString(op->func, "__module__", value);
}
#endif
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
#if !CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#endif
#if CYTHON_USE_TYPE_SPECS
    {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#if CYTHON_METH_FASTCALL
#if CYTHON_BACKPORT_VECTORCALL
    {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
#if !CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#endif
#endif
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
{
    CYTHON_UNUSED_VAR(args);
#if PY_MAJOR_VERSION >= 3
    Py_INCREF(m->func_qualname);
    return m->func_qualname;
#else
    return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyCFunctionObject *cf = (PyCFunctionObject*) op;
#endif
    if (unlikely(op == NULL))
        return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
    if (unlikely(!op->func)) return NULL;
#endif
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
#if !CYTHON_COMPILING_IN_LIMITED_API
    cf->m_ml = ml;
    cf->m_self = (PyObject *) op;
#endif
    Py_XINCREF(closure);
    op->func_closure = closure;
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_XINCREF(module);
    cf->m_module = module;
#endif
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_classobj = NULL;
#else
    ((PyCMethodObject*)op)->mm_class = NULL;
#endif
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults_size = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    op->func_is_coroutine = NULL;
#if CYTHON_METH_FASTCALL
    switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
    case METH_NOARGS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
        break;
    case METH_O:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
        break;
    case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
        break;
    case METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
        break;
    case METH_VARARGS | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = NULL;
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        Py_DECREF(op);
        return NULL;
    }
#endif
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func);
#else
    Py_CLEAR(((PyCFunctionObject*)m)->m_module);
#endif
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
#if !CYTHON_COMPILING_IN_LIMITED_API
#if PY_VERSION_HEX < 0x030900B1
    Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    __Pyx_PyHeapTypeObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func);
#else
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
#endif
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
#endif
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_is_coroutine);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
    PyObject *py_name = NULL;
    PyCFunction meth;
    int flags;
    meth = PyCFunction_GetFunction(f);
    if (unlikely(!meth)) return NULL;
    flags = PyCFunction_GetFlags(f);
    if (unlikely(flags < 0)) return NULL;
#else
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    int flags = f->m_ml->ml_flags;
#endif
    Py_ssize_t size;
    switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 0))
                return (*meth)(self, NULL);
#if CYTHON_COMPILING_IN_LIMITED_API
            py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
            if (!py_name) return NULL;
            PyErr_Format(PyExc_TypeError,
                "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                py_name, size);
            Py_DECREF(py_name);
#else
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
#endif
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
#if CYTHON_COMPILING_IN_LIMITED_API
            py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
            if (!py_name) return NULL;
            PyErr_Format(PyExc_TypeError,
                "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                py_name, size);
            Py_DECREF(py_name);
#else
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
#endif
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
    if (!py_name) return NULL;
    PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
                 py_name);
    Py_DECREF(py_name);
#else
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
#endif
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *self, *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
    if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
    self = ((PyCFunctionObject*)func)->m_self;
#endif
    result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
    return result;
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
#if CYTHON_METH_FASTCALL
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS
        return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
#else
        (void) &__Pyx_PyVectorcall_FastCallDict;
        return PyVectorcall_Call(func, args, kw);
#endif
    }
#endif
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
#if CYTHON_ASSUME_SAFE_MACROS
        argc = PyTuple_GET_SIZE(args);
#else
        argc = PyTuple_Size(args);
        if (unlikely(!argc) < 0) return NULL;
#endif
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
#if PY_MAJOR_VERSION > 2
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
#else
            PyErr_SetString(PyExc_TypeError,
                            "unbound method needs an argument");
#endif
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
{
    int ret = 0;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        if (unlikely(nargs < 1)) {
            PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
                         ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
        PyErr_Format(PyExc_TypeError,
                     "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, args[0]);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
    PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
}
#endif
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_CyFunctionType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
    {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
    {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
    {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
    {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
    {Py_tp_methods, (void *)__pyx_CyFunction_methods},
    {Py_tp_members, (void *)__pyx_CyFunction_members},
    {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
    {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
    {0, 0},
};
static PyType_Spec __pyx_CyFunctionType_spec = {
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
#else
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
#if !CYTHON_METH_FASTCALL
    0,
#elif CYTHON_BACKPORT_VECTORCALL
    (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
#else
    offsetof(PyCFunctionObject, vectorcall),
#endif
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_PyMethod_New,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
    0,
#endif
#if __PYX_NEED_TP_PRINT_SLOT
    0,
#endif
#if PY_VERSION_HEX >= 0x030C0000
    0,
#endif
#if PY_VERSION_HEX >= 0x030d00A4
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
    0,
#endif
};
#endif
static int __pyx_CyFunction_init(PyObject *module) {
#if CYTHON_USE_TYPE_SPECS
    __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
#else
    CYTHON_UNUSED_VAR(module);
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
#endif
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    m->defaults_size = size;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}
#endif

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result;
        result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    #if __PYX_LIMITED_VERSION_HEX < 0x030780000
    {
        PyObject *compiled = NULL, *result = NULL;
        if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
        if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
        compiled = Py_CompileString(
            "out = type(code)(\n"
            "  code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
            "  code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
            "  code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
            "  code.co_lnotab)\n", "<dummy>", Py_file_input);
        if (!compiled) return NULL;
        result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
        Py_DECREF(compiled);
        if (!result) PyErr_Print();
        Py_DECREF(result);
        result = PyDict_GetItemString(scratch_dict, "out");
        if (result) Py_INCREF(result);
        return result;
    }
    #else
    return NULL;
    #endif
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
    PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
    PyObject *exc_type, *exc_value, *exc_traceback;
    int success = 0;
    if (c_line) {
        (void) __pyx_cfilenm;
        (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
    if (unlikely(!code_object)) goto bad;
    py_py_line = PyLong_FromLong(py_line);
    if (unlikely(!py_py_line)) goto bad;
    py_funcname = PyUnicode_FromString(funcname);
    if (unlikely(!py_funcname)) goto bad;
    dict = PyDict_New();
    if (unlikely(!dict)) goto bad;
    {
        PyObject *old_code_object = code_object;
        code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
        Py_DECREF(old_code_object);
    }
    if (unlikely(!code_object)) goto bad;
    getframe = PySys_GetObject("_getframe");
    if (unlikely(!getframe)) goto bad;
    if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
    frame = PyEval_EvalCode(code_object, dict, dict);
    if (unlikely(!frame) || frame == Py_None) goto bad;
    success = 1;
  bad:
    PyErr_Restore(exc_type, exc_value, exc_traceback);
    Py_XDECREF(code_object);
    Py_XDECREF(py_py_line);
    Py_XDECREF(py_funcname);
    Py_XDECREF(dict);
    Py_XDECREF(replace);
    if (success) {
        PyTraceBack_Here(
            (struct _frame*)frame);
    }
    Py_XDECREF(frame);
}
#else
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = NULL;
    PyObject *py_funcname = NULL;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_srcfile = NULL;
    py_srcfile = PyString_FromString(filename);
    if (!py_srcfile) goto bad;
    #endif
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        if (!py_funcname) goto bad;
        #endif
    }
    #if PY_MAJOR_VERSION < 3
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    #else
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    #endif
    Py_XDECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_srcfile);
    #endif
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject *ptype, *pvalue, *ptraceback;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
#endif

/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

static PyObject* __pyx_convert__to_py___pyx_t_7cytimes_5utils_ymd(__pyx_t_7cytimes_5utils_ymd s) {
  PyObject* res;
  PyObject* member;
  res = __Pyx_PyDict_NewPresized(3); if (unlikely(!res)) return NULL;
  member = __Pyx_PyInt_From_int(s.year); if (unlikely(!member)) goto bad;
  if (unlikely(PyDict_SetItem(res, __pyx_n_s_year, member) < 0)) goto bad;
  Py_DECREF(member);
  member = __Pyx_PyInt_From_int(s.month); if (unlikely(!member)) goto bad;
  if (unlikely(PyDict_SetItem(res, __pyx_n_s_month, member) < 0)) goto bad;
  Py_DECREF(member);
  member = __Pyx_PyInt_From_int(s.day); if (unlikely(!member)) goto bad;
  if (unlikely(PyDict_SetItem(res, __pyx_n_s_day, member) < 0)) goto bad;
  Py_DECREF(member);
  return res;
  bad:
  Py_XDECREF(member);
  Py_DECREF(res);
  return NULL;
}
/* 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_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(PY_LONG_LONG) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (PY_LONG_LONG) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (PY_LONG_LONG) -1;
        val = __Pyx_PyInt_As_PY_LONG_LONG(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(PY_LONG_LONG) >= 2 * PyLong_SHIFT)) {
                            return (PY_LONG_LONG) (((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(PY_LONG_LONG) >= 3 * PyLong_SHIFT)) {
                            return (PY_LONG_LONG) (((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(PY_LONG_LONG) >= 4 * PyLong_SHIFT)) {
                            return (PY_LONG_LONG) (((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (PY_LONG_LONG) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(PY_LONG_LONG) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(PY_LONG_LONG) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) {
                            return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) {
                            return (PY_LONG_LONG) ((((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) {
                            return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) {
                            return (PY_LONG_LONG) ((((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT)) {
                            return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT)) {
                            return (PY_LONG_LONG) ((((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(PY_LONG_LONG) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        PY_LONG_LONG val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (PY_LONG_LONG) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (PY_LONG_LONG) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (PY_LONG_LONG) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (PY_LONG_LONG) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(PY_LONG_LONG) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((PY_LONG_LONG) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(PY_LONG_LONG) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((PY_LONG_LONG) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((PY_LONG_LONG) 1) << (sizeof(PY_LONG_LONG) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (PY_LONG_LONG) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to PY_LONG_LONG");
    return (PY_LONG_LONG) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to PY_LONG_LONG");
    return (PY_LONG_LONG) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(PY_LONG_LONG) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PY_LONG_LONG));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(int) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (int) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(int) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(int) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        int val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(npy_int64) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_int64) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(npy_int64) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(npy_int64),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_int64));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(npy_int64) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (npy_int64) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        npy_int64 val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (npy_int64) -1;
        val = __Pyx_PyInt_As_npy_int64(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(npy_int64, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(npy_int64) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_int64) >= 2 * PyLong_SHIFT)) {
                            return (npy_int64) (((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(npy_int64) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_int64) >= 3 * PyLong_SHIFT)) {
                            return (npy_int64) (((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(npy_int64) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_int64) >= 4 * PyLong_SHIFT)) {
                            return (npy_int64) (((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (npy_int64) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(npy_int64) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(npy_int64, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT)) {
                            return (npy_int64) (((npy_int64)-1)*(((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(npy_int64) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT)) {
                            return (npy_int64) ((((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT)) {
                            return (npy_int64) (((npy_int64)-1)*(((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(npy_int64) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT)) {
                            return (npy_int64) ((((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT)) {
                            return (npy_int64) (((npy_int64)-1)*(((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(npy_int64) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT)) {
                            return (npy_int64) ((((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(npy_int64) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(npy_int64) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        npy_int64 val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (npy_int64) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (npy_int64) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (npy_int64) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (npy_int64) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(npy_int64) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((npy_int64) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(npy_int64) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((npy_int64) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((npy_int64) 1) << (sizeof(npy_int64) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (npy_int64) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to npy_int64");
    return (npy_int64) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to npy_int64");
    return (npy_int64) -1;
}

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(long) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (long) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(long) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(long) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        long val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (long) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (long) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (long) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (long) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((long) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((long) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (long) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* 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);
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
        PyErr_Clear();
        Py_XDECREF(name);
        name = __Pyx_NewRef(__pyx_n_s__205);
    }
    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_12
#define __PYX_HAVE_RT_ImportVoidPtr_3_0_12
static int __Pyx_ImportVoidPtr_3_0_12(PyObject *module, const char *name, void **p, const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, name);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%.200s does not export expected C variable %.200s",
                PyModule_GetName(module), name);
        goto bad;
    }
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    *p = PyCapsule_GetPointer(cobj, sig);
    if (!(*p))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

/* 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 */
