From e791da0036154197aaf499f86be4ae730bd7171c Mon Sep 17 00:00:00 2001 From: Brock Date: Fri, 22 Apr 2022 08:51:37 -0700 Subject: [PATCH 1/7] implement utc_val_to_local_val --- pandas/_libs/tslibs/vectorized.pyx | 97 ++++++++---------------------- 1 file changed, 25 insertions(+), 72 deletions(-) diff --git a/pandas/_libs/tslibs/vectorized.pyx b/pandas/_libs/tslibs/vectorized.pyx index 0f0e321b2d5bf..414ecef871003 100644 --- a/pandas/_libs/tslibs/vectorized.pyx +++ b/pandas/_libs/tslibs/vectorized.pyx @@ -59,6 +59,7 @@ cdef class Localizer: Py_ssize_t ntrans const int64_t[::1] deltas int64_t delta + int64_t* tdata @cython.initializedcheck(False) @cython.boundscheck(False) @@ -69,6 +70,7 @@ cdef class Localizer: self.ntrans = -1 # placeholder self.delta = -1 # placeholder self.deltas = _deltas_placeholder + self.tdata = NULL if is_utc(tz) or tz is None: self.use_utc = True @@ -79,17 +81,29 @@ cdef class Localizer: else: trans, deltas, typ = get_dst_info(tz) self.trans = trans - self.ntrans = trans.shape[0] + self.ntrans = self.trans.shape[0] self.deltas = deltas if typ != "pytz" and typ != "dateutil": # static/fixed; in this case we know that len(delta) == 1 self.use_fixed = True - self.delta = deltas[0] + self.delta = self.deltas[0] else: self.use_dst = True if typ == "pytz": self.use_pytz = True + self.tdata = cnp.PyArray_DATA(self.trans) + + cdef inline int64_t utc_val_to_local_val(self, int64_t utc_val, Py_ssize_t* pos): + if self.use_utc: + return utc_val + elif self.use_tzlocal: + return utc_val + localize_tzinfo_api(utc_val, self.tz) + elif self.use_fixed: + local_val = utc_val + self.delta + else: + pos[0] = bisect_right_i8(self.tdata, utc_val, self.ntrans) - 1 + return utc_val + self.deltas[pos[0]] # ------------------------------------------------------------------------- @@ -135,7 +149,6 @@ def ints_to_pydatetime( Localizer info = Localizer(tz) int64_t utc_val, local_val Py_ssize_t pos, i, n = stamps.shape[0] - int64_t* tdata = NULL npy_datetimestruct dts tzinfo new_tz @@ -156,9 +169,6 @@ def ints_to_pydatetime( "box must be one of 'datetime', 'date', 'time' or 'timestamp'" ) - if info.use_dst: - tdata = cnp.PyArray_DATA(info.trans) - for i in range(n): utc_val = stamps[i] new_tz = tz @@ -167,19 +177,10 @@ def ints_to_pydatetime( result[i] = NaT continue - if info.use_utc: - local_val = utc_val - elif info.use_tzlocal: - local_val = utc_val + localize_tzinfo_api(utc_val, tz) - elif info.use_fixed: - local_val = utc_val + info.delta - else: - pos = bisect_right_i8(tdata, utc_val, info.ntrans) - 1 - local_val = utc_val + info.deltas[pos] - - if info.use_pytz: - # find right representation of dst etc in pytz timezone - new_tz = tz._tzinfos[tz._transition_info[pos]] + local_val = info.utc_val_to_local_val(utc_val, &pos) + if info.use_pytz: + # find right representation of dst etc in pytz timezone + new_tz = tz._tzinfos[tz._transition_info[pos]] dt64_to_dtstruct(local_val, &dts) @@ -222,28 +223,16 @@ def get_resolution(const int64_t[:] stamps, tzinfo tz=None) -> Resolution: Localizer info = Localizer(tz) int64_t utc_val, local_val Py_ssize_t pos, i, n = stamps.shape[0] - int64_t* tdata = NULL npy_datetimestruct dts c_Resolution reso = c_Resolution.RESO_DAY, curr_reso - if info.use_dst: - tdata = cnp.PyArray_DATA(info.trans) - for i in range(n): utc_val = stamps[i] if utc_val == NPY_NAT: continue - if info.use_utc: - local_val = utc_val - elif info.use_tzlocal: - local_val = utc_val + localize_tzinfo_api(utc_val, tz) - elif info.use_fixed: - local_val = utc_val + info.delta - else: - pos = bisect_right_i8(tdata, utc_val, info.ntrans) - 1 - local_val = utc_val + info.deltas[pos] + local_val = info.utc_val_to_local_val(utc_val, &pos) dt64_to_dtstruct(local_val, &dts) curr_reso = _reso_stamp(&dts) @@ -278,28 +267,16 @@ cpdef ndarray[int64_t] normalize_i8_timestamps(const int64_t[:] stamps, tzinfo t Localizer info = Localizer(tz) int64_t utc_val, local_val Py_ssize_t pos, i, n = stamps.shape[0] - int64_t* tdata = NULL int64_t[::1] result = np.empty(n, dtype=np.int64) - if info.use_dst: - tdata = cnp.PyArray_DATA(info.trans) - for i in range(n): utc_val = stamps[i] if utc_val == NPY_NAT: result[i] = NPY_NAT continue - if info.use_utc: - local_val = utc_val - elif info.use_tzlocal: - local_val = utc_val + localize_tzinfo_api(utc_val, tz) - elif info.use_fixed: - local_val = utc_val + info.delta - else: - pos = bisect_right_i8(tdata, utc_val, info.ntrans) - 1 - local_val = utc_val + info.deltas[pos] + local_val = info.utc_val_to_local_val(utc_val, &pos) result[i] = local_val - (local_val % DAY_NANOS) @@ -327,22 +304,11 @@ def is_date_array_normalized(const int64_t[:] stamps, tzinfo tz=None) -> bool: Localizer info = Localizer(tz) int64_t utc_val, local_val Py_ssize_t pos, i, n = stamps.shape[0] - int64_t* tdata = NULL - - if info.use_dst: - tdata = cnp.PyArray_DATA(info.trans) for i in range(n): utc_val = stamps[i] - if info.use_utc: - local_val = utc_val - elif info.use_tzlocal: - local_val = utc_val + localize_tzinfo_api(utc_val, tz) - elif info.use_fixed: - local_val = utc_val + info.delta - else: - pos = bisect_right_i8(tdata, utc_val, info.ntrans) - 1 - local_val = utc_val + info.deltas[pos] + + local_val = info.utc_val_to_local_val(utc_val, &pos) if local_val % DAY_NANOS != 0: return False @@ -361,15 +327,11 @@ def dt64arr_to_periodarr(ndarray stamps, int freq, tzinfo tz): Localizer info = Localizer(tz) Py_ssize_t pos, i, n = stamps.size int64_t utc_val, local_val, res_val - int64_t* tdata = NULL npy_datetimestruct dts ndarray result = cnp.PyArray_EMPTY(stamps.ndim, stamps.shape, cnp.NPY_INT64, 0) cnp.broadcast mi = cnp.PyArray_MultiIterNew2(result, stamps) - if info.use_dst: - tdata = cnp.PyArray_DATA(info.trans) - for i in range(n): # Analogous to: utc_val = stamps[i] utc_val = (cnp.PyArray_MultiIter_DATA(mi, 1))[0] @@ -377,16 +339,7 @@ def dt64arr_to_periodarr(ndarray stamps, int freq, tzinfo tz): if utc_val == NPY_NAT: res_val = NPY_NAT else: - if info.use_utc: - local_val = utc_val - elif info.use_tzlocal: - local_val = utc_val + localize_tzinfo_api(utc_val, tz) - elif info.use_fixed: - local_val = utc_val + info.delta - else: - pos = bisect_right_i8(tdata, utc_val, info.ntrans) - 1 - local_val = utc_val + info.deltas[pos] - + local_val = info.utc_val_to_local_val(utc_val, &pos) dt64_to_dtstruct(local_val, &dts) res_val = get_period_ordinal(&dts, freq) From 4caac7eeefb58b387f4b35230c9f19910c0a11a8 Mon Sep 17 00:00:00 2001 From: Brock Date: Fri, 22 Apr 2022 09:55:34 -0700 Subject: [PATCH 2/7] boundscheck(False) --- pandas/_libs/tslibs/vectorized.pyx | 1 + 1 file changed, 1 insertion(+) diff --git a/pandas/_libs/tslibs/vectorized.pyx b/pandas/_libs/tslibs/vectorized.pyx index 414ecef871003..ddd694419a926 100644 --- a/pandas/_libs/tslibs/vectorized.pyx +++ b/pandas/_libs/tslibs/vectorized.pyx @@ -94,6 +94,7 @@ cdef class Localizer: self.use_pytz = True self.tdata = cnp.PyArray_DATA(self.trans) + @cython.boundscheck(False) cdef inline int64_t utc_val_to_local_val(self, int64_t utc_val, Py_ssize_t* pos): if self.use_utc: return utc_val From a0785af5a87fcf35aee135a8bd1bc24f72f18882 Mon Sep 17 00:00:00 2001 From: Brock Date: Fri, 22 Apr 2022 18:50:52 -0700 Subject: [PATCH 3/7] avoid unitialized-warning --- pandas/_libs/tslibs/vectorized.pyx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pandas/_libs/tslibs/vectorized.pyx b/pandas/_libs/tslibs/vectorized.pyx index ddd694419a926..cf465d0ab8284 100644 --- a/pandas/_libs/tslibs/vectorized.pyx +++ b/pandas/_libs/tslibs/vectorized.pyx @@ -149,7 +149,8 @@ def ints_to_pydatetime( cdef: Localizer info = Localizer(tz) int64_t utc_val, local_val - Py_ssize_t pos, i, n = stamps.shape[0] + Py_ssize_t i, n = stamps.shape[0] + Py_ssize_t pos = -1 # unused, avoid not-initialized warning npy_datetimestruct dts tzinfo new_tz @@ -223,7 +224,8 @@ def get_resolution(const int64_t[:] stamps, tzinfo tz=None) -> Resolution: cdef: Localizer info = Localizer(tz) int64_t utc_val, local_val - Py_ssize_t pos, i, n = stamps.shape[0] + Py_ssize_t i, n = stamps.shape[0] + Py_ssize_t pos = -1 # unused, avoid not-initialized warning npy_datetimestruct dts c_Resolution reso = c_Resolution.RESO_DAY, curr_reso @@ -267,7 +269,8 @@ cpdef ndarray[int64_t] normalize_i8_timestamps(const int64_t[:] stamps, tzinfo t cdef: Localizer info = Localizer(tz) int64_t utc_val, local_val - Py_ssize_t pos, i, n = stamps.shape[0] + Py_ssize_t i, n = stamps.shape[0] + Py_ssize_t pos = -1 # unused, avoid not-initialized warning int64_t[::1] result = np.empty(n, dtype=np.int64) @@ -304,7 +307,8 @@ def is_date_array_normalized(const int64_t[:] stamps, tzinfo tz=None) -> bool: cdef: Localizer info = Localizer(tz) int64_t utc_val, local_val - Py_ssize_t pos, i, n = stamps.shape[0] + Py_ssize_t i, n = stamps.shape[0] + Py_ssize_t pos = -1 # unused, avoid not-initialized warning for i in range(n): utc_val = stamps[i] @@ -326,7 +330,8 @@ def dt64arr_to_periodarr(ndarray stamps, int freq, tzinfo tz): # stamps is int64_t, arbitrary ndim cdef: Localizer info = Localizer(tz) - Py_ssize_t pos, i, n = stamps.size + Py_ssize_t i, n = stamps.shape[0] + Py_ssize_t pos = -1 # unused, avoid not-initialized warning int64_t utc_val, local_val, res_val npy_datetimestruct dts From 1169181ef808da6941aa1cf4534ce3583ac24ec5 Mon Sep 17 00:00:00 2001 From: Brock Date: Fri, 22 Apr 2022 20:12:37 -0700 Subject: [PATCH 4/7] typo fixup --- pandas/_libs/tslibs/vectorized.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/_libs/tslibs/vectorized.pyx b/pandas/_libs/tslibs/vectorized.pyx index cf465d0ab8284..585d6843be57c 100644 --- a/pandas/_libs/tslibs/vectorized.pyx +++ b/pandas/_libs/tslibs/vectorized.pyx @@ -101,7 +101,7 @@ cdef class Localizer: elif self.use_tzlocal: return utc_val + localize_tzinfo_api(utc_val, self.tz) elif self.use_fixed: - local_val = utc_val + self.delta + return utc_val + self.delta else: pos[0] = bisect_right_i8(self.tdata, utc_val, self.ntrans) - 1 return utc_val + self.deltas[pos[0]] @@ -330,7 +330,7 @@ def dt64arr_to_periodarr(ndarray stamps, int freq, tzinfo tz): # stamps is int64_t, arbitrary ndim cdef: Localizer info = Localizer(tz) - Py_ssize_t i, n = stamps.shape[0] + Py_ssize_t i, n = stamps.size Py_ssize_t pos = -1 # unused, avoid not-initialized warning int64_t utc_val, local_val, res_val From 98a16c5310fdf6c5aa83d8f1aba40380d59cb269 Mon Sep 17 00:00:00 2001 From: Brock Date: Sun, 24 Apr 2022 08:05:17 -0700 Subject: [PATCH 5/7] troubleshoot 32bit build --- pandas/_libs/tslibs/vectorized.html | 2257 +++++++++++++++++++++++++++ pandas/_libs/tslibs/vectorized.pyx | 2 +- 2 files changed, 2258 insertions(+), 1 deletion(-) create mode 100644 pandas/_libs/tslibs/vectorized.html diff --git a/pandas/_libs/tslibs/vectorized.html b/pandas/_libs/tslibs/vectorized.html new file mode 100644 index 0000000000000..e4d45d5244235 --- /dev/null +++ b/pandas/_libs/tslibs/vectorized.html @@ -0,0 +1,2257 @@ + + + + + + Cython: vectorized.pyx + + + +

Generated by Cython 0.29.24

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: vectorized.c

+
+001: import cython
+
  __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_6) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 002: 
+
 003: from cpython.datetime cimport (
+
 004:     date,
+
 005:     datetime,
+
 006:     time,
+
 007:     tzinfo,
+
 008: )
+
 009: 
+
+010: import numpy as np
+
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(1, 10, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 011: 
+
 012: cimport numpy as cnp
+
 013: from numpy cimport (
+
 014:     int64_t,
+
 015:     intp_t,
+
 016:     ndarray,
+
 017: )
+
 018: 
+
+019: cnp.import_array()
+
  __pyx_t_2 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 19, __pyx_L1_error)
+
 020: 
+
+021: from .dtypes import Resolution
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Resolution);
+  __Pyx_GIVEREF(__pyx_n_s_Resolution);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Resolution);
+  __pyx_t_3 = __Pyx_Import(__pyx_n_s_dtypes, __pyx_t_1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Resolution); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Resolution, __pyx_t_1) < 0) __PYX_ERR(1, 21, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 022: 
+
 023: from .ccalendar cimport DAY_NANOS
+
 024: from .dtypes cimport c_Resolution
+
 025: from .nattype cimport (
+
 026:     NPY_NAT,
+
 027:     c_NaT as NaT,
+
 028: )
+
 029: from .np_datetime cimport (
+
 030:     dt64_to_dtstruct,
+
 031:     npy_datetimestruct,
+
 032: )
+
 033: from .offsets cimport BaseOffset
+
 034: from .period cimport get_period_ordinal
+
 035: from .timestamps cimport create_timestamp_from_ts
+
 036: from .timezones cimport (
+
 037:     get_dst_info,
+
 038:     is_tzlocal,
+
 039:     is_utc,
+
 040:     is_zoneinfo,
+
 041: )
+
 042: from .tzconversion cimport (
+
 043:     bisect_right_i8,
+
 044:     localize_tzinfo_api,
+
 045: )
+
 046: 
+
 047: 
+
+048: cdef const int64_t[::1] _deltas_placeholder = np.array([], dtype=np.int64)
+
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 48, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 48, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 48, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 48, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+  __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 48, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 48, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 48, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(1, 48, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 48, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t__const__(__pyx_t_6, 0); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(1, 48, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __PYX_XDEC_MEMVIEW(&__pyx_v_6pandas_5_libs_6tslibs_10vectorized__deltas_placeholder, 1);
+  __pyx_v_6pandas_5_libs_6tslibs_10vectorized__deltas_placeholder = __pyx_t_7;
+  __pyx_t_7.memview = NULL;
+  __pyx_t_7.data = NULL;
+
 049: 
+
 050: 
+
 051: @cython.freelist(16)
+
 052: @cython.internal
+
 053: @cython.final
+
+054: cdef class Localizer:
+
struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer {
+  PyObject_HEAD
+  struct __pyx_vtabstruct_6pandas_5_libs_6tslibs_10vectorized_Localizer *__pyx_vtab;
+  PyDateTime_TZInfo *tz;
+  int use_utc;
+  int use_fixed;
+  int use_tzlocal;
+  int use_dst;
+  int use_pytz;
+  PyArrayObject *trans;
+  Py_ssize_t ntrans;
+  __Pyx_memviewslice deltas;
+  __pyx_t_5numpy_int64_t delta;
+  __pyx_t_5numpy_int64_t *tdata;
+};
+/* … */
+struct __pyx_vtabstruct_6pandas_5_libs_6tslibs_10vectorized_Localizer {
+  __pyx_t_5numpy_int64_t (*utc_val_to_local_val)(struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *, __pyx_t_5numpy_int64_t, Py_ssize_t *);
+};
+static struct __pyx_vtabstruct_6pandas_5_libs_6tslibs_10vectorized_Localizer *__pyx_vtabptr_6pandas_5_libs_6tslibs_10vectorized_Localizer;
+static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5_libs_6tslibs_10vectorized_9Localizer_utc_val_to_local_val(struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *, __pyx_t_5numpy_int64_t, Py_ssize_t *);
+
+
 055:     cdef:
+
 056:         tzinfo tz
+
 057:         bint use_utc, use_fixed, use_tzlocal, use_dst, use_pytz
+
 058:         ndarray trans
+
 059:         Py_ssize_t ntrans
+
 060:         const int64_t[::1] deltas
+
 061:         int64_t delta
+
 062:         int64_t* tdata
+
 063: 
+
 064:     @cython.initializedcheck(False)
+
 065:     @cython.boundscheck(False)
+
+066:     def __cinit__(self, tzinfo tz):
+
/* Python wrapper */
+static int __pyx_pw_6pandas_5_libs_6tslibs_10vectorized_9Localizer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6pandas_5_libs_6tslibs_10vectorized_9Localizer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyDateTime_TZInfo *__pyx_v_tz = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tz,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tz)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 66, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_tz = ((PyDateTime_TZInfo *)values[0]);
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 66, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.Localizer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tz), __pyx_ptype_7cpython_8datetime_tzinfo, 1, "tz", 0))) __PYX_ERR(1, 66, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6pandas_5_libs_6tslibs_10vectorized_9Localizer___cinit__(((struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *)__pyx_v_self), __pyx_v_tz);
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6pandas_5_libs_6tslibs_10vectorized_9Localizer___cinit__(struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *__pyx_v_self, PyDateTime_TZInfo *__pyx_v_tz) {
+  PyObject *__pyx_v_trans = NULL;
+  PyObject *__pyx_v_deltas = NULL;
+  PyObject *__pyx_v_typ = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
+  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.Localizer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_trans);
+  __Pyx_XDECREF(__pyx_v_deltas);
+  __Pyx_XDECREF(__pyx_v_typ);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+067:         self.tz = tz
+
  __Pyx_INCREF(((PyObject *)__pyx_v_tz));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_tz));
+  __Pyx_GOTREF(__pyx_v_self->tz);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->tz));
+  __pyx_v_self->tz = __pyx_v_tz;
+
+068:         self.use_utc = self.use_tzlocal = self.use_fixed = False
+
  __pyx_v_self->use_utc = 0;
+  __pyx_v_self->use_tzlocal = 0;
+  __pyx_v_self->use_fixed = 0;
+
+069:         self.use_dst = self.use_pytz = False
+
  __pyx_v_self->use_dst = 0;
+  __pyx_v_self->use_pytz = 0;
+
+070:         self.ntrans = -1  # placeholder
+
  __pyx_v_self->ntrans = -1L;
+
+071:         self.delta = -1  # placeholder
+
  __pyx_v_self->delta = -1LL;
+
+072:         self.deltas = _deltas_placeholder
+
  __PYX_XDEC_MEMVIEW(&__pyx_v_self->deltas, 0);
+  __PYX_INC_MEMVIEW(&__pyx_v_6pandas_5_libs_6tslibs_10vectorized__deltas_placeholder, 0);
+  __pyx_v_self->deltas = __pyx_v_6pandas_5_libs_6tslibs_10vectorized__deltas_placeholder;
+
+073:         self.tdata = NULL
+
  __pyx_v_self->tdata = NULL;
+
 074: 
+
+075:         if is_utc(tz) or tz is None:
+
  __pyx_t_2 = (__pyx_f_6pandas_5_libs_6tslibs_9timezones_is_utc(__pyx_v_tz, 0) != 0);
+  if (!__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = (((PyObject *)__pyx_v_tz) == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
+/* … */
+    goto __pyx_L3;
+  }
+
+076:             self.use_utc = True
+
    __pyx_v_self->use_utc = 1;
+
 077: 
+
+078:         elif is_tzlocal(tz) or is_zoneinfo(tz):
+
  __pyx_t_3 = (__pyx_f_6pandas_5_libs_6tslibs_9timezones_is_tzlocal(__pyx_v_tz) != 0);
+  if (!__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L6_bool_binop_done;
+  }
+  __pyx_t_3 = (__pyx_f_6pandas_5_libs_6tslibs_9timezones_is_zoneinfo(__pyx_v_tz) != 0);
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L6_bool_binop_done:;
+  if (__pyx_t_1) {
+/* … */
+    goto __pyx_L3;
+  }
+
+079:             self.use_tzlocal = True
+
    __pyx_v_self->use_tzlocal = 1;
+
 080: 
+
 081:         else:
+
+082:             trans, deltas, typ = get_dst_info(tz)
+
  /*else*/ {
+    __pyx_t_4 = __pyx_f_6pandas_5_libs_6tslibs_9timezones_get_dst_info(__pyx_v_tz); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 82, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
+      PyObject* sequence = __pyx_t_4;
+      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, 82, __pyx_L1_error)
+      }
+      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+      if (likely(PyTuple_CheckExact(sequence))) {
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
+      } else {
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
+      }
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_6);
+      __Pyx_INCREF(__pyx_t_7);
+      #else
+      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 82, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 82, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 82, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      #endif
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else {
+      Py_ssize_t index = -1;
+      __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 82, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
+      index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_6);
+      index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(1, 82, __pyx_L1_error)
+      __pyx_t_9 = NULL;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      goto __pyx_L9_unpacking_done;
+      __pyx_L8_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_9 = NULL;
+      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+      __PYX_ERR(1, 82, __pyx_L1_error)
+      __pyx_L9_unpacking_done:;
+    }
+    __pyx_v_trans = __pyx_t_5;
+    __pyx_t_5 = 0;
+    __pyx_v_deltas = __pyx_t_6;
+    __pyx_t_6 = 0;
+    __pyx_v_typ = __pyx_t_7;
+    __pyx_t_7 = 0;
+
+083:             self.trans = trans
+
    if (!(likely(((__pyx_v_trans) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_trans, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 83, __pyx_L1_error)
+    __pyx_t_4 = __pyx_v_trans;
+    __Pyx_INCREF(__pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
+    __Pyx_GOTREF(__pyx_v_self->trans);
+    __Pyx_DECREF(((PyObject *)__pyx_v_self->trans));
+    __pyx_v_self->trans = ((PyArrayObject *)__pyx_t_4);
+    __pyx_t_4 = 0;
+
+084:             self.ntrans = self.trans.shape[0]
+
    __pyx_v_self->ntrans = (__pyx_v_self->trans->dimensions[0]);
+
+085:             self.deltas = deltas
+
    __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t__const__(__pyx_v_deltas, 0); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(1, 85, __pyx_L1_error)
+    __PYX_XDEC_MEMVIEW(&__pyx_v_self->deltas, 0);
+    __pyx_v_self->deltas = __pyx_t_10;
+    __pyx_t_10.memview = NULL;
+    __pyx_t_10.data = NULL;
+
 086: 
+
+087:             if typ != "pytz" and typ != "dateutil":
+
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_typ, __pyx_n_u_pytz, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 87, __pyx_L1_error)
+    if (__pyx_t_3) {
+    } else {
+      __pyx_t_1 = __pyx_t_3;
+      goto __pyx_L11_bool_binop_done;
+    }
+    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_typ, __pyx_n_u_dateutil, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 87, __pyx_L1_error)
+    __pyx_t_1 = __pyx_t_3;
+    __pyx_L11_bool_binop_done:;
+    if (__pyx_t_1) {
+/* … */
+      goto __pyx_L10;
+    }
+
 088:                 # static/fixed; in this case we know that len(delta) == 1
+
+089:                 self.use_fixed = True
+
      __pyx_v_self->use_fixed = 1;
+
+090:                 self.delta = self.deltas[0]
+
      __pyx_t_11 = 0;
+      if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_v_self->deltas.shape[0];
+      __pyx_v_self->delta = (*((__pyx_t_5numpy_int64_t const  *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int64_t const  *) __pyx_v_self->deltas.data) + __pyx_t_11)) )));
+
 091:             else:
+
+092:                 self.use_dst = True
+
    /*else*/ {
+      __pyx_v_self->use_dst = 1;
+
+093:                 if typ == "pytz":
+
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_typ, __pyx_n_u_pytz, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 93, __pyx_L1_error)
+      if (__pyx_t_1) {
+/* … */
+      }
+
+094:                     self.use_pytz = True
+
        __pyx_v_self->use_pytz = 1;
+
+095:                 self.tdata = <int64_t*>cnp.PyArray_DATA(self.trans)
+
      __pyx_t_4 = ((PyObject *)__pyx_v_self->trans);
+      __Pyx_INCREF(__pyx_t_4);
+      __pyx_v_self->tdata = ((__pyx_t_5numpy_int64_t *)PyArray_DATA(((PyArrayObject *)__pyx_t_4)));
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    }
+    __pyx_L10:;
+  }
+  __pyx_L3:;
+
 096: 
+
 097:     @cython.boundscheck(False)
+
+098:     cdef inline int64_t utc_val_to_local_val(self, int64_t utc_val, Py_ssize_t* pos):
+
static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5_libs_6tslibs_10vectorized_9Localizer_utc_val_to_local_val(struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_utc_val, Py_ssize_t *__pyx_v_pos) {
+  __pyx_t_5numpy_int64_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("utc_val_to_local_val", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_WriteUnraisable("pandas._libs.tslibs.vectorized.Localizer.utc_val_to_local_val", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+099:         if self.use_utc:
+
  __pyx_t_1 = (__pyx_v_self->use_utc != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+100:             return utc_val
+
    __pyx_r = __pyx_v_utc_val;
+    goto __pyx_L0;
+
+101:         elif self.use_tzlocal:
+
  __pyx_t_1 = (__pyx_v_self->use_tzlocal != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+102:             return utc_val + localize_tzinfo_api(utc_val, self.tz)
+
    __pyx_t_2 = ((PyObject *)__pyx_v_self->tz);
+    __Pyx_INCREF(__pyx_t_2);
+    __pyx_t_3 = __pyx_f_6pandas_5_libs_6tslibs_12tzconversion_localize_tzinfo_api(__pyx_v_utc_val, ((PyDateTime_TZInfo *)__pyx_t_2), NULL); if (unlikely(__pyx_t_3 == ((__pyx_t_5numpy_int64_t)-1LL) && PyErr_Occurred())) __PYX_ERR(1, 102, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_r = (__pyx_v_utc_val + __pyx_t_3);
+    goto __pyx_L0;
+
+103:         elif self.use_fixed:
+
  __pyx_t_1 = (__pyx_v_self->use_fixed != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+104:             return utc_val + self.delta
+
    __pyx_r = (__pyx_v_utc_val + __pyx_v_self->delta);
+    goto __pyx_L0;
+
 105:         else:
+
+106:             pos[0] = bisect_right_i8(self.tdata, utc_val, self.ntrans) - 1
+
  /*else*/ {
+    (__pyx_v_pos[0]) = (__pyx_f_6pandas_5_libs_6tslibs_12tzconversion_bisect_right_i8(__pyx_v_self->tdata, __pyx_v_utc_val, __pyx_v_self->ntrans) - 1);
+
+107:             return utc_val + self.deltas[pos[0]]
+
    if (unlikely(!__pyx_v_self->deltas.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 107, __pyx_L1_error)}
+    __pyx_t_4 = (__pyx_v_pos[0]);
+    if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_self->deltas.shape[0];
+    __pyx_r = (__pyx_v_utc_val + (*((__pyx_t_5numpy_int64_t const  *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int64_t const  *) __pyx_v_self->deltas.data) + __pyx_t_4)) ))));
+    goto __pyx_L0;
+  }
+
 108: 
+
 109: 
+
 110: # -------------------------------------------------------------------------
+
 111: 
+
 112: 
+
 113: @cython.wraparound(False)
+
 114: @cython.boundscheck(False)
+
+115: def ints_to_pydatetime(
+
/* Python wrapper */
+static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_1ints_to_pydatetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6pandas_5_libs_6tslibs_10vectorized_ints_to_pydatetime[] = "\n    Convert an i8 repr to an ndarray of datetimes, date, time or Timestamp.\n\n    Parameters\n    ----------\n    stamps : array of i8\n    tz : str, optional\n         convert to this timezone\n    freq : BaseOffset, optional\n         freq to convert\n    fold : bint, default is 0\n        Due to daylight saving time, one wall clock time can occur twice\n        when shifting from summer to winter time; fold describes whether the\n        datetime-like corresponds  to the first (0) or the second time (1)\n        the wall clock hits the ambiguous time\n\n        .. versionadded:: 1.1.0\n    box : {'datetime', 'timestamp', 'date', 'time'}, default 'datetime'\n        * If datetime, convert to datetime.datetime\n        * If date, convert to datetime.date\n        * If time, convert to datetime.time\n        * If Timestamp, convert to pandas.Timestamp\n\n    Returns\n    -------\n    ndarray[object] of type specified by box\n    ";
+static PyMethodDef __pyx_mdef_6pandas_5_libs_6tslibs_10vectorized_1ints_to_pydatetime = {"ints_to_pydatetime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_1ints_to_pydatetime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6tslibs_10vectorized_ints_to_pydatetime};
+static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_1ints_to_pydatetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  __Pyx_memviewslice __pyx_v_stamps = { 0, 0, { 0 }, { 0 }, { 0 } };
+  PyDateTime_TZInfo *__pyx_v_tz = 0;
+  struct __pyx_obj_6pandas_5_libs_6tslibs_7offsets_BaseOffset *__pyx_v_freq = 0;
+  int __pyx_v_fold;
+  PyObject *__pyx_v_box = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ints_to_pydatetime (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stamps,&__pyx_n_s_tz,&__pyx_n_s_freq,&__pyx_n_s_fold,&__pyx_n_s_box,0};
+    PyObject* values[5] = {0,0,0,0,0};
+/* … */
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6pandas_5_libs_6tslibs_10vectorized_ints_to_pydatetime(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_stamps, PyDateTime_TZInfo *__pyx_v_tz, struct __pyx_obj_6pandas_5_libs_6tslibs_7offsets_BaseOffset *__pyx_v_freq, int __pyx_v_fold, PyObject *__pyx_v_box) {
+  struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *__pyx_v_info = 0;
+  __pyx_t_5numpy_int64_t __pyx_v_utc_val;
+  __pyx_t_5numpy_int64_t __pyx_v_local_val;
+  Py_ssize_t __pyx_v_i;
+  Py_ssize_t __pyx_v_n;
+  Py_ssize_t __pyx_v_pos;
+  npy_datetimestruct __pyx_v_dts;
+  PyDateTime_TZInfo *__pyx_v_new_tz = 0;
+  PyArrayObject *__pyx_v_result = 0;
+  int __pyx_v_use_date;
+  CYTHON_UNUSED int __pyx_v_use_time;
+  int __pyx_v_use_ts;
+  int __pyx_v_use_pydt;
+  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
+  __Pyx_Buffer __pyx_pybuffer_result;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ints_to_pydatetime", 0);
+  __pyx_pybuffer_result.pybuffer.buf = NULL;
+  __pyx_pybuffer_result.refcount = 0;
+  __pyx_pybuffernd_result.data = NULL;
+  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
+/* … */
+  /* 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_13);
+  __Pyx_XDECREF(__pyx_t_14);
+  __Pyx_XDECREF(__pyx_t_15);
+  __Pyx_XDECREF(__pyx_t_16);
+  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
+    __Pyx_PyThreadState_declare
+    __Pyx_PyThreadState_assign
+    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
+    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
+  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
+  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.ints_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  goto __pyx_L2;
+  __pyx_L0:;
+  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
+  __pyx_L2:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_info);
+  __Pyx_XDECREF((PyObject *)__pyx_v_new_tz);
+  __Pyx_XDECREF((PyObject *)__pyx_v_result);
+  __PYX_XDEC_MEMVIEW(&__pyx_v_stamps, 1);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__24 = PyTuple_Pack(18, __pyx_n_s_stamps, __pyx_n_s_tz, __pyx_n_s_freq, __pyx_n_s_fold, __pyx_n_s_box, __pyx_n_s_info, __pyx_n_s_utc_val, __pyx_n_s_local_val, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_pos, __pyx_n_s_dts, __pyx_n_s_new_tz, __pyx_n_s_result, __pyx_n_s_use_date, __pyx_n_s_use_time, __pyx_n_s_use_ts, __pyx_n_s_use_pydt); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 115, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__24);
+  __Pyx_GIVEREF(__pyx_tuple__24);
+/* … */
+  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5_libs_6tslibs_10vectorized_1ints_to_pydatetime, NULL, __pyx_n_s_pandas__libs_tslibs_vectorized); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 115, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ints_to_pydatetime, __pyx_t_6) < 0) __PYX_ERR(1, 115, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas__libs_tslibs_vectorized_p, __pyx_n_s_ints_to_pydatetime, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(1, 115, __pyx_L1_error)
+
 116:     const int64_t[:] stamps,
+
+117:     tzinfo tz=None,
+
    values[1] = (PyObject *)((PyDateTime_TZInfo *)Py_None);
+
+118:     BaseOffset freq=None,
+
    values[2] = (PyObject *)((struct __pyx_obj_6pandas_5_libs_6tslibs_7offsets_BaseOffset *)Py_None);
+    values[4] = ((PyObject*)__pyx_n_u_datetime);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stamps)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tz);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_freq);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fold);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box);
+          if (value) { values[4] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ints_to_pydatetime") < 0)) __PYX_ERR(1, 115, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_stamps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t__const__(values[0], 0); if (unlikely(!__pyx_v_stamps.memview)) __PYX_ERR(1, 116, __pyx_L3_error)
+    __pyx_v_tz = ((PyDateTime_TZInfo *)values[1]);
+    __pyx_v_freq = ((struct __pyx_obj_6pandas_5_libs_6tslibs_7offsets_BaseOffset *)values[2]);
+    if (values[3]) {
+      __pyx_v_fold = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_fold == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 119, __pyx_L3_error)
+    } else {
+
+119:     bint fold=False,
+
      __pyx_v_fold = ((int)0);
+    }
+    __pyx_v_box = ((PyObject*)values[4]);
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("ints_to_pydatetime", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 115, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.ints_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tz), __pyx_ptype_7cpython_8datetime_tzinfo, 1, "tz", 0))) __PYX_ERR(1, 117, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_freq), __pyx_ptype_6pandas_5_libs_6tslibs_7offsets_BaseOffset, 1, "freq", 0))) __PYX_ERR(1, 118, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), (&PyUnicode_Type), 1, "box", 1))) __PYX_ERR(1, 120, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6pandas_5_libs_6tslibs_10vectorized_ints_to_pydatetime(__pyx_self, __pyx_v_stamps, __pyx_v_tz, __pyx_v_freq, __pyx_v_fold, __pyx_v_box);
+
 120:     str box="datetime"
+
 121: ) -> np.ndarray:
+
 122:     """
+
 123:     Convert an i8 repr to an ndarray of datetimes, date, time or Timestamp.
+
 124: 
+
 125:     Parameters
+
 126:     ----------
+
 127:     stamps : array of i8
+
 128:     tz : str, optional
+
 129:          convert to this timezone
+
 130:     freq : BaseOffset, optional
+
 131:          freq to convert
+
 132:     fold : bint, default is 0
+
 133:         Due to daylight saving time, one wall clock time can occur twice
+
 134:         when shifting from summer to winter time; fold describes whether the
+
 135:         datetime-like corresponds  to the first (0) or the second time (1)
+
 136:         the wall clock hits the ambiguous time
+
 137: 
+
 138:         .. versionadded:: 1.1.0
+
 139:     box : {'datetime', 'timestamp', 'date', 'time'}, default 'datetime'
+
 140:         * If datetime, convert to datetime.datetime
+
 141:         * If date, convert to datetime.date
+
 142:         * If time, convert to datetime.time
+
 143:         * If Timestamp, convert to pandas.Timestamp
+
 144: 
+
 145:     Returns
+
 146:     -------
+
 147:     ndarray[object] of type specified by box
+
 148:     """
+
 149:     cdef:
+
+150:         Localizer info = Localizer(tz)
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pandas_5_libs_6tslibs_10vectorized_Localizer), ((PyObject *)__pyx_v_tz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 150, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_info = ((struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 151:         int64_t utc_val, local_val
+
+152:         Py_ssize_t i, n = stamps.shape[0]
+
  __pyx_v_n = (__pyx_v_stamps.shape[0]);
+
+153:         Py_ssize_t pos = -1  # unused, avoid not-initialized warning
+
  __pyx_v_pos = -1L;
+
 154: 
+
 155:         npy_datetimestruct dts
+
 156:         tzinfo new_tz
+
+157:         ndarray[object] result = np.empty(n, dtype=object)
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 157, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 157, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 157, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 157, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 157, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_builtin_object) < 0) __PYX_ERR(1, 157, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 157, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 157, __pyx_L1_error)
+  __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
+  {
+    __Pyx_BufFmt_StackElem __pyx_stack[1];
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+      __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL;
+      __PYX_ERR(1, 157, __pyx_L1_error)
+    } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
+    }
+  }
+  __pyx_t_5 = 0;
+  __pyx_v_result = ((PyArrayObject *)__pyx_t_4);
+  __pyx_t_4 = 0;
+
+158:         bint use_date = False, use_time = False, use_ts = False, use_pydt = False
+
  __pyx_v_use_date = 0;
+  __pyx_v_use_time = 0;
+  __pyx_v_use_ts = 0;
+  __pyx_v_use_pydt = 0;
+
 159: 
+
+160:     if box == "date":
+
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_box, __pyx_n_u_date, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
+  __pyx_t_7 = (__pyx_t_6 != 0);
+  if (__pyx_t_7) {
+/* … */
+    goto __pyx_L3;
+  }
+
+161:         assert (tz is None), "tz should be None when converting to date"
+
    #ifndef CYTHON_WITHOUT_ASSERTIONS
+    if (unlikely(!Py_OptimizeFlag)) {
+      __pyx_t_7 = (((PyObject *)__pyx_v_tz) == Py_None);
+      if (unlikely(!(__pyx_t_7 != 0))) {
+        PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_tz_should_be_None_when_convertin);
+        __PYX_ERR(1, 161, __pyx_L1_error)
+      }
+    }
+    #endif
+
+162:         use_date = True
+
    __pyx_v_use_date = 1;
+
+163:     elif box == "timestamp":
+
  __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_box, __pyx_n_u_timestamp, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(1, 163, __pyx_L1_error)
+  __pyx_t_6 = (__pyx_t_7 != 0);
+  if (__pyx_t_6) {
+/* … */
+    goto __pyx_L3;
+  }
+
+164:         use_ts = True
+
    __pyx_v_use_ts = 1;
+
+165:     elif box == "time":
+
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_box, __pyx_n_u_time, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 165, __pyx_L1_error)
+  __pyx_t_7 = (__pyx_t_6 != 0);
+  if (__pyx_t_7) {
+/* … */
+    goto __pyx_L3;
+  }
+
+166:         use_time = True
+
    __pyx_v_use_time = 1;
+
+167:     elif box == "datetime":
+
  __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_box, __pyx_n_u_datetime, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(1, 167, __pyx_L1_error)
+  __pyx_t_6 = (__pyx_t_7 != 0);
+  if (likely(__pyx_t_6)) {
+/* … */
+    goto __pyx_L3;
+  }
+
+168:         use_pydt = True
+
    __pyx_v_use_pydt = 1;
+
 169:     else:
+
+170:         raise ValueError(
+
  /*else*/ {
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 170, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __PYX_ERR(1, 170, __pyx_L1_error)
+  }
+  __pyx_L3:;
+/* … */
+  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_box_must_be_one_of_datetime_date); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 170, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
+
 171:             "box must be one of 'datetime', 'date', 'time' or 'timestamp'"
+
 172:         )
+
 173: 
+
+174:     for i in range(n):
+
  __pyx_t_8 = __pyx_v_n;
+  __pyx_t_9 = __pyx_t_8;
+  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+    __pyx_v_i = __pyx_t_10;
+
+175:         utc_val = stamps[i]
+
    __pyx_t_11 = __pyx_v_i;
+    __pyx_v_utc_val = (*((__pyx_t_5numpy_int64_t const  *) ( /* dim=0 */ (__pyx_v_stamps.data + __pyx_t_11 * __pyx_v_stamps.strides[0]) )));
+
+176:         new_tz = tz
+
    __Pyx_INCREF(((PyObject *)__pyx_v_tz));
+    __Pyx_XDECREF_SET(__pyx_v_new_tz, __pyx_v_tz);
+
 177: 
+
+178:         if utc_val == NPY_NAT:
+
    __pyx_t_6 = ((__pyx_v_utc_val == __pyx_v_6pandas_5_libs_6tslibs_7nattype_NPY_NAT) != 0);
+    if (__pyx_t_6) {
+/* … */
+    }
+
+179:             result[i] = <object>NaT
+
      __pyx_t_4 = ((PyObject *)__pyx_v_6pandas_5_libs_6tslibs_7nattype_c_NaT);
+      __Pyx_INCREF(__pyx_t_4);
+      __pyx_t_11 = __pyx_v_i;
+      __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_result.diminfo[0].strides);
+      __Pyx_GOTREF(*__pyx_t_12);
+      __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(*__pyx_t_12);
+      *__pyx_t_12 = __pyx_t_4;
+      __Pyx_GIVEREF(*__pyx_t_12);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+180:             continue
+
      goto __pyx_L4_continue;
+
 181: 
+
+182:         local_val = info.utc_val_to_local_val(utc_val, &pos)
+
    __pyx_v_local_val = __pyx_f_6pandas_5_libs_6tslibs_10vectorized_9Localizer_utc_val_to_local_val(__pyx_v_info, __pyx_v_utc_val, (&__pyx_v_pos));
+
+183:         if info.use_pytz:
+
    __pyx_t_6 = (__pyx_v_info->use_pytz != 0);
+    if (__pyx_t_6) {
+/* … */
+    }
+
 184:             # find right representation of dst etc in pytz timezone
+
+185:             new_tz = tz._tzinfos[tz._transition_info[pos]]
+
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_tz), __pyx_n_s_tzinfos); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 185, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_tz), __pyx_n_s_transition_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 185, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_pos, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 185, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 185, __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;
+      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_8datetime_tzinfo))))) __PYX_ERR(1, 185, __pyx_L1_error)
+      __Pyx_DECREF_SET(__pyx_v_new_tz, ((PyDateTime_TZInfo *)__pyx_t_1));
+      __pyx_t_1 = 0;
+
 186: 
+
+187:         dt64_to_dtstruct(local_val, &dts)
+
    __pyx_f_6pandas_5_libs_6tslibs_11np_datetime_dt64_to_dtstruct(__pyx_v_local_val, (&__pyx_v_dts));
+
 188: 
+
+189:         if use_ts:
+
    __pyx_t_6 = (__pyx_v_use_ts != 0);
+    if (__pyx_t_6) {
+/* … */
+      goto __pyx_L8;
+    }
+
+190:             result[i] = create_timestamp_from_ts(utc_val, dts, new_tz, freq, fold)
+
      __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_5_libs_6tslibs_10timestamps_create_timestamp_from_ts(__pyx_v_utc_val, __pyx_v_dts, __pyx_v_new_tz, __pyx_v_freq, __pyx_v_fold)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 190, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_11 = __pyx_v_i;
+      __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_result.diminfo[0].strides);
+      __Pyx_GOTREF(*__pyx_t_12);
+      __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_12);
+      *__pyx_t_12 = __pyx_t_1;
+      __Pyx_GIVEREF(*__pyx_t_12);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+191:         elif use_pydt:
+
    __pyx_t_6 = (__pyx_v_use_pydt != 0);
+    if (__pyx_t_6) {
+/* … */
+      goto __pyx_L8;
+    }
+
+192:             result[i] = datetime(
+
      __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 192, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_16);
+      __Pyx_GIVEREF(__pyx_t_1);
+      PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_1);
+      __Pyx_GIVEREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_3);
+      __Pyx_GIVEREF(__pyx_t_4);
+      PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_4);
+      __Pyx_GIVEREF(__pyx_t_2);
+      PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_2);
+      __Pyx_GIVEREF(__pyx_t_13);
+      PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_13);
+      __Pyx_GIVEREF(__pyx_t_14);
+      PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_14);
+      __Pyx_GIVEREF(__pyx_t_15);
+      PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_15);
+      __Pyx_INCREF(((PyObject *)__pyx_v_new_tz));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tz));
+      PyTuple_SET_ITEM(__pyx_t_16, 7, ((PyObject *)__pyx_v_new_tz));
+      __pyx_t_1 = 0;
+      __pyx_t_3 = 0;
+      __pyx_t_4 = 0;
+      __pyx_t_2 = 0;
+      __pyx_t_13 = 0;
+      __pyx_t_14 = 0;
+      __pyx_t_15 = 0;
+/* … */
+      __pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime), __pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 192, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_14);
+      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+      __pyx_t_11 = __pyx_v_i;
+      __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_result.diminfo[0].strides);
+      __Pyx_GOTREF(*__pyx_t_12);
+      __Pyx_INCREF(__pyx_t_14); __Pyx_DECREF(*__pyx_t_12);
+      *__pyx_t_12 = __pyx_t_14;
+      __Pyx_GIVEREF(*__pyx_t_12);
+      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+
+193:                 dts.year, dts.month, dts.day, dts.hour, dts.min, dts.sec, dts.us,
+
      __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 193, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 193, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 193, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 193, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_13 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 193, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_13);
+      __pyx_t_14 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 193, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_14);
+      __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 193, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_15);
+
+194:                 new_tz, fold=fold,
+
      __pyx_t_15 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 194, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_15);
+      __pyx_t_14 = __Pyx_PyBool_FromLong(__pyx_v_fold); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 194, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_14);
+      if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_fold, __pyx_t_14) < 0) __PYX_ERR(1, 194, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+
 195:             )
+
+196:         elif use_date:
+
    __pyx_t_6 = (__pyx_v_use_date != 0);
+    if (__pyx_t_6) {
+/* … */
+      goto __pyx_L8;
+    }
+
+197:             result[i] = date(dts.year, dts.month, dts.day)
+
      __pyx_t_14 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 197, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_14);
+      __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 197, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_15);
+      __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 197, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_16);
+      __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 197, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_13);
+      __Pyx_GIVEREF(__pyx_t_14);
+      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14);
+      __Pyx_GIVEREF(__pyx_t_15);
+      PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_15);
+      __Pyx_GIVEREF(__pyx_t_16);
+      PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_16);
+      __pyx_t_14 = 0;
+      __pyx_t_15 = 0;
+      __pyx_t_16 = 0;
+      __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cpython_8datetime_date), __pyx_t_13, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 197, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_16);
+      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __pyx_t_11 = __pyx_v_i;
+      __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_result.diminfo[0].strides);
+      __Pyx_GOTREF(*__pyx_t_12);
+      __Pyx_INCREF(__pyx_t_16); __Pyx_DECREF(*__pyx_t_12);
+      *__pyx_t_12 = __pyx_t_16;
+      __Pyx_GIVEREF(*__pyx_t_12);
+      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+
 198:         else:
+
+199:             result[i] = time(dts.hour, dts.min, dts.sec, dts.us, new_tz, fold=fold)
+
    /*else*/ {
+      __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 199, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_16);
+      __pyx_t_13 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 199, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_13);
+      __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 199, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_15);
+      __pyx_t_14 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 199, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_14);
+      __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 199, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_GIVEREF(__pyx_t_16);
+      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_16);
+      __Pyx_GIVEREF(__pyx_t_13);
+      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_13);
+      __Pyx_GIVEREF(__pyx_t_15);
+      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_15);
+      __Pyx_GIVEREF(__pyx_t_14);
+      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_14);
+      __Pyx_INCREF(((PyObject *)__pyx_v_new_tz));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tz));
+      PyTuple_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_v_new_tz));
+      __pyx_t_16 = 0;
+      __pyx_t_13 = 0;
+      __pyx_t_15 = 0;
+      __pyx_t_14 = 0;
+      __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 199, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_14);
+      __pyx_t_15 = __Pyx_PyBool_FromLong(__pyx_v_fold); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 199, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_15);
+      if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_fold, __pyx_t_15) < 0) __PYX_ERR(1, 199, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+      __pyx_t_15 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cpython_8datetime_time), __pyx_t_2, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 199, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_15);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+      __pyx_t_11 = __pyx_v_i;
+      __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_result.diminfo[0].strides);
+      __Pyx_GOTREF(*__pyx_t_12);
+      __Pyx_INCREF(__pyx_t_15); __Pyx_DECREF(*__pyx_t_12);
+      *__pyx_t_12 = __pyx_t_15;
+      __Pyx_GIVEREF(*__pyx_t_12);
+      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+    }
+    __pyx_L8:;
+    __pyx_L4_continue:;
+  }
+
 200: 
+
+201:     return result
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_result));
+  __pyx_r = ((PyObject *)__pyx_v_result);
+  goto __pyx_L0;
+
 202: 
+
 203: 
+
 204: # -------------------------------------------------------------------------
+
 205: 
+
 206: 
+
+207: cdef inline c_Resolution _reso_stamp(npy_datetimestruct *dts):
+
static CYTHON_INLINE enum __pyx_t_6pandas_5_libs_6tslibs_6dtypes_c_Resolution __pyx_f_6pandas_5_libs_6tslibs_10vectorized__reso_stamp(npy_datetimestruct *__pyx_v_dts) {
+  enum __pyx_t_6pandas_5_libs_6tslibs_6dtypes_c_Resolution __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_reso_stamp", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+208:     if dts.us != 0:
+
  __pyx_t_1 = ((__pyx_v_dts->us != 0) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+209:         if dts.us % 1000 == 0:
+
    __pyx_t_1 = ((__Pyx_mod_long(__pyx_v_dts->us, 0x3E8) == 0) != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
+210:             return c_Resolution.RESO_MS
+
      __pyx_r = __pyx_e_6pandas_5_libs_6tslibs_6dtypes_RESO_MS;
+      goto __pyx_L0;
+
+211:         return c_Resolution.RESO_US
+
    __pyx_r = __pyx_e_6pandas_5_libs_6tslibs_6dtypes_RESO_US;
+    goto __pyx_L0;
+
+212:     elif dts.sec != 0:
+
  __pyx_t_1 = ((__pyx_v_dts->sec != 0) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+213:         return c_Resolution.RESO_SEC
+
    __pyx_r = __pyx_e_6pandas_5_libs_6tslibs_6dtypes_RESO_SEC;
+    goto __pyx_L0;
+
+214:     elif dts.min != 0:
+
  __pyx_t_1 = ((__pyx_v_dts->min != 0) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+215:         return c_Resolution.RESO_MIN
+
    __pyx_r = __pyx_e_6pandas_5_libs_6tslibs_6dtypes_RESO_MIN;
+    goto __pyx_L0;
+
+216:     elif dts.hour != 0:
+
  __pyx_t_1 = ((__pyx_v_dts->hour != 0) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+217:         return c_Resolution.RESO_HR
+
    __pyx_r = __pyx_e_6pandas_5_libs_6tslibs_6dtypes_RESO_HR;
+    goto __pyx_L0;
+
+218:     return c_Resolution.RESO_DAY
+
  __pyx_r = __pyx_e_6pandas_5_libs_6tslibs_6dtypes_RESO_DAY;
+  goto __pyx_L0;
+
 219: 
+
 220: 
+
 221: @cython.wraparound(False)
+
 222: @cython.boundscheck(False)
+
+223: def get_resolution(const int64_t[:] stamps, tzinfo tz=None) -> Resolution:
+
/* Python wrapper */
+static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_3get_resolution(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_6pandas_5_libs_6tslibs_10vectorized_3get_resolution = {"get_resolution", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_3get_resolution, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_3get_resolution(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  __Pyx_memviewslice __pyx_v_stamps = { 0, 0, { 0 }, { 0 }, { 0 } };
+  PyDateTime_TZInfo *__pyx_v_tz = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_resolution (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stamps,&__pyx_n_s_tz,0};
+    PyObject* values[2] = {0,0};
+    values[1] = (PyObject *)((PyDateTime_TZInfo *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stamps)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tz);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_resolution") < 0)) __PYX_ERR(1, 223, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_stamps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t__const__(values[0], 0); if (unlikely(!__pyx_v_stamps.memview)) __PYX_ERR(1, 223, __pyx_L3_error)
+    __pyx_v_tz = ((PyDateTime_TZInfo *)values[1]);
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("get_resolution", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 223, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.get_resolution", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tz), __pyx_ptype_7cpython_8datetime_tzinfo, 1, "tz", 0))) __PYX_ERR(1, 223, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6pandas_5_libs_6tslibs_10vectorized_2get_resolution(__pyx_self, __pyx_v_stamps, __pyx_v_tz);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6pandas_5_libs_6tslibs_10vectorized_2get_resolution(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_stamps, PyDateTime_TZInfo *__pyx_v_tz) {
+  struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *__pyx_v_info = 0;
+  __pyx_t_5numpy_int64_t __pyx_v_utc_val;
+  __pyx_t_5numpy_int64_t __pyx_v_local_val;
+  Py_ssize_t __pyx_v_i;
+  Py_ssize_t __pyx_v_n;
+  Py_ssize_t __pyx_v_pos;
+  npy_datetimestruct __pyx_v_dts;
+  enum __pyx_t_6pandas_5_libs_6tslibs_6dtypes_c_Resolution __pyx_v_reso;
+  enum __pyx_t_6pandas_5_libs_6tslibs_6dtypes_c_Resolution __pyx_v_curr_reso;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_resolution", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.get_resolution", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_info);
+  __PYX_XDEC_MEMVIEW(&__pyx_v_stamps, 1);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__26 = PyTuple_Pack(11, __pyx_n_s_stamps, __pyx_n_s_tz, __pyx_n_s_info, __pyx_n_s_utc_val, __pyx_n_s_local_val, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_pos, __pyx_n_s_dts, __pyx_n_s_reso, __pyx_n_s_curr_reso); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 223, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__26);
+  __Pyx_GIVEREF(__pyx_tuple__26);
+/* … */
+  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5_libs_6tslibs_10vectorized_3get_resolution, NULL, __pyx_n_s_pandas__libs_tslibs_vectorized); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 223, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_resolution, __pyx_t_6) < 0) __PYX_ERR(1, 223, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas__libs_tslibs_vectorized_p, __pyx_n_s_get_resolution, 223, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(1, 223, __pyx_L1_error)
+
 224:     cdef:
+
+225:         Localizer info = Localizer(tz)
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pandas_5_libs_6tslibs_10vectorized_Localizer), ((PyObject *)__pyx_v_tz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 225, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_info = ((struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 226:         int64_t utc_val, local_val
+
+227:         Py_ssize_t i, n = stamps.shape[0]
+
  __pyx_v_n = (__pyx_v_stamps.shape[0]);
+
+228:         Py_ssize_t pos = -1  # unused, avoid not-initialized warning
+
  __pyx_v_pos = -1L;
+
 229: 
+
 230:         npy_datetimestruct dts
+
+231:         c_Resolution reso = c_Resolution.RESO_DAY, curr_reso
+
  __pyx_v_reso = __pyx_e_6pandas_5_libs_6tslibs_6dtypes_RESO_DAY;
+
 232: 
+
+233:     for i in range(n):
+
  __pyx_t_2 = __pyx_v_n;
+  __pyx_t_3 = __pyx_t_2;
+  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+    __pyx_v_i = __pyx_t_4;
+
+234:         utc_val = stamps[i]
+
    __pyx_t_5 = __pyx_v_i;
+    __pyx_v_utc_val = (*((__pyx_t_5numpy_int64_t const  *) ( /* dim=0 */ (__pyx_v_stamps.data + __pyx_t_5 * __pyx_v_stamps.strides[0]) )));
+
+235:         if utc_val == NPY_NAT:
+
    __pyx_t_6 = ((__pyx_v_utc_val == __pyx_v_6pandas_5_libs_6tslibs_7nattype_NPY_NAT) != 0);
+    if (__pyx_t_6) {
+/* … */
+    }
+
+236:             continue
+
      goto __pyx_L3_continue;
+
 237: 
+
+238:         local_val = info.utc_val_to_local_val(utc_val, &pos)
+
    __pyx_v_local_val = __pyx_f_6pandas_5_libs_6tslibs_10vectorized_9Localizer_utc_val_to_local_val(__pyx_v_info, __pyx_v_utc_val, (&__pyx_v_pos));
+
 239: 
+
+240:         dt64_to_dtstruct(local_val, &dts)
+
    __pyx_f_6pandas_5_libs_6tslibs_11np_datetime_dt64_to_dtstruct(__pyx_v_local_val, (&__pyx_v_dts));
+
+241:         curr_reso = _reso_stamp(&dts)
+
    __pyx_v_curr_reso = __pyx_f_6pandas_5_libs_6tslibs_10vectorized__reso_stamp((&__pyx_v_dts));
+
+242:         if curr_reso < reso:
+
    __pyx_t_6 = ((__pyx_v_curr_reso < __pyx_v_reso) != 0);
+    if (__pyx_t_6) {
+/* … */
+    }
+    __pyx_L3_continue:;
+  }
+
+243:             reso = curr_reso
+
      __pyx_v_reso = __pyx_v_curr_reso;
+
 244: 
+
+245:     return Resolution(reso)
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Resolution); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 245, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_8 = __Pyx_PyInt_From_enum____pyx_t_6pandas_5_libs_6tslibs_6dtypes_c_Resolution(__pyx_v_reso); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 245, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_9 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
+    if (likely(__pyx_t_9)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_9);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_7, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 245, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 246: 
+
 247: 
+
 248: # -------------------------------------------------------------------------
+
 249: 
+
 250: 
+
 251: @cython.cdivision(False)
+
 252: @cython.wraparound(False)
+
 253: @cython.boundscheck(False)
+
+254: cpdef ndarray[int64_t] normalize_i8_timestamps(const int64_t[:] stamps, tzinfo tz):
+
static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_5normalize_i8_timestamps(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyArrayObject *__pyx_f_6pandas_5_libs_6tslibs_10vectorized_normalize_i8_timestamps(__Pyx_memviewslice __pyx_v_stamps, PyDateTime_TZInfo *__pyx_v_tz, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *__pyx_v_info = 0;
+  __pyx_t_5numpy_int64_t __pyx_v_utc_val;
+  __pyx_t_5numpy_int64_t __pyx_v_local_val;
+  Py_ssize_t __pyx_v_i;
+  Py_ssize_t __pyx_v_n;
+  Py_ssize_t __pyx_v_pos;
+  __Pyx_memviewslice __pyx_v_result = { 0, 0, { 0 }, { 0 }, { 0 } };
+  PyArrayObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("normalize_i8_timestamps", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
+  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.normalize_i8_timestamps", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_info);
+  __PYX_XDEC_MEMVIEW(&__pyx_v_result, 1);
+  __Pyx_XGIVEREF((PyObject *)__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_5normalize_i8_timestamps(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6pandas_5_libs_6tslibs_10vectorized_4normalize_i8_timestamps[] = "\n    Normalize each of the (nanosecond) timezone aware timestamps in the given\n    array by rounding down to the beginning of the day (i.e. midnight).\n    This is midnight for timezone, `tz`.\n\n    Parameters\n    ----------\n    stamps : int64 ndarray\n    tz : tzinfo or None\n\n    Returns\n    -------\n    result : int64 ndarray of converted of normalized nanosecond timestamps\n    ";
+static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_5normalize_i8_timestamps(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  __Pyx_memviewslice __pyx_v_stamps = { 0, 0, { 0 }, { 0 }, { 0 } };
+  PyDateTime_TZInfo *__pyx_v_tz = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("normalize_i8_timestamps (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stamps,&__pyx_n_s_tz,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stamps)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tz)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("normalize_i8_timestamps", 1, 2, 2, 1); __PYX_ERR(1, 254, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "normalize_i8_timestamps") < 0)) __PYX_ERR(1, 254, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_stamps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t__const__(values[0], 0); if (unlikely(!__pyx_v_stamps.memview)) __PYX_ERR(1, 254, __pyx_L3_error)
+    __pyx_v_tz = ((PyDateTime_TZInfo *)values[1]);
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("normalize_i8_timestamps", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 254, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.normalize_i8_timestamps", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tz), __pyx_ptype_7cpython_8datetime_tzinfo, 1, "tz", 0))) __PYX_ERR(1, 254, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6pandas_5_libs_6tslibs_10vectorized_4normalize_i8_timestamps(__pyx_self, __pyx_v_stamps, __pyx_v_tz);
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6pandas_5_libs_6tslibs_10vectorized_4normalize_i8_timestamps(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_stamps, PyDateTime_TZInfo *__pyx_v_tz) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("normalize_i8_timestamps", 0);
+  __Pyx_XDECREF(__pyx_r);
+  if (unlikely(!__pyx_v_stamps.memview)) { __Pyx_RaiseUnboundLocalError("stamps"); __PYX_ERR(1, 254, __pyx_L1_error) }
+  __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_5_libs_6tslibs_10vectorized_normalize_i8_timestamps(__pyx_v_stamps, __pyx_v_tz, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 254, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.normalize_i8_timestamps", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __PYX_XDEC_MEMVIEW(&__pyx_v_stamps, 1);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 255:     """
+
 256:     Normalize each of the (nanosecond) timezone aware timestamps in the given
+
 257:     array by rounding down to the beginning of the day (i.e. midnight).
+
 258:     This is midnight for timezone, `tz`.
+
 259: 
+
 260:     Parameters
+
 261:     ----------
+
 262:     stamps : int64 ndarray
+
 263:     tz : tzinfo or None
+
 264: 
+
 265:     Returns
+
 266:     -------
+
 267:     result : int64 ndarray of converted of normalized nanosecond timestamps
+
 268:     """
+
 269:     cdef:
+
+270:         Localizer info = Localizer(tz)
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pandas_5_libs_6tslibs_10vectorized_Localizer), ((PyObject *)__pyx_v_tz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 270, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_info = ((struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 271:         int64_t utc_val, local_val
+
+272:         Py_ssize_t i, n = stamps.shape[0]
+
  __pyx_v_n = (__pyx_v_stamps.shape[0]);
+
+273:         Py_ssize_t pos = -1  # unused, avoid not-initialized warning
+
  __pyx_v_pos = -1L;
+
 274: 
+
+275:         int64_t[::1] result = np.empty(n, dtype=np.int64)
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 275, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 275, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 275, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 275, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 275, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(1, 275, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 275, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(1, 275, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_v_result = __pyx_t_6;
+  __pyx_t_6.memview = NULL;
+  __pyx_t_6.data = NULL;
+
 276: 
+
+277:     for i in range(n):
+
  __pyx_t_7 = __pyx_v_n;
+  __pyx_t_8 = __pyx_t_7;
+  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
+    __pyx_v_i = __pyx_t_9;
+
+278:         utc_val = stamps[i]
+
    __pyx_t_10 = __pyx_v_i;
+    __pyx_v_utc_val = (*((__pyx_t_5numpy_int64_t const  *) ( /* dim=0 */ (__pyx_v_stamps.data + __pyx_t_10 * __pyx_v_stamps.strides[0]) )));
+
+279:         if utc_val == NPY_NAT:
+
    __pyx_t_11 = ((__pyx_v_utc_val == __pyx_v_6pandas_5_libs_6tslibs_7nattype_NPY_NAT) != 0);
+    if (__pyx_t_11) {
+/* … */
+    }
+
+280:             result[i] = NPY_NAT
+
      __pyx_t_10 = __pyx_v_i;
+      *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int64_t *) __pyx_v_result.data) + __pyx_t_10)) )) = __pyx_v_6pandas_5_libs_6tslibs_7nattype_NPY_NAT;
+
+281:             continue
+
      goto __pyx_L3_continue;
+
 282: 
+
+283:         local_val = info.utc_val_to_local_val(utc_val, &pos)
+
    __pyx_v_local_val = __pyx_f_6pandas_5_libs_6tslibs_10vectorized_9Localizer_utc_val_to_local_val(__pyx_v_info, __pyx_v_utc_val, (&__pyx_v_pos));
+
 284: 
+
+285:         result[i] = local_val - (local_val % DAY_NANOS)
+
    if (unlikely(__pyx_v_6pandas_5_libs_6tslibs_9ccalendar_DAY_NANOS == 0)) {
+      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+      __PYX_ERR(1, 285, __pyx_L1_error)
+    }
+    __pyx_t_10 = __pyx_v_i;
+    *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int64_t *) __pyx_v_result.data) + __pyx_t_10)) )) = (__pyx_v_local_val - __Pyx_mod___pyx_t_5numpy_int64_t(__pyx_v_local_val, __pyx_v_6pandas_5_libs_6tslibs_9ccalendar_DAY_NANOS));
+    __pyx_L3_continue:;
+  }
+
 286: 
+
+287:     return result.base  # `.base` to access underlying ndarray
+
  __Pyx_XDECREF(((PyObject *)__pyx_r));
+  __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_result, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 287, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 287, __pyx_L1_error)
+  __pyx_r = ((PyArrayObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 288: 
+
 289: 
+
 290: @cython.wraparound(False)
+
 291: @cython.boundscheck(False)
+
+292: def is_date_array_normalized(const int64_t[:] stamps, tzinfo tz=None) -> bool:
+
/* Python wrapper */
+static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_7is_date_array_normalized(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6pandas_5_libs_6tslibs_10vectorized_6is_date_array_normalized[] = "\n    Check if all of the given (nanosecond) timestamps are normalized to\n    midnight, i.e. hour == minute == second == 0.  If the optional timezone\n    `tz` is not None, then this is midnight for this timezone.\n\n    Parameters\n    ----------\n    stamps : int64 ndarray\n    tz : tzinfo or None\n\n    Returns\n    -------\n    is_normalized : bool True if all stamps are normalized\n    ";
+static PyMethodDef __pyx_mdef_6pandas_5_libs_6tslibs_10vectorized_7is_date_array_normalized = {"is_date_array_normalized", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_7is_date_array_normalized, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6tslibs_10vectorized_6is_date_array_normalized};
+static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_7is_date_array_normalized(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  __Pyx_memviewslice __pyx_v_stamps = { 0, 0, { 0 }, { 0 }, { 0 } };
+  PyDateTime_TZInfo *__pyx_v_tz = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("is_date_array_normalized (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stamps,&__pyx_n_s_tz,0};
+    PyObject* values[2] = {0,0};
+    values[1] = (PyObject *)((PyDateTime_TZInfo *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stamps)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tz);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_date_array_normalized") < 0)) __PYX_ERR(1, 292, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_stamps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t__const__(values[0], 0); if (unlikely(!__pyx_v_stamps.memview)) __PYX_ERR(1, 292, __pyx_L3_error)
+    __pyx_v_tz = ((PyDateTime_TZInfo *)values[1]);
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("is_date_array_normalized", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 292, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.is_date_array_normalized", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tz), __pyx_ptype_7cpython_8datetime_tzinfo, 1, "tz", 0))) __PYX_ERR(1, 292, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6pandas_5_libs_6tslibs_10vectorized_6is_date_array_normalized(__pyx_self, __pyx_v_stamps, __pyx_v_tz);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6pandas_5_libs_6tslibs_10vectorized_6is_date_array_normalized(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_stamps, PyDateTime_TZInfo *__pyx_v_tz) {
+  struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *__pyx_v_info = 0;
+  __pyx_t_5numpy_int64_t __pyx_v_utc_val;
+  __pyx_t_5numpy_int64_t __pyx_v_local_val;
+  Py_ssize_t __pyx_v_i;
+  Py_ssize_t __pyx_v_n;
+  Py_ssize_t __pyx_v_pos;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("is_date_array_normalized", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.is_date_array_normalized", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_info);
+  __PYX_XDEC_MEMVIEW(&__pyx_v_stamps, 1);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__28 = PyTuple_Pack(8, __pyx_n_s_stamps, __pyx_n_s_tz, __pyx_n_s_info, __pyx_n_s_utc_val, __pyx_n_s_local_val, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 292, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
+/* … */
+  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5_libs_6tslibs_10vectorized_7is_date_array_normalized, NULL, __pyx_n_s_pandas__libs_tslibs_vectorized); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 292, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_date_array_normalized, __pyx_t_6) < 0) __PYX_ERR(1, 292, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas__libs_tslibs_vectorized_p, __pyx_n_s_is_date_array_normalized, 292, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(1, 292, __pyx_L1_error)
+
 293:     """
+
 294:     Check if all of the given (nanosecond) timestamps are normalized to
+
 295:     midnight, i.e. hour == minute == second == 0.  If the optional timezone
+
 296:     `tz` is not None, then this is midnight for this timezone.
+
 297: 
+
 298:     Parameters
+
 299:     ----------
+
 300:     stamps : int64 ndarray
+
 301:     tz : tzinfo or None
+
 302: 
+
 303:     Returns
+
 304:     -------
+
 305:     is_normalized : bool True if all stamps are normalized
+
 306:     """
+
 307:     cdef:
+
+308:         Localizer info = Localizer(tz)
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pandas_5_libs_6tslibs_10vectorized_Localizer), ((PyObject *)__pyx_v_tz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 308, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_info = ((struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 309:         int64_t utc_val, local_val
+
+310:         Py_ssize_t i, n = stamps.shape[0]
+
  __pyx_v_n = (__pyx_v_stamps.shape[0]);
+
+311:         Py_ssize_t pos = -1  # unused, avoid not-initialized warning
+
  __pyx_v_pos = -1L;
+
 312: 
+
+313:     for i in range(n):
+
  __pyx_t_2 = __pyx_v_n;
+  __pyx_t_3 = __pyx_t_2;
+  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+    __pyx_v_i = __pyx_t_4;
+
+314:         utc_val = stamps[i]
+
    __pyx_t_5 = __pyx_v_i;
+    __pyx_v_utc_val = (*((__pyx_t_5numpy_int64_t const  *) ( /* dim=0 */ (__pyx_v_stamps.data + __pyx_t_5 * __pyx_v_stamps.strides[0]) )));
+
 315: 
+
+316:         local_val = info.utc_val_to_local_val(utc_val, &pos)
+
    __pyx_v_local_val = __pyx_f_6pandas_5_libs_6tslibs_10vectorized_9Localizer_utc_val_to_local_val(__pyx_v_info, __pyx_v_utc_val, (&__pyx_v_pos));
+
 317: 
+
+318:         if local_val % DAY_NANOS != 0:
+
    if (unlikely(__pyx_v_6pandas_5_libs_6tslibs_9ccalendar_DAY_NANOS == 0)) {
+      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+      __PYX_ERR(1, 318, __pyx_L1_error)
+    }
+    __pyx_t_6 = ((__Pyx_mod___pyx_t_5numpy_int64_t(__pyx_v_local_val, __pyx_v_6pandas_5_libs_6tslibs_9ccalendar_DAY_NANOS) != 0) != 0);
+    if (__pyx_t_6) {
+/* … */
+    }
+  }
+
+319:             return False
+
      __Pyx_XDECREF(__pyx_r);
+      __Pyx_INCREF(Py_False);
+      __pyx_r = Py_False;
+      goto __pyx_L0;
+
 320: 
+
+321:     return True
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(Py_True);
+  __pyx_r = Py_True;
+  goto __pyx_L0;
+
 322: 
+
 323: 
+
 324: # -------------------------------------------------------------------------
+
 325: 
+
 326: 
+
 327: @cython.wraparound(False)
+
 328: @cython.boundscheck(False)
+
+329: def dt64arr_to_periodarr(ndarray stamps, int freq, tzinfo tz):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_9dt64arr_to_periodarr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_6pandas_5_libs_6tslibs_10vectorized_9dt64arr_to_periodarr = {"dt64arr_to_periodarr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_9dt64arr_to_periodarr, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_9dt64arr_to_periodarr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyArrayObject *__pyx_v_stamps = 0;
+  int __pyx_v_freq;
+  PyDateTime_TZInfo *__pyx_v_tz = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("dt64arr_to_periodarr (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stamps,&__pyx_n_s_freq,&__pyx_n_s_tz,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stamps)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("dt64arr_to_periodarr", 1, 3, 3, 1); __PYX_ERR(1, 329, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tz)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("dt64arr_to_periodarr", 1, 3, 3, 2); __PYX_ERR(1, 329, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dt64arr_to_periodarr") < 0)) __PYX_ERR(1, 329, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_stamps = ((PyArrayObject *)values[0]);
+    __pyx_v_freq = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_freq == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 329, __pyx_L3_error)
+    __pyx_v_tz = ((PyDateTime_TZInfo *)values[2]);
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("dt64arr_to_periodarr", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 329, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.dt64arr_to_periodarr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stamps), __pyx_ptype_5numpy_ndarray, 1, "stamps", 0))) __PYX_ERR(1, 329, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tz), __pyx_ptype_7cpython_8datetime_tzinfo, 1, "tz", 0))) __PYX_ERR(1, 329, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6pandas_5_libs_6tslibs_10vectorized_8dt64arr_to_periodarr(__pyx_self, __pyx_v_stamps, __pyx_v_freq, __pyx_v_tz);
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6pandas_5_libs_6tslibs_10vectorized_8dt64arr_to_periodarr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_stamps, int __pyx_v_freq, PyDateTime_TZInfo *__pyx_v_tz) {
+  struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *__pyx_v_info = 0;
+  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
+  Py_ssize_t __pyx_v_n;
+  Py_ssize_t __pyx_v_pos;
+  __pyx_t_5numpy_int64_t __pyx_v_utc_val;
+  __pyx_t_5numpy_int64_t __pyx_v_local_val;
+  __pyx_t_5numpy_int64_t __pyx_v_res_val;
+  npy_datetimestruct __pyx_v_dts;
+  PyArrayObject *__pyx_v_result = 0;
+  PyArrayMultiIterObject *__pyx_v_mi = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("dt64arr_to_periodarr", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.dt64arr_to_periodarr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_info);
+  __Pyx_XDECREF((PyObject *)__pyx_v_result);
+  __Pyx_XDECREF((PyObject *)__pyx_v_mi);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__30 = PyTuple_Pack(13, __pyx_n_s_stamps, __pyx_n_s_freq, __pyx_n_s_tz, __pyx_n_s_info, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_pos, __pyx_n_s_utc_val, __pyx_n_s_local_val, __pyx_n_s_res_val, __pyx_n_s_dts, __pyx_n_s_result, __pyx_n_s_mi); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 329, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__30);
+  __Pyx_GIVEREF(__pyx_tuple__30);
+/* … */
+  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5_libs_6tslibs_10vectorized_9dt64arr_to_periodarr, NULL, __pyx_n_s_pandas__libs_tslibs_vectorized); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 329, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dt64arr_to_periodarr, __pyx_t_6) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas__libs_tslibs_vectorized_p, __pyx_n_s_dt64arr_to_periodarr, 329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(1, 329, __pyx_L1_error)
+
 330:     # stamps is int64_t, arbitrary ndim
+
 331:     cdef:
+
+332:         Localizer info = Localizer(tz)
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pandas_5_libs_6tslibs_10vectorized_Localizer), ((PyObject *)__pyx_v_tz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 332, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_info = ((struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+333:         Py_ssize_t i, n = stamps.size
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_stamps), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 333, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 333, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_n = __pyx_t_2;
+
+334:         Py_ssize_t pos = -1  # unused, avoid not-initialized warning
+
  __pyx_v_pos = -1L;
+
 335:         int64_t utc_val, local_val, res_val
+
 336: 
+
 337:         npy_datetimestruct dts
+
+338:         ndarray result = cnp.PyArray_EMPTY(stamps.ndim, stamps.shape, cnp.NPY_INT64, 0)
+
  __pyx_t_1 = PyArray_EMPTY(__pyx_v_stamps->nd, __pyx_v_stamps->dimensions, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 338, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 338, __pyx_L1_error)
+  __pyx_v_result = ((PyArrayObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+339:         cnp.broadcast mi = cnp.PyArray_MultiIterNew2(result, stamps)
+
  __pyx_t_1 = __pyx_f_5numpy_PyArray_MultiIterNew2(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_v_stamps)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 339, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_broadcast))))) __PYX_ERR(1, 339, __pyx_L1_error)
+  __pyx_v_mi = ((PyArrayMultiIterObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 340: 
+
+341:     for i in range(n):
+
  __pyx_t_2 = __pyx_v_n;
+  __pyx_t_3 = __pyx_t_2;
+  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+    __pyx_v_i = __pyx_t_4;
+
 342:         # Analogous to: utc_val = stamps[i]
+
+343:         utc_val = (<int64_t*>cnp.PyArray_MultiIter_DATA(mi, 1))[0]
+
    __pyx_v_utc_val = (((__pyx_t_5numpy_int64_t *)PyArray_MultiIter_DATA(__pyx_v_mi, 1))[0]);
+
 344: 
+
+345:         if utc_val == NPY_NAT:
+
    __pyx_t_5 = ((__pyx_v_utc_val == __pyx_v_6pandas_5_libs_6tslibs_7nattype_NPY_NAT) != 0);
+    if (__pyx_t_5) {
+/* … */
+      goto __pyx_L5;
+    }
+
+346:             res_val = NPY_NAT
+
      __pyx_v_res_val = __pyx_v_6pandas_5_libs_6tslibs_7nattype_NPY_NAT;
+
 347:         else:
+
+348:             local_val = info.utc_val_to_local_val(utc_val, &pos)
+
    /*else*/ {
+      __pyx_v_local_val = __pyx_f_6pandas_5_libs_6tslibs_10vectorized_9Localizer_utc_val_to_local_val(__pyx_v_info, __pyx_v_utc_val, (&__pyx_v_pos));
+
+349:             dt64_to_dtstruct(local_val, &dts)
+
      __pyx_f_6pandas_5_libs_6tslibs_11np_datetime_dt64_to_dtstruct(__pyx_v_local_val, (&__pyx_v_dts));
+
+350:             res_val = get_period_ordinal(&dts, freq)
+
      __pyx_v_res_val = __pyx_f_6pandas_5_libs_6tslibs_6period_get_period_ordinal((&__pyx_v_dts), __pyx_v_freq);
+    }
+    __pyx_L5:;
+
 351: 
+
 352:         # Analogous to: result[i] = res_val
+
+353:         (<int64_t*>cnp.PyArray_MultiIter_DATA(mi, 0))[0] = res_val
+
    (((__pyx_t_5numpy_int64_t *)PyArray_MultiIter_DATA(__pyx_v_mi, 0))[0]) = __pyx_v_res_val;
+
 354: 
+
+355:         cnp.PyArray_MultiIter_NEXT(mi)
+
    PyArray_MultiIter_NEXT(__pyx_v_mi);
+  }
+
 356: 
+
+357:     return result
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_result));
+  __pyx_r = ((PyObject *)__pyx_v_result);
+  goto __pyx_L0;
+
diff --git a/pandas/_libs/tslibs/vectorized.pyx b/pandas/_libs/tslibs/vectorized.pyx index 585d6843be57c..740d3c1c2244d 100644 --- a/pandas/_libs/tslibs/vectorized.pyx +++ b/pandas/_libs/tslibs/vectorized.pyx @@ -95,7 +95,7 @@ cdef class Localizer: self.tdata = cnp.PyArray_DATA(self.trans) @cython.boundscheck(False) - cdef inline int64_t utc_val_to_local_val(self, int64_t utc_val, Py_ssize_t* pos): + cdef inline int64_t utc_val_to_local_val(self, int64_t utc_val, Py_ssize_t* pos) except? -1: if self.use_utc: return utc_val elif self.use_tzlocal: From 071a08226e4fd4c16b57ea94b42677b8785311de Mon Sep 17 00:00:00 2001 From: Brock Date: Mon, 25 Apr 2022 20:23:25 -0700 Subject: [PATCH 6/7] remove accidentally-committed --- pandas/_libs/tslibs/vectorized.html | 2257 --------------------------- 1 file changed, 2257 deletions(-) delete mode 100644 pandas/_libs/tslibs/vectorized.html diff --git a/pandas/_libs/tslibs/vectorized.html b/pandas/_libs/tslibs/vectorized.html deleted file mode 100644 index e4d45d5244235..0000000000000 --- a/pandas/_libs/tslibs/vectorized.html +++ /dev/null @@ -1,2257 +0,0 @@ - - - - - - Cython: vectorized.pyx - - - -

Generated by Cython 0.29.24

-

- Yellow lines hint at Python interaction.
- Click on a line that starts with a "+" to see the C code that Cython generated for it. -

-

Raw output: vectorized.c

-
+001: import cython
-
  __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_6) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
 002: 
-
 003: from cpython.datetime cimport (
-
 004:     date,
-
 005:     datetime,
-
 006:     time,
-
 007:     tzinfo,
-
 008: )
-
 009: 
-
+010: import numpy as np
-
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(1, 10, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
 011: 
-
 012: cimport numpy as cnp
-
 013: from numpy cimport (
-
 014:     int64_t,
-
 015:     intp_t,
-
 016:     ndarray,
-
 017: )
-
 018: 
-
+019: cnp.import_array()
-
  __pyx_t_2 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 19, __pyx_L1_error)
-
 020: 
-
+021: from .dtypes import Resolution
-
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_n_s_Resolution);
-  __Pyx_GIVEREF(__pyx_n_s_Resolution);
-  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Resolution);
-  __pyx_t_3 = __Pyx_Import(__pyx_n_s_dtypes, __pyx_t_1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 21, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Resolution); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Resolution, __pyx_t_1) < 0) __PYX_ERR(1, 21, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
 022: 
-
 023: from .ccalendar cimport DAY_NANOS
-
 024: from .dtypes cimport c_Resolution
-
 025: from .nattype cimport (
-
 026:     NPY_NAT,
-
 027:     c_NaT as NaT,
-
 028: )
-
 029: from .np_datetime cimport (
-
 030:     dt64_to_dtstruct,
-
 031:     npy_datetimestruct,
-
 032: )
-
 033: from .offsets cimport BaseOffset
-
 034: from .period cimport get_period_ordinal
-
 035: from .timestamps cimport create_timestamp_from_ts
-
 036: from .timezones cimport (
-
 037:     get_dst_info,
-
 038:     is_tzlocal,
-
 039:     is_utc,
-
 040:     is_zoneinfo,
-
 041: )
-
 042: from .tzconversion cimport (
-
 043:     bisect_right_i8,
-
 044:     localize_tzinfo_api,
-
 045: )
-
 046: 
-
 047: 
-
+048: cdef const int64_t[::1] _deltas_placeholder = np.array([], dtype=np.int64)
-
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 48, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 48, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 48, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 48, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
-  __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 48, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 48, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 48, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(1, 48, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 48, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t__const__(__pyx_t_6, 0); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(1, 48, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __PYX_XDEC_MEMVIEW(&__pyx_v_6pandas_5_libs_6tslibs_10vectorized__deltas_placeholder, 1);
-  __pyx_v_6pandas_5_libs_6tslibs_10vectorized__deltas_placeholder = __pyx_t_7;
-  __pyx_t_7.memview = NULL;
-  __pyx_t_7.data = NULL;
-
 049: 
-
 050: 
-
 051: @cython.freelist(16)
-
 052: @cython.internal
-
 053: @cython.final
-
+054: cdef class Localizer:
-
struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_6pandas_5_libs_6tslibs_10vectorized_Localizer *__pyx_vtab;
-  PyDateTime_TZInfo *tz;
-  int use_utc;
-  int use_fixed;
-  int use_tzlocal;
-  int use_dst;
-  int use_pytz;
-  PyArrayObject *trans;
-  Py_ssize_t ntrans;
-  __Pyx_memviewslice deltas;
-  __pyx_t_5numpy_int64_t delta;
-  __pyx_t_5numpy_int64_t *tdata;
-};
-/* … */
-struct __pyx_vtabstruct_6pandas_5_libs_6tslibs_10vectorized_Localizer {
-  __pyx_t_5numpy_int64_t (*utc_val_to_local_val)(struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *, __pyx_t_5numpy_int64_t, Py_ssize_t *);
-};
-static struct __pyx_vtabstruct_6pandas_5_libs_6tslibs_10vectorized_Localizer *__pyx_vtabptr_6pandas_5_libs_6tslibs_10vectorized_Localizer;
-static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5_libs_6tslibs_10vectorized_9Localizer_utc_val_to_local_val(struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *, __pyx_t_5numpy_int64_t, Py_ssize_t *);
-
-
 055:     cdef:
-
 056:         tzinfo tz
-
 057:         bint use_utc, use_fixed, use_tzlocal, use_dst, use_pytz
-
 058:         ndarray trans
-
 059:         Py_ssize_t ntrans
-
 060:         const int64_t[::1] deltas
-
 061:         int64_t delta
-
 062:         int64_t* tdata
-
 063: 
-
 064:     @cython.initializedcheck(False)
-
 065:     @cython.boundscheck(False)
-
+066:     def __cinit__(self, tzinfo tz):
-
/* Python wrapper */
-static int __pyx_pw_6pandas_5_libs_6tslibs_10vectorized_9Localizer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_6pandas_5_libs_6tslibs_10vectorized_9Localizer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyDateTime_TZInfo *__pyx_v_tz = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tz,0};
-    PyObject* values[1] = {0};
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tz)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 66, __pyx_L3_error)
-      }
-    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-    }
-    __pyx_v_tz = ((PyDateTime_TZInfo *)values[0]);
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 66, __pyx_L3_error)
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.Localizer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tz), __pyx_ptype_7cpython_8datetime_tzinfo, 1, "tz", 0))) __PYX_ERR(1, 66, __pyx_L1_error)
-  __pyx_r = __pyx_pf_6pandas_5_libs_6tslibs_10vectorized_9Localizer___cinit__(((struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *)__pyx_v_self), __pyx_v_tz);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_6pandas_5_libs_6tslibs_10vectorized_9Localizer___cinit__(struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *__pyx_v_self, PyDateTime_TZInfo *__pyx_v_tz) {
-  PyObject *__pyx_v_trans = NULL;
-  PyObject *__pyx_v_deltas = NULL;
-  PyObject *__pyx_v_typ = NULL;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__", 0);
-/* … */
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
-  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.Localizer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_trans);
-  __Pyx_XDECREF(__pyx_v_deltas);
-  __Pyx_XDECREF(__pyx_v_typ);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
+067:         self.tz = tz
-
  __Pyx_INCREF(((PyObject *)__pyx_v_tz));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_tz));
-  __Pyx_GOTREF(__pyx_v_self->tz);
-  __Pyx_DECREF(((PyObject *)__pyx_v_self->tz));
-  __pyx_v_self->tz = __pyx_v_tz;
-
+068:         self.use_utc = self.use_tzlocal = self.use_fixed = False
-
  __pyx_v_self->use_utc = 0;
-  __pyx_v_self->use_tzlocal = 0;
-  __pyx_v_self->use_fixed = 0;
-
+069:         self.use_dst = self.use_pytz = False
-
  __pyx_v_self->use_dst = 0;
-  __pyx_v_self->use_pytz = 0;
-
+070:         self.ntrans = -1  # placeholder
-
  __pyx_v_self->ntrans = -1L;
-
+071:         self.delta = -1  # placeholder
-
  __pyx_v_self->delta = -1LL;
-
+072:         self.deltas = _deltas_placeholder
-
  __PYX_XDEC_MEMVIEW(&__pyx_v_self->deltas, 0);
-  __PYX_INC_MEMVIEW(&__pyx_v_6pandas_5_libs_6tslibs_10vectorized__deltas_placeholder, 0);
-  __pyx_v_self->deltas = __pyx_v_6pandas_5_libs_6tslibs_10vectorized__deltas_placeholder;
-
+073:         self.tdata = NULL
-
  __pyx_v_self->tdata = NULL;
-
 074: 
-
+075:         if is_utc(tz) or tz is None:
-
  __pyx_t_2 = (__pyx_f_6pandas_5_libs_6tslibs_9timezones_is_utc(__pyx_v_tz, 0) != 0);
-  if (!__pyx_t_2) {
-  } else {
-    __pyx_t_1 = __pyx_t_2;
-    goto __pyx_L4_bool_binop_done;
-  }
-  __pyx_t_2 = (((PyObject *)__pyx_v_tz) == Py_None);
-  __pyx_t_3 = (__pyx_t_2 != 0);
-  __pyx_t_1 = __pyx_t_3;
-  __pyx_L4_bool_binop_done:;
-  if (__pyx_t_1) {
-/* … */
-    goto __pyx_L3;
-  }
-
+076:             self.use_utc = True
-
    __pyx_v_self->use_utc = 1;
-
 077: 
-
+078:         elif is_tzlocal(tz) or is_zoneinfo(tz):
-
  __pyx_t_3 = (__pyx_f_6pandas_5_libs_6tslibs_9timezones_is_tzlocal(__pyx_v_tz) != 0);
-  if (!__pyx_t_3) {
-  } else {
-    __pyx_t_1 = __pyx_t_3;
-    goto __pyx_L6_bool_binop_done;
-  }
-  __pyx_t_3 = (__pyx_f_6pandas_5_libs_6tslibs_9timezones_is_zoneinfo(__pyx_v_tz) != 0);
-  __pyx_t_1 = __pyx_t_3;
-  __pyx_L6_bool_binop_done:;
-  if (__pyx_t_1) {
-/* … */
-    goto __pyx_L3;
-  }
-
+079:             self.use_tzlocal = True
-
    __pyx_v_self->use_tzlocal = 1;
-
 080: 
-
 081:         else:
-
+082:             trans, deltas, typ = get_dst_info(tz)
-
  /*else*/ {
-    __pyx_t_4 = __pyx_f_6pandas_5_libs_6tslibs_9timezones_get_dst_info(__pyx_v_tz); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 82, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_4);
-    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
-      PyObject* sequence = __pyx_t_4;
-      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, 82, __pyx_L1_error)
-      }
-      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-      if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
-        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
-      } else {
-        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
-        __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
-      }
-      __Pyx_INCREF(__pyx_t_5);
-      __Pyx_INCREF(__pyx_t_6);
-      __Pyx_INCREF(__pyx_t_7);
-      #else
-      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 82, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 82, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 82, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_7);
-      #endif
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    } else {
-      Py_ssize_t index = -1;
-      __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 82, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-      index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_5);
-      index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_6);
-      index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_7);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(1, 82, __pyx_L1_error)
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      goto __pyx_L9_unpacking_done;
-      __pyx_L8_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_9 = NULL;
-      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      __PYX_ERR(1, 82, __pyx_L1_error)
-      __pyx_L9_unpacking_done:;
-    }
-    __pyx_v_trans = __pyx_t_5;
-    __pyx_t_5 = 0;
-    __pyx_v_deltas = __pyx_t_6;
-    __pyx_t_6 = 0;
-    __pyx_v_typ = __pyx_t_7;
-    __pyx_t_7 = 0;
-
+083:             self.trans = trans
-
    if (!(likely(((__pyx_v_trans) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_trans, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 83, __pyx_L1_error)
-    __pyx_t_4 = __pyx_v_trans;
-    __Pyx_INCREF(__pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
-    __Pyx_GOTREF(__pyx_v_self->trans);
-    __Pyx_DECREF(((PyObject *)__pyx_v_self->trans));
-    __pyx_v_self->trans = ((PyArrayObject *)__pyx_t_4);
-    __pyx_t_4 = 0;
-
+084:             self.ntrans = self.trans.shape[0]
-
    __pyx_v_self->ntrans = (__pyx_v_self->trans->dimensions[0]);
-
+085:             self.deltas = deltas
-
    __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t__const__(__pyx_v_deltas, 0); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(1, 85, __pyx_L1_error)
-    __PYX_XDEC_MEMVIEW(&__pyx_v_self->deltas, 0);
-    __pyx_v_self->deltas = __pyx_t_10;
-    __pyx_t_10.memview = NULL;
-    __pyx_t_10.data = NULL;
-
 086: 
-
+087:             if typ != "pytz" and typ != "dateutil":
-
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_typ, __pyx_n_u_pytz, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 87, __pyx_L1_error)
-    if (__pyx_t_3) {
-    } else {
-      __pyx_t_1 = __pyx_t_3;
-      goto __pyx_L11_bool_binop_done;
-    }
-    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_typ, __pyx_n_u_dateutil, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 87, __pyx_L1_error)
-    __pyx_t_1 = __pyx_t_3;
-    __pyx_L11_bool_binop_done:;
-    if (__pyx_t_1) {
-/* … */
-      goto __pyx_L10;
-    }
-
 088:                 # static/fixed; in this case we know that len(delta) == 1
-
+089:                 self.use_fixed = True
-
      __pyx_v_self->use_fixed = 1;
-
+090:                 self.delta = self.deltas[0]
-
      __pyx_t_11 = 0;
-      if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_v_self->deltas.shape[0];
-      __pyx_v_self->delta = (*((__pyx_t_5numpy_int64_t const  *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int64_t const  *) __pyx_v_self->deltas.data) + __pyx_t_11)) )));
-
 091:             else:
-
+092:                 self.use_dst = True
-
    /*else*/ {
-      __pyx_v_self->use_dst = 1;
-
+093:                 if typ == "pytz":
-
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_typ, __pyx_n_u_pytz, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 93, __pyx_L1_error)
-      if (__pyx_t_1) {
-/* … */
-      }
-
+094:                     self.use_pytz = True
-
        __pyx_v_self->use_pytz = 1;
-
+095:                 self.tdata = <int64_t*>cnp.PyArray_DATA(self.trans)
-
      __pyx_t_4 = ((PyObject *)__pyx_v_self->trans);
-      __Pyx_INCREF(__pyx_t_4);
-      __pyx_v_self->tdata = ((__pyx_t_5numpy_int64_t *)PyArray_DATA(((PyArrayObject *)__pyx_t_4)));
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    }
-    __pyx_L10:;
-  }
-  __pyx_L3:;
-
 096: 
-
 097:     @cython.boundscheck(False)
-
+098:     cdef inline int64_t utc_val_to_local_val(self, int64_t utc_val, Py_ssize_t* pos):
-
static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_5_libs_6tslibs_10vectorized_9Localizer_utc_val_to_local_val(struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_utc_val, Py_ssize_t *__pyx_v_pos) {
-  __pyx_t_5numpy_int64_t __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("utc_val_to_local_val", 0);
-/* … */
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_WriteUnraisable("pandas._libs.tslibs.vectorized.Localizer.utc_val_to_local_val", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
+099:         if self.use_utc:
-
  __pyx_t_1 = (__pyx_v_self->use_utc != 0);
-  if (__pyx_t_1) {
-/* … */
-  }
-
+100:             return utc_val
-
    __pyx_r = __pyx_v_utc_val;
-    goto __pyx_L0;
-
+101:         elif self.use_tzlocal:
-
  __pyx_t_1 = (__pyx_v_self->use_tzlocal != 0);
-  if (__pyx_t_1) {
-/* … */
-  }
-
+102:             return utc_val + localize_tzinfo_api(utc_val, self.tz)
-
    __pyx_t_2 = ((PyObject *)__pyx_v_self->tz);
-    __Pyx_INCREF(__pyx_t_2);
-    __pyx_t_3 = __pyx_f_6pandas_5_libs_6tslibs_12tzconversion_localize_tzinfo_api(__pyx_v_utc_val, ((PyDateTime_TZInfo *)__pyx_t_2), NULL); if (unlikely(__pyx_t_3 == ((__pyx_t_5numpy_int64_t)-1LL) && PyErr_Occurred())) __PYX_ERR(1, 102, __pyx_L1_error)
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_r = (__pyx_v_utc_val + __pyx_t_3);
-    goto __pyx_L0;
-
+103:         elif self.use_fixed:
-
  __pyx_t_1 = (__pyx_v_self->use_fixed != 0);
-  if (__pyx_t_1) {
-/* … */
-  }
-
+104:             return utc_val + self.delta
-
    __pyx_r = (__pyx_v_utc_val + __pyx_v_self->delta);
-    goto __pyx_L0;
-
 105:         else:
-
+106:             pos[0] = bisect_right_i8(self.tdata, utc_val, self.ntrans) - 1
-
  /*else*/ {
-    (__pyx_v_pos[0]) = (__pyx_f_6pandas_5_libs_6tslibs_12tzconversion_bisect_right_i8(__pyx_v_self->tdata, __pyx_v_utc_val, __pyx_v_self->ntrans) - 1);
-
+107:             return utc_val + self.deltas[pos[0]]
-
    if (unlikely(!__pyx_v_self->deltas.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 107, __pyx_L1_error)}
-    __pyx_t_4 = (__pyx_v_pos[0]);
-    if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_self->deltas.shape[0];
-    __pyx_r = (__pyx_v_utc_val + (*((__pyx_t_5numpy_int64_t const  *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int64_t const  *) __pyx_v_self->deltas.data) + __pyx_t_4)) ))));
-    goto __pyx_L0;
-  }
-
 108: 
-
 109: 
-
 110: # -------------------------------------------------------------------------
-
 111: 
-
 112: 
-
 113: @cython.wraparound(False)
-
 114: @cython.boundscheck(False)
-
+115: def ints_to_pydatetime(
-
/* Python wrapper */
-static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_1ints_to_pydatetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6pandas_5_libs_6tslibs_10vectorized_ints_to_pydatetime[] = "\n    Convert an i8 repr to an ndarray of datetimes, date, time or Timestamp.\n\n    Parameters\n    ----------\n    stamps : array of i8\n    tz : str, optional\n         convert to this timezone\n    freq : BaseOffset, optional\n         freq to convert\n    fold : bint, default is 0\n        Due to daylight saving time, one wall clock time can occur twice\n        when shifting from summer to winter time; fold describes whether the\n        datetime-like corresponds  to the first (0) or the second time (1)\n        the wall clock hits the ambiguous time\n\n        .. versionadded:: 1.1.0\n    box : {'datetime', 'timestamp', 'date', 'time'}, default 'datetime'\n        * If datetime, convert to datetime.datetime\n        * If date, convert to datetime.date\n        * If time, convert to datetime.time\n        * If Timestamp, convert to pandas.Timestamp\n\n    Returns\n    -------\n    ndarray[object] of type specified by box\n    ";
-static PyMethodDef __pyx_mdef_6pandas_5_libs_6tslibs_10vectorized_1ints_to_pydatetime = {"ints_to_pydatetime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_1ints_to_pydatetime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6tslibs_10vectorized_ints_to_pydatetime};
-static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_1ints_to_pydatetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  __Pyx_memviewslice __pyx_v_stamps = { 0, 0, { 0 }, { 0 }, { 0 } };
-  PyDateTime_TZInfo *__pyx_v_tz = 0;
-  struct __pyx_obj_6pandas_5_libs_6tslibs_7offsets_BaseOffset *__pyx_v_freq = 0;
-  int __pyx_v_fold;
-  PyObject *__pyx_v_box = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("ints_to_pydatetime (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stamps,&__pyx_n_s_tz,&__pyx_n_s_freq,&__pyx_n_s_fold,&__pyx_n_s_box,0};
-    PyObject* values[5] = {0,0,0,0,0};
-/* … */
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6pandas_5_libs_6tslibs_10vectorized_ints_to_pydatetime(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_stamps, PyDateTime_TZInfo *__pyx_v_tz, struct __pyx_obj_6pandas_5_libs_6tslibs_7offsets_BaseOffset *__pyx_v_freq, int __pyx_v_fold, PyObject *__pyx_v_box) {
-  struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *__pyx_v_info = 0;
-  __pyx_t_5numpy_int64_t __pyx_v_utc_val;
-  __pyx_t_5numpy_int64_t __pyx_v_local_val;
-  Py_ssize_t __pyx_v_i;
-  Py_ssize_t __pyx_v_n;
-  Py_ssize_t __pyx_v_pos;
-  npy_datetimestruct __pyx_v_dts;
-  PyDateTime_TZInfo *__pyx_v_new_tz = 0;
-  PyArrayObject *__pyx_v_result = 0;
-  int __pyx_v_use_date;
-  CYTHON_UNUSED int __pyx_v_use_time;
-  int __pyx_v_use_ts;
-  int __pyx_v_use_pydt;
-  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
-  __Pyx_Buffer __pyx_pybuffer_result;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("ints_to_pydatetime", 0);
-  __pyx_pybuffer_result.pybuffer.buf = NULL;
-  __pyx_pybuffer_result.refcount = 0;
-  __pyx_pybuffernd_result.data = NULL;
-  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
-/* … */
-  /* 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_13);
-  __Pyx_XDECREF(__pyx_t_14);
-  __Pyx_XDECREF(__pyx_t_15);
-  __Pyx_XDECREF(__pyx_t_16);
-  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
-    __Pyx_PyThreadState_declare
-    __Pyx_PyThreadState_assign
-    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
-    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
-  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
-  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.ints_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  goto __pyx_L2;
-  __pyx_L0:;
-  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
-  __pyx_L2:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_info);
-  __Pyx_XDECREF((PyObject *)__pyx_v_new_tz);
-  __Pyx_XDECREF((PyObject *)__pyx_v_result);
-  __PYX_XDEC_MEMVIEW(&__pyx_v_stamps, 1);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-/* … */
-  __pyx_tuple__24 = PyTuple_Pack(18, __pyx_n_s_stamps, __pyx_n_s_tz, __pyx_n_s_freq, __pyx_n_s_fold, __pyx_n_s_box, __pyx_n_s_info, __pyx_n_s_utc_val, __pyx_n_s_local_val, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_pos, __pyx_n_s_dts, __pyx_n_s_new_tz, __pyx_n_s_result, __pyx_n_s_use_date, __pyx_n_s_use_time, __pyx_n_s_use_ts, __pyx_n_s_use_pydt); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 115, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__24);
-  __Pyx_GIVEREF(__pyx_tuple__24);
-/* … */
-  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5_libs_6tslibs_10vectorized_1ints_to_pydatetime, NULL, __pyx_n_s_pandas__libs_tslibs_vectorized); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 115, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ints_to_pydatetime, __pyx_t_6) < 0) __PYX_ERR(1, 115, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas__libs_tslibs_vectorized_p, __pyx_n_s_ints_to_pydatetime, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(1, 115, __pyx_L1_error)
-
 116:     const int64_t[:] stamps,
-
+117:     tzinfo tz=None,
-
    values[1] = (PyObject *)((PyDateTime_TZInfo *)Py_None);
-
+118:     BaseOffset freq=None,
-
    values[2] = (PyObject *)((struct __pyx_obj_6pandas_5_libs_6tslibs_7offsets_BaseOffset *)Py_None);
-    values[4] = ((PyObject*)__pyx_n_u_datetime);
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
-        CYTHON_FALLTHROUGH;
-        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
-        CYTHON_FALLTHROUGH;
-        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stamps)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tz);
-          if (value) { values[1] = value; kw_args--; }
-        }
-        CYTHON_FALLTHROUGH;
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_freq);
-          if (value) { values[2] = value; kw_args--; }
-        }
-        CYTHON_FALLTHROUGH;
-        case  3:
-        if (kw_args > 0) {
-          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fold);
-          if (value) { values[3] = value; kw_args--; }
-        }
-        CYTHON_FALLTHROUGH;
-        case  4:
-        if (kw_args > 0) {
-          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box);
-          if (value) { values[4] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ints_to_pydatetime") < 0)) __PYX_ERR(1, 115, __pyx_L3_error)
-      }
-    } else {
-      switch (PyTuple_GET_SIZE(__pyx_args)) {
-        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
-        CYTHON_FALLTHROUGH;
-        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
-        CYTHON_FALLTHROUGH;
-        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_stamps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t__const__(values[0], 0); if (unlikely(!__pyx_v_stamps.memview)) __PYX_ERR(1, 116, __pyx_L3_error)
-    __pyx_v_tz = ((PyDateTime_TZInfo *)values[1]);
-    __pyx_v_freq = ((struct __pyx_obj_6pandas_5_libs_6tslibs_7offsets_BaseOffset *)values[2]);
-    if (values[3]) {
-      __pyx_v_fold = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_fold == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 119, __pyx_L3_error)
-    } else {
-
+119:     bint fold=False,
-
      __pyx_v_fold = ((int)0);
-    }
-    __pyx_v_box = ((PyObject*)values[4]);
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("ints_to_pydatetime", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 115, __pyx_L3_error)
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.ints_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tz), __pyx_ptype_7cpython_8datetime_tzinfo, 1, "tz", 0))) __PYX_ERR(1, 117, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_freq), __pyx_ptype_6pandas_5_libs_6tslibs_7offsets_BaseOffset, 1, "freq", 0))) __PYX_ERR(1, 118, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), (&PyUnicode_Type), 1, "box", 1))) __PYX_ERR(1, 120, __pyx_L1_error)
-  __pyx_r = __pyx_pf_6pandas_5_libs_6tslibs_10vectorized_ints_to_pydatetime(__pyx_self, __pyx_v_stamps, __pyx_v_tz, __pyx_v_freq, __pyx_v_fold, __pyx_v_box);
-
 120:     str box="datetime"
-
 121: ) -> np.ndarray:
-
 122:     """
-
 123:     Convert an i8 repr to an ndarray of datetimes, date, time or Timestamp.
-
 124: 
-
 125:     Parameters
-
 126:     ----------
-
 127:     stamps : array of i8
-
 128:     tz : str, optional
-
 129:          convert to this timezone
-
 130:     freq : BaseOffset, optional
-
 131:          freq to convert
-
 132:     fold : bint, default is 0
-
 133:         Due to daylight saving time, one wall clock time can occur twice
-
 134:         when shifting from summer to winter time; fold describes whether the
-
 135:         datetime-like corresponds  to the first (0) or the second time (1)
-
 136:         the wall clock hits the ambiguous time
-
 137: 
-
 138:         .. versionadded:: 1.1.0
-
 139:     box : {'datetime', 'timestamp', 'date', 'time'}, default 'datetime'
-
 140:         * If datetime, convert to datetime.datetime
-
 141:         * If date, convert to datetime.date
-
 142:         * If time, convert to datetime.time
-
 143:         * If Timestamp, convert to pandas.Timestamp
-
 144: 
-
 145:     Returns
-
 146:     -------
-
 147:     ndarray[object] of type specified by box
-
 148:     """
-
 149:     cdef:
-
+150:         Localizer info = Localizer(tz)
-
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pandas_5_libs_6tslibs_10vectorized_Localizer), ((PyObject *)__pyx_v_tz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 150, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_info = ((struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *)__pyx_t_1);
-  __pyx_t_1 = 0;
-
 151:         int64_t utc_val, local_val
-
+152:         Py_ssize_t i, n = stamps.shape[0]
-
  __pyx_v_n = (__pyx_v_stamps.shape[0]);
-
+153:         Py_ssize_t pos = -1  # unused, avoid not-initialized warning
-
  __pyx_v_pos = -1L;
-
 154: 
-
 155:         npy_datetimestruct dts
-
 156:         tzinfo new_tz
-
+157:         ndarray[object] result = np.empty(n, dtype=object)
-
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 157, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 157, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 157, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 157, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 157, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_builtin_object) < 0) __PYX_ERR(1, 157, __pyx_L1_error)
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 157, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 157, __pyx_L1_error)
-  __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
-  {
-    __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
-      __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_result.rcbuffer->pybuffer.buf = NULL;
-      __PYX_ERR(1, 157, __pyx_L1_error)
-    } else {__pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
-    }
-  }
-  __pyx_t_5 = 0;
-  __pyx_v_result = ((PyArrayObject *)__pyx_t_4);
-  __pyx_t_4 = 0;
-
+158:         bint use_date = False, use_time = False, use_ts = False, use_pydt = False
-
  __pyx_v_use_date = 0;
-  __pyx_v_use_time = 0;
-  __pyx_v_use_ts = 0;
-  __pyx_v_use_pydt = 0;
-
 159: 
-
+160:     if box == "date":
-
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_box, __pyx_n_u_date, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
-  __pyx_t_7 = (__pyx_t_6 != 0);
-  if (__pyx_t_7) {
-/* … */
-    goto __pyx_L3;
-  }
-
+161:         assert (tz is None), "tz should be None when converting to date"
-
    #ifndef CYTHON_WITHOUT_ASSERTIONS
-    if (unlikely(!Py_OptimizeFlag)) {
-      __pyx_t_7 = (((PyObject *)__pyx_v_tz) == Py_None);
-      if (unlikely(!(__pyx_t_7 != 0))) {
-        PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_tz_should_be_None_when_convertin);
-        __PYX_ERR(1, 161, __pyx_L1_error)
-      }
-    }
-    #endif
-
+162:         use_date = True
-
    __pyx_v_use_date = 1;
-
+163:     elif box == "timestamp":
-
  __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_box, __pyx_n_u_timestamp, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(1, 163, __pyx_L1_error)
-  __pyx_t_6 = (__pyx_t_7 != 0);
-  if (__pyx_t_6) {
-/* … */
-    goto __pyx_L3;
-  }
-
+164:         use_ts = True
-
    __pyx_v_use_ts = 1;
-
+165:     elif box == "time":
-
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_box, __pyx_n_u_time, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 165, __pyx_L1_error)
-  __pyx_t_7 = (__pyx_t_6 != 0);
-  if (__pyx_t_7) {
-/* … */
-    goto __pyx_L3;
-  }
-
+166:         use_time = True
-
    __pyx_v_use_time = 1;
-
+167:     elif box == "datetime":
-
  __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_box, __pyx_n_u_datetime, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(1, 167, __pyx_L1_error)
-  __pyx_t_6 = (__pyx_t_7 != 0);
-  if (likely(__pyx_t_6)) {
-/* … */
-    goto __pyx_L3;
-  }
-
+168:         use_pydt = True
-
    __pyx_v_use_pydt = 1;
-
 169:     else:
-
+170:         raise ValueError(
-
  /*else*/ {
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 170, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __PYX_ERR(1, 170, __pyx_L1_error)
-  }
-  __pyx_L3:;
-/* … */
-  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_box_must_be_one_of_datetime_date); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 170, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__3);
-  __Pyx_GIVEREF(__pyx_tuple__3);
-
 171:             "box must be one of 'datetime', 'date', 'time' or 'timestamp'"
-
 172:         )
-
 173: 
-
+174:     for i in range(n):
-
  __pyx_t_8 = __pyx_v_n;
-  __pyx_t_9 = __pyx_t_8;
-  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
-    __pyx_v_i = __pyx_t_10;
-
+175:         utc_val = stamps[i]
-
    __pyx_t_11 = __pyx_v_i;
-    __pyx_v_utc_val = (*((__pyx_t_5numpy_int64_t const  *) ( /* dim=0 */ (__pyx_v_stamps.data + __pyx_t_11 * __pyx_v_stamps.strides[0]) )));
-
+176:         new_tz = tz
-
    __Pyx_INCREF(((PyObject *)__pyx_v_tz));
-    __Pyx_XDECREF_SET(__pyx_v_new_tz, __pyx_v_tz);
-
 177: 
-
+178:         if utc_val == NPY_NAT:
-
    __pyx_t_6 = ((__pyx_v_utc_val == __pyx_v_6pandas_5_libs_6tslibs_7nattype_NPY_NAT) != 0);
-    if (__pyx_t_6) {
-/* … */
-    }
-
+179:             result[i] = <object>NaT
-
      __pyx_t_4 = ((PyObject *)__pyx_v_6pandas_5_libs_6tslibs_7nattype_c_NaT);
-      __Pyx_INCREF(__pyx_t_4);
-      __pyx_t_11 = __pyx_v_i;
-      __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_result.diminfo[0].strides);
-      __Pyx_GOTREF(*__pyx_t_12);
-      __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(*__pyx_t_12);
-      *__pyx_t_12 = __pyx_t_4;
-      __Pyx_GIVEREF(*__pyx_t_12);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
+180:             continue
-
      goto __pyx_L4_continue;
-
 181: 
-
+182:         local_val = info.utc_val_to_local_val(utc_val, &pos)
-
    __pyx_v_local_val = __pyx_f_6pandas_5_libs_6tslibs_10vectorized_9Localizer_utc_val_to_local_val(__pyx_v_info, __pyx_v_utc_val, (&__pyx_v_pos));
-
+183:         if info.use_pytz:
-
    __pyx_t_6 = (__pyx_v_info->use_pytz != 0);
-    if (__pyx_t_6) {
-/* … */
-    }
-
 184:             # find right representation of dst etc in pytz timezone
-
+185:             new_tz = tz._tzinfos[tz._transition_info[pos]]
-
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_tz), __pyx_n_s_tzinfos); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 185, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_tz), __pyx_n_s_transition_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 185, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_pos, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 185, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 185, __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;
-      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_8datetime_tzinfo))))) __PYX_ERR(1, 185, __pyx_L1_error)
-      __Pyx_DECREF_SET(__pyx_v_new_tz, ((PyDateTime_TZInfo *)__pyx_t_1));
-      __pyx_t_1 = 0;
-
 186: 
-
+187:         dt64_to_dtstruct(local_val, &dts)
-
    __pyx_f_6pandas_5_libs_6tslibs_11np_datetime_dt64_to_dtstruct(__pyx_v_local_val, (&__pyx_v_dts));
-
 188: 
-
+189:         if use_ts:
-
    __pyx_t_6 = (__pyx_v_use_ts != 0);
-    if (__pyx_t_6) {
-/* … */
-      goto __pyx_L8;
-    }
-
+190:             result[i] = create_timestamp_from_ts(utc_val, dts, new_tz, freq, fold)
-
      __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_5_libs_6tslibs_10timestamps_create_timestamp_from_ts(__pyx_v_utc_val, __pyx_v_dts, __pyx_v_new_tz, __pyx_v_freq, __pyx_v_fold)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 190, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_11 = __pyx_v_i;
-      __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_result.diminfo[0].strides);
-      __Pyx_GOTREF(*__pyx_t_12);
-      __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(*__pyx_t_12);
-      *__pyx_t_12 = __pyx_t_1;
-      __Pyx_GIVEREF(*__pyx_t_12);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
+191:         elif use_pydt:
-
    __pyx_t_6 = (__pyx_v_use_pydt != 0);
-    if (__pyx_t_6) {
-/* … */
-      goto __pyx_L8;
-    }
-
+192:             result[i] = datetime(
-
      __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 192, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_16);
-      __Pyx_GIVEREF(__pyx_t_1);
-      PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_1);
-      __Pyx_GIVEREF(__pyx_t_3);
-      PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_3);
-      __Pyx_GIVEREF(__pyx_t_4);
-      PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_4);
-      __Pyx_GIVEREF(__pyx_t_2);
-      PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_13);
-      PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_13);
-      __Pyx_GIVEREF(__pyx_t_14);
-      PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_14);
-      __Pyx_GIVEREF(__pyx_t_15);
-      PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_15);
-      __Pyx_INCREF(((PyObject *)__pyx_v_new_tz));
-      __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tz));
-      PyTuple_SET_ITEM(__pyx_t_16, 7, ((PyObject *)__pyx_v_new_tz));
-      __pyx_t_1 = 0;
-      __pyx_t_3 = 0;
-      __pyx_t_4 = 0;
-      __pyx_t_2 = 0;
-      __pyx_t_13 = 0;
-      __pyx_t_14 = 0;
-      __pyx_t_15 = 0;
-/* … */
-      __pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime), __pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 192, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_14);
-      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
-      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-      __pyx_t_11 = __pyx_v_i;
-      __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_result.diminfo[0].strides);
-      __Pyx_GOTREF(*__pyx_t_12);
-      __Pyx_INCREF(__pyx_t_14); __Pyx_DECREF(*__pyx_t_12);
-      *__pyx_t_12 = __pyx_t_14;
-      __Pyx_GIVEREF(*__pyx_t_12);
-      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-
+193:                 dts.year, dts.month, dts.day, dts.hour, dts.min, dts.sec, dts.us,
-
      __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 193, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 193, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 193, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 193, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_13 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 193, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_13);
-      __pyx_t_14 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 193, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_14);
-      __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 193, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_15);
-
+194:                 new_tz, fold=fold,
-
      __pyx_t_15 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 194, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_15);
-      __pyx_t_14 = __Pyx_PyBool_FromLong(__pyx_v_fold); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 194, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_14);
-      if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_fold, __pyx_t_14) < 0) __PYX_ERR(1, 194, __pyx_L1_error)
-      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-
 195:             )
-
+196:         elif use_date:
-
    __pyx_t_6 = (__pyx_v_use_date != 0);
-    if (__pyx_t_6) {
-/* … */
-      goto __pyx_L8;
-    }
-
+197:             result[i] = date(dts.year, dts.month, dts.day)
-
      __pyx_t_14 = __Pyx_PyInt_From_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 197, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_14);
-      __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 197, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_15);
-      __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 197, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_16);
-      __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 197, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_13);
-      __Pyx_GIVEREF(__pyx_t_14);
-      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14);
-      __Pyx_GIVEREF(__pyx_t_15);
-      PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_15);
-      __Pyx_GIVEREF(__pyx_t_16);
-      PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_16);
-      __pyx_t_14 = 0;
-      __pyx_t_15 = 0;
-      __pyx_t_16 = 0;
-      __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cpython_8datetime_date), __pyx_t_13, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 197, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_16);
-      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-      __pyx_t_11 = __pyx_v_i;
-      __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_result.diminfo[0].strides);
-      __Pyx_GOTREF(*__pyx_t_12);
-      __Pyx_INCREF(__pyx_t_16); __Pyx_DECREF(*__pyx_t_12);
-      *__pyx_t_12 = __pyx_t_16;
-      __Pyx_GIVEREF(*__pyx_t_12);
-      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
-
 198:         else:
-
+199:             result[i] = time(dts.hour, dts.min, dts.sec, dts.us, new_tz, fold=fold)
-
    /*else*/ {
-      __pyx_t_16 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 199, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_16);
-      __pyx_t_13 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 199, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_13);
-      __pyx_t_15 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 199, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_15);
-      __pyx_t_14 = __Pyx_PyInt_From_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 199, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_14);
-      __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 199, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_16);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_16);
-      __Pyx_GIVEREF(__pyx_t_13);
-      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_13);
-      __Pyx_GIVEREF(__pyx_t_15);
-      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_15);
-      __Pyx_GIVEREF(__pyx_t_14);
-      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_14);
-      __Pyx_INCREF(((PyObject *)__pyx_v_new_tz));
-      __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tz));
-      PyTuple_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_v_new_tz));
-      __pyx_t_16 = 0;
-      __pyx_t_13 = 0;
-      __pyx_t_15 = 0;
-      __pyx_t_14 = 0;
-      __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 199, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_14);
-      __pyx_t_15 = __Pyx_PyBool_FromLong(__pyx_v_fold); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 199, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_15);
-      if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_fold, __pyx_t_15) < 0) __PYX_ERR(1, 199, __pyx_L1_error)
-      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-      __pyx_t_15 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cpython_8datetime_time), __pyx_t_2, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 199, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_15);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-      __pyx_t_11 = __pyx_v_i;
-      __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_result.diminfo[0].strides);
-      __Pyx_GOTREF(*__pyx_t_12);
-      __Pyx_INCREF(__pyx_t_15); __Pyx_DECREF(*__pyx_t_12);
-      *__pyx_t_12 = __pyx_t_15;
-      __Pyx_GIVEREF(*__pyx_t_12);
-      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-    }
-    __pyx_L8:;
-    __pyx_L4_continue:;
-  }
-
 200: 
-
+201:     return result
-
  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_result));
-  __pyx_r = ((PyObject *)__pyx_v_result);
-  goto __pyx_L0;
-
 202: 
-
 203: 
-
 204: # -------------------------------------------------------------------------
-
 205: 
-
 206: 
-
+207: cdef inline c_Resolution _reso_stamp(npy_datetimestruct *dts):
-
static CYTHON_INLINE enum __pyx_t_6pandas_5_libs_6tslibs_6dtypes_c_Resolution __pyx_f_6pandas_5_libs_6tslibs_10vectorized__reso_stamp(npy_datetimestruct *__pyx_v_dts) {
-  enum __pyx_t_6pandas_5_libs_6tslibs_6dtypes_c_Resolution __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_reso_stamp", 0);
-/* … */
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
+208:     if dts.us != 0:
-
  __pyx_t_1 = ((__pyx_v_dts->us != 0) != 0);
-  if (__pyx_t_1) {
-/* … */
-  }
-
+209:         if dts.us % 1000 == 0:
-
    __pyx_t_1 = ((__Pyx_mod_long(__pyx_v_dts->us, 0x3E8) == 0) != 0);
-    if (__pyx_t_1) {
-/* … */
-    }
-
+210:             return c_Resolution.RESO_MS
-
      __pyx_r = __pyx_e_6pandas_5_libs_6tslibs_6dtypes_RESO_MS;
-      goto __pyx_L0;
-
+211:         return c_Resolution.RESO_US
-
    __pyx_r = __pyx_e_6pandas_5_libs_6tslibs_6dtypes_RESO_US;
-    goto __pyx_L0;
-
+212:     elif dts.sec != 0:
-
  __pyx_t_1 = ((__pyx_v_dts->sec != 0) != 0);
-  if (__pyx_t_1) {
-/* … */
-  }
-
+213:         return c_Resolution.RESO_SEC
-
    __pyx_r = __pyx_e_6pandas_5_libs_6tslibs_6dtypes_RESO_SEC;
-    goto __pyx_L0;
-
+214:     elif dts.min != 0:
-
  __pyx_t_1 = ((__pyx_v_dts->min != 0) != 0);
-  if (__pyx_t_1) {
-/* … */
-  }
-
+215:         return c_Resolution.RESO_MIN
-
    __pyx_r = __pyx_e_6pandas_5_libs_6tslibs_6dtypes_RESO_MIN;
-    goto __pyx_L0;
-
+216:     elif dts.hour != 0:
-
  __pyx_t_1 = ((__pyx_v_dts->hour != 0) != 0);
-  if (__pyx_t_1) {
-/* … */
-  }
-
+217:         return c_Resolution.RESO_HR
-
    __pyx_r = __pyx_e_6pandas_5_libs_6tslibs_6dtypes_RESO_HR;
-    goto __pyx_L0;
-
+218:     return c_Resolution.RESO_DAY
-
  __pyx_r = __pyx_e_6pandas_5_libs_6tslibs_6dtypes_RESO_DAY;
-  goto __pyx_L0;
-
 219: 
-
 220: 
-
 221: @cython.wraparound(False)
-
 222: @cython.boundscheck(False)
-
+223: def get_resolution(const int64_t[:] stamps, tzinfo tz=None) -> Resolution:
-
/* Python wrapper */
-static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_3get_resolution(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_6pandas_5_libs_6tslibs_10vectorized_3get_resolution = {"get_resolution", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_3get_resolution, METH_VARARGS|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_3get_resolution(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  __Pyx_memviewslice __pyx_v_stamps = { 0, 0, { 0 }, { 0 }, { 0 } };
-  PyDateTime_TZInfo *__pyx_v_tz = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("get_resolution (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stamps,&__pyx_n_s_tz,0};
-    PyObject* values[2] = {0,0};
-    values[1] = (PyObject *)((PyDateTime_TZInfo *)Py_None);
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stamps)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tz);
-          if (value) { values[1] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_resolution") < 0)) __PYX_ERR(1, 223, __pyx_L3_error)
-      }
-    } else {
-      switch (PyTuple_GET_SIZE(__pyx_args)) {
-        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_stamps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t__const__(values[0], 0); if (unlikely(!__pyx_v_stamps.memview)) __PYX_ERR(1, 223, __pyx_L3_error)
-    __pyx_v_tz = ((PyDateTime_TZInfo *)values[1]);
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("get_resolution", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 223, __pyx_L3_error)
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.get_resolution", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tz), __pyx_ptype_7cpython_8datetime_tzinfo, 1, "tz", 0))) __PYX_ERR(1, 223, __pyx_L1_error)
-  __pyx_r = __pyx_pf_6pandas_5_libs_6tslibs_10vectorized_2get_resolution(__pyx_self, __pyx_v_stamps, __pyx_v_tz);
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6pandas_5_libs_6tslibs_10vectorized_2get_resolution(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_stamps, PyDateTime_TZInfo *__pyx_v_tz) {
-  struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *__pyx_v_info = 0;
-  __pyx_t_5numpy_int64_t __pyx_v_utc_val;
-  __pyx_t_5numpy_int64_t __pyx_v_local_val;
-  Py_ssize_t __pyx_v_i;
-  Py_ssize_t __pyx_v_n;
-  Py_ssize_t __pyx_v_pos;
-  npy_datetimestruct __pyx_v_dts;
-  enum __pyx_t_6pandas_5_libs_6tslibs_6dtypes_c_Resolution __pyx_v_reso;
-  enum __pyx_t_6pandas_5_libs_6tslibs_6dtypes_c_Resolution __pyx_v_curr_reso;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("get_resolution", 0);
-/* … */
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.get_resolution", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_info);
-  __PYX_XDEC_MEMVIEW(&__pyx_v_stamps, 1);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-/* … */
-  __pyx_tuple__26 = PyTuple_Pack(11, __pyx_n_s_stamps, __pyx_n_s_tz, __pyx_n_s_info, __pyx_n_s_utc_val, __pyx_n_s_local_val, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_pos, __pyx_n_s_dts, __pyx_n_s_reso, __pyx_n_s_curr_reso); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 223, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__26);
-  __Pyx_GIVEREF(__pyx_tuple__26);
-/* … */
-  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5_libs_6tslibs_10vectorized_3get_resolution, NULL, __pyx_n_s_pandas__libs_tslibs_vectorized); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 223, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_resolution, __pyx_t_6) < 0) __PYX_ERR(1, 223, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas__libs_tslibs_vectorized_p, __pyx_n_s_get_resolution, 223, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(1, 223, __pyx_L1_error)
-
 224:     cdef:
-
+225:         Localizer info = Localizer(tz)
-
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pandas_5_libs_6tslibs_10vectorized_Localizer), ((PyObject *)__pyx_v_tz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 225, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_info = ((struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *)__pyx_t_1);
-  __pyx_t_1 = 0;
-
 226:         int64_t utc_val, local_val
-
+227:         Py_ssize_t i, n = stamps.shape[0]
-
  __pyx_v_n = (__pyx_v_stamps.shape[0]);
-
+228:         Py_ssize_t pos = -1  # unused, avoid not-initialized warning
-
  __pyx_v_pos = -1L;
-
 229: 
-
 230:         npy_datetimestruct dts
-
+231:         c_Resolution reso = c_Resolution.RESO_DAY, curr_reso
-
  __pyx_v_reso = __pyx_e_6pandas_5_libs_6tslibs_6dtypes_RESO_DAY;
-
 232: 
-
+233:     for i in range(n):
-
  __pyx_t_2 = __pyx_v_n;
-  __pyx_t_3 = __pyx_t_2;
-  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
-    __pyx_v_i = __pyx_t_4;
-
+234:         utc_val = stamps[i]
-
    __pyx_t_5 = __pyx_v_i;
-    __pyx_v_utc_val = (*((__pyx_t_5numpy_int64_t const  *) ( /* dim=0 */ (__pyx_v_stamps.data + __pyx_t_5 * __pyx_v_stamps.strides[0]) )));
-
+235:         if utc_val == NPY_NAT:
-
    __pyx_t_6 = ((__pyx_v_utc_val == __pyx_v_6pandas_5_libs_6tslibs_7nattype_NPY_NAT) != 0);
-    if (__pyx_t_6) {
-/* … */
-    }
-
+236:             continue
-
      goto __pyx_L3_continue;
-
 237: 
-
+238:         local_val = info.utc_val_to_local_val(utc_val, &pos)
-
    __pyx_v_local_val = __pyx_f_6pandas_5_libs_6tslibs_10vectorized_9Localizer_utc_val_to_local_val(__pyx_v_info, __pyx_v_utc_val, (&__pyx_v_pos));
-
 239: 
-
+240:         dt64_to_dtstruct(local_val, &dts)
-
    __pyx_f_6pandas_5_libs_6tslibs_11np_datetime_dt64_to_dtstruct(__pyx_v_local_val, (&__pyx_v_dts));
-
+241:         curr_reso = _reso_stamp(&dts)
-
    __pyx_v_curr_reso = __pyx_f_6pandas_5_libs_6tslibs_10vectorized__reso_stamp((&__pyx_v_dts));
-
+242:         if curr_reso < reso:
-
    __pyx_t_6 = ((__pyx_v_curr_reso < __pyx_v_reso) != 0);
-    if (__pyx_t_6) {
-/* … */
-    }
-    __pyx_L3_continue:;
-  }
-
+243:             reso = curr_reso
-
      __pyx_v_reso = __pyx_v_curr_reso;
-
 244: 
-
+245:     return Resolution(reso)
-
  __Pyx_XDECREF(__pyx_r);
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Resolution); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 245, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_8 = __Pyx_PyInt_From_enum____pyx_t_6pandas_5_libs_6tslibs_6dtypes_c_Resolution(__pyx_v_reso); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 245, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_9 = NULL;
-  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
-    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
-    if (likely(__pyx_t_9)) {
-      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
-      __Pyx_INCREF(__pyx_t_9);
-      __Pyx_INCREF(function);
-      __Pyx_DECREF_SET(__pyx_t_7, function);
-    }
-  }
-  __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 245, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
 246: 
-
 247: 
-
 248: # -------------------------------------------------------------------------
-
 249: 
-
 250: 
-
 251: @cython.cdivision(False)
-
 252: @cython.wraparound(False)
-
 253: @cython.boundscheck(False)
-
+254: cpdef ndarray[int64_t] normalize_i8_timestamps(const int64_t[:] stamps, tzinfo tz):
-
static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_5normalize_i8_timestamps(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyArrayObject *__pyx_f_6pandas_5_libs_6tslibs_10vectorized_normalize_i8_timestamps(__Pyx_memviewslice __pyx_v_stamps, PyDateTime_TZInfo *__pyx_v_tz, CYTHON_UNUSED int __pyx_skip_dispatch) {
-  struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *__pyx_v_info = 0;
-  __pyx_t_5numpy_int64_t __pyx_v_utc_val;
-  __pyx_t_5numpy_int64_t __pyx_v_local_val;
-  Py_ssize_t __pyx_v_i;
-  Py_ssize_t __pyx_v_n;
-  Py_ssize_t __pyx_v_pos;
-  __Pyx_memviewslice __pyx_v_result = { 0, 0, { 0 }, { 0 }, { 0 } };
-  PyArrayObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("normalize_i8_timestamps", 0);
-/* … */
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
-  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.normalize_i8_timestamps", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_info);
-  __PYX_XDEC_MEMVIEW(&__pyx_v_result, 1);
-  __Pyx_XGIVEREF((PyObject *)__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_5normalize_i8_timestamps(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6pandas_5_libs_6tslibs_10vectorized_4normalize_i8_timestamps[] = "\n    Normalize each of the (nanosecond) timezone aware timestamps in the given\n    array by rounding down to the beginning of the day (i.e. midnight).\n    This is midnight for timezone, `tz`.\n\n    Parameters\n    ----------\n    stamps : int64 ndarray\n    tz : tzinfo or None\n\n    Returns\n    -------\n    result : int64 ndarray of converted of normalized nanosecond timestamps\n    ";
-static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_5normalize_i8_timestamps(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  __Pyx_memviewslice __pyx_v_stamps = { 0, 0, { 0 }, { 0 }, { 0 } };
-  PyDateTime_TZInfo *__pyx_v_tz = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("normalize_i8_timestamps (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stamps,&__pyx_n_s_tz,0};
-    PyObject* values[2] = {0,0};
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stamps)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tz)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("normalize_i8_timestamps", 1, 2, 2, 1); __PYX_ERR(1, 254, __pyx_L3_error)
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "normalize_i8_timestamps") < 0)) __PYX_ERR(1, 254, __pyx_L3_error)
-      }
-    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-    }
-    __pyx_v_stamps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t__const__(values[0], 0); if (unlikely(!__pyx_v_stamps.memview)) __PYX_ERR(1, 254, __pyx_L3_error)
-    __pyx_v_tz = ((PyDateTime_TZInfo *)values[1]);
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("normalize_i8_timestamps", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 254, __pyx_L3_error)
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.normalize_i8_timestamps", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tz), __pyx_ptype_7cpython_8datetime_tzinfo, 1, "tz", 0))) __PYX_ERR(1, 254, __pyx_L1_error)
-  __pyx_r = __pyx_pf_6pandas_5_libs_6tslibs_10vectorized_4normalize_i8_timestamps(__pyx_self, __pyx_v_stamps, __pyx_v_tz);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6pandas_5_libs_6tslibs_10vectorized_4normalize_i8_timestamps(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_stamps, PyDateTime_TZInfo *__pyx_v_tz) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("normalize_i8_timestamps", 0);
-  __Pyx_XDECREF(__pyx_r);
-  if (unlikely(!__pyx_v_stamps.memview)) { __Pyx_RaiseUnboundLocalError("stamps"); __PYX_ERR(1, 254, __pyx_L1_error) }
-  __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_5_libs_6tslibs_10vectorized_normalize_i8_timestamps(__pyx_v_stamps, __pyx_v_tz, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 254, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.normalize_i8_timestamps", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __PYX_XDEC_MEMVIEW(&__pyx_v_stamps, 1);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
 255:     """
-
 256:     Normalize each of the (nanosecond) timezone aware timestamps in the given
-
 257:     array by rounding down to the beginning of the day (i.e. midnight).
-
 258:     This is midnight for timezone, `tz`.
-
 259: 
-
 260:     Parameters
-
 261:     ----------
-
 262:     stamps : int64 ndarray
-
 263:     tz : tzinfo or None
-
 264: 
-
 265:     Returns
-
 266:     -------
-
 267:     result : int64 ndarray of converted of normalized nanosecond timestamps
-
 268:     """
-
 269:     cdef:
-
+270:         Localizer info = Localizer(tz)
-
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pandas_5_libs_6tslibs_10vectorized_Localizer), ((PyObject *)__pyx_v_tz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 270, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_info = ((struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *)__pyx_t_1);
-  __pyx_t_1 = 0;
-
 271:         int64_t utc_val, local_val
-
+272:         Py_ssize_t i, n = stamps.shape[0]
-
  __pyx_v_n = (__pyx_v_stamps.shape[0]);
-
+273:         Py_ssize_t pos = -1  # unused, avoid not-initialized warning
-
  __pyx_v_pos = -1L;
-
 274: 
-
+275:         int64_t[::1] result = np.empty(n, dtype=np.int64)
-
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 275, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 275, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 275, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 275, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 275, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(1, 275, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 275, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(1, 275, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_v_result = __pyx_t_6;
-  __pyx_t_6.memview = NULL;
-  __pyx_t_6.data = NULL;
-
 276: 
-
+277:     for i in range(n):
-
  __pyx_t_7 = __pyx_v_n;
-  __pyx_t_8 = __pyx_t_7;
-  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
-    __pyx_v_i = __pyx_t_9;
-
+278:         utc_val = stamps[i]
-
    __pyx_t_10 = __pyx_v_i;
-    __pyx_v_utc_val = (*((__pyx_t_5numpy_int64_t const  *) ( /* dim=0 */ (__pyx_v_stamps.data + __pyx_t_10 * __pyx_v_stamps.strides[0]) )));
-
+279:         if utc_val == NPY_NAT:
-
    __pyx_t_11 = ((__pyx_v_utc_val == __pyx_v_6pandas_5_libs_6tslibs_7nattype_NPY_NAT) != 0);
-    if (__pyx_t_11) {
-/* … */
-    }
-
+280:             result[i] = NPY_NAT
-
      __pyx_t_10 = __pyx_v_i;
-      *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int64_t *) __pyx_v_result.data) + __pyx_t_10)) )) = __pyx_v_6pandas_5_libs_6tslibs_7nattype_NPY_NAT;
-
+281:             continue
-
      goto __pyx_L3_continue;
-
 282: 
-
+283:         local_val = info.utc_val_to_local_val(utc_val, &pos)
-
    __pyx_v_local_val = __pyx_f_6pandas_5_libs_6tslibs_10vectorized_9Localizer_utc_val_to_local_val(__pyx_v_info, __pyx_v_utc_val, (&__pyx_v_pos));
-
 284: 
-
+285:         result[i] = local_val - (local_val % DAY_NANOS)
-
    if (unlikely(__pyx_v_6pandas_5_libs_6tslibs_9ccalendar_DAY_NANOS == 0)) {
-      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
-      __PYX_ERR(1, 285, __pyx_L1_error)
-    }
-    __pyx_t_10 = __pyx_v_i;
-    *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int64_t *) __pyx_v_result.data) + __pyx_t_10)) )) = (__pyx_v_local_val - __Pyx_mod___pyx_t_5numpy_int64_t(__pyx_v_local_val, __pyx_v_6pandas_5_libs_6tslibs_9ccalendar_DAY_NANOS));
-    __pyx_L3_continue:;
-  }
-
 286: 
-
+287:     return result.base  # `.base` to access underlying ndarray
-
  __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_result, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 287, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 287, __pyx_L1_error)
-  __pyx_r = ((PyArrayObject *)__pyx_t_1);
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
 288: 
-
 289: 
-
 290: @cython.wraparound(False)
-
 291: @cython.boundscheck(False)
-
+292: def is_date_array_normalized(const int64_t[:] stamps, tzinfo tz=None) -> bool:
-
/* Python wrapper */
-static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_7is_date_array_normalized(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6pandas_5_libs_6tslibs_10vectorized_6is_date_array_normalized[] = "\n    Check if all of the given (nanosecond) timestamps are normalized to\n    midnight, i.e. hour == minute == second == 0.  If the optional timezone\n    `tz` is not None, then this is midnight for this timezone.\n\n    Parameters\n    ----------\n    stamps : int64 ndarray\n    tz : tzinfo or None\n\n    Returns\n    -------\n    is_normalized : bool True if all stamps are normalized\n    ";
-static PyMethodDef __pyx_mdef_6pandas_5_libs_6tslibs_10vectorized_7is_date_array_normalized = {"is_date_array_normalized", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_7is_date_array_normalized, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pandas_5_libs_6tslibs_10vectorized_6is_date_array_normalized};
-static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_7is_date_array_normalized(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  __Pyx_memviewslice __pyx_v_stamps = { 0, 0, { 0 }, { 0 }, { 0 } };
-  PyDateTime_TZInfo *__pyx_v_tz = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("is_date_array_normalized (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stamps,&__pyx_n_s_tz,0};
-    PyObject* values[2] = {0,0};
-    values[1] = (PyObject *)((PyDateTime_TZInfo *)Py_None);
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stamps)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tz);
-          if (value) { values[1] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_date_array_normalized") < 0)) __PYX_ERR(1, 292, __pyx_L3_error)
-      }
-    } else {
-      switch (PyTuple_GET_SIZE(__pyx_args)) {
-        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_stamps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t__const__(values[0], 0); if (unlikely(!__pyx_v_stamps.memview)) __PYX_ERR(1, 292, __pyx_L3_error)
-    __pyx_v_tz = ((PyDateTime_TZInfo *)values[1]);
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("is_date_array_normalized", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 292, __pyx_L3_error)
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.is_date_array_normalized", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tz), __pyx_ptype_7cpython_8datetime_tzinfo, 1, "tz", 0))) __PYX_ERR(1, 292, __pyx_L1_error)
-  __pyx_r = __pyx_pf_6pandas_5_libs_6tslibs_10vectorized_6is_date_array_normalized(__pyx_self, __pyx_v_stamps, __pyx_v_tz);
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6pandas_5_libs_6tslibs_10vectorized_6is_date_array_normalized(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_stamps, PyDateTime_TZInfo *__pyx_v_tz) {
-  struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *__pyx_v_info = 0;
-  __pyx_t_5numpy_int64_t __pyx_v_utc_val;
-  __pyx_t_5numpy_int64_t __pyx_v_local_val;
-  Py_ssize_t __pyx_v_i;
-  Py_ssize_t __pyx_v_n;
-  Py_ssize_t __pyx_v_pos;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("is_date_array_normalized", 0);
-/* … */
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.is_date_array_normalized", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_info);
-  __PYX_XDEC_MEMVIEW(&__pyx_v_stamps, 1);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-/* … */
-  __pyx_tuple__28 = PyTuple_Pack(8, __pyx_n_s_stamps, __pyx_n_s_tz, __pyx_n_s_info, __pyx_n_s_utc_val, __pyx_n_s_local_val, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 292, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__28);
-  __Pyx_GIVEREF(__pyx_tuple__28);
-/* … */
-  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5_libs_6tslibs_10vectorized_7is_date_array_normalized, NULL, __pyx_n_s_pandas__libs_tslibs_vectorized); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 292, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_date_array_normalized, __pyx_t_6) < 0) __PYX_ERR(1, 292, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas__libs_tslibs_vectorized_p, __pyx_n_s_is_date_array_normalized, 292, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(1, 292, __pyx_L1_error)
-
 293:     """
-
 294:     Check if all of the given (nanosecond) timestamps are normalized to
-
 295:     midnight, i.e. hour == minute == second == 0.  If the optional timezone
-
 296:     `tz` is not None, then this is midnight for this timezone.
-
 297: 
-
 298:     Parameters
-
 299:     ----------
-
 300:     stamps : int64 ndarray
-
 301:     tz : tzinfo or None
-
 302: 
-
 303:     Returns
-
 304:     -------
-
 305:     is_normalized : bool True if all stamps are normalized
-
 306:     """
-
 307:     cdef:
-
+308:         Localizer info = Localizer(tz)
-
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pandas_5_libs_6tslibs_10vectorized_Localizer), ((PyObject *)__pyx_v_tz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 308, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_info = ((struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *)__pyx_t_1);
-  __pyx_t_1 = 0;
-
 309:         int64_t utc_val, local_val
-
+310:         Py_ssize_t i, n = stamps.shape[0]
-
  __pyx_v_n = (__pyx_v_stamps.shape[0]);
-
+311:         Py_ssize_t pos = -1  # unused, avoid not-initialized warning
-
  __pyx_v_pos = -1L;
-
 312: 
-
+313:     for i in range(n):
-
  __pyx_t_2 = __pyx_v_n;
-  __pyx_t_3 = __pyx_t_2;
-  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
-    __pyx_v_i = __pyx_t_4;
-
+314:         utc_val = stamps[i]
-
    __pyx_t_5 = __pyx_v_i;
-    __pyx_v_utc_val = (*((__pyx_t_5numpy_int64_t const  *) ( /* dim=0 */ (__pyx_v_stamps.data + __pyx_t_5 * __pyx_v_stamps.strides[0]) )));
-
 315: 
-
+316:         local_val = info.utc_val_to_local_val(utc_val, &pos)
-
    __pyx_v_local_val = __pyx_f_6pandas_5_libs_6tslibs_10vectorized_9Localizer_utc_val_to_local_val(__pyx_v_info, __pyx_v_utc_val, (&__pyx_v_pos));
-
 317: 
-
+318:         if local_val % DAY_NANOS != 0:
-
    if (unlikely(__pyx_v_6pandas_5_libs_6tslibs_9ccalendar_DAY_NANOS == 0)) {
-      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
-      __PYX_ERR(1, 318, __pyx_L1_error)
-    }
-    __pyx_t_6 = ((__Pyx_mod___pyx_t_5numpy_int64_t(__pyx_v_local_val, __pyx_v_6pandas_5_libs_6tslibs_9ccalendar_DAY_NANOS) != 0) != 0);
-    if (__pyx_t_6) {
-/* … */
-    }
-  }
-
+319:             return False
-
      __Pyx_XDECREF(__pyx_r);
-      __Pyx_INCREF(Py_False);
-      __pyx_r = Py_False;
-      goto __pyx_L0;
-
 320: 
-
+321:     return True
-
  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(Py_True);
-  __pyx_r = Py_True;
-  goto __pyx_L0;
-
 322: 
-
 323: 
-
 324: # -------------------------------------------------------------------------
-
 325: 
-
 326: 
-
 327: @cython.wraparound(False)
-
 328: @cython.boundscheck(False)
-
+329: def dt64arr_to_periodarr(ndarray stamps, int freq, tzinfo tz):
-
/* Python wrapper */
-static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_9dt64arr_to_periodarr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_6pandas_5_libs_6tslibs_10vectorized_9dt64arr_to_periodarr = {"dt64arr_to_periodarr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_9dt64arr_to_periodarr, METH_VARARGS|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_6pandas_5_libs_6tslibs_10vectorized_9dt64arr_to_periodarr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyArrayObject *__pyx_v_stamps = 0;
-  int __pyx_v_freq;
-  PyDateTime_TZInfo *__pyx_v_tz = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("dt64arr_to_periodarr (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stamps,&__pyx_n_s_freq,&__pyx_n_s_tz,0};
-    PyObject* values[3] = {0,0,0};
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
-        CYTHON_FALLTHROUGH;
-        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-        CYTHON_FALLTHROUGH;
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        CYTHON_FALLTHROUGH;
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stamps)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        CYTHON_FALLTHROUGH;
-        case  1:
-        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_freq)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("dt64arr_to_periodarr", 1, 3, 3, 1); __PYX_ERR(1, 329, __pyx_L3_error)
-        }
-        CYTHON_FALLTHROUGH;
-        case  2:
-        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tz)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("dt64arr_to_periodarr", 1, 3, 3, 2); __PYX_ERR(1, 329, __pyx_L3_error)
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dt64arr_to_periodarr") < 0)) __PYX_ERR(1, 329, __pyx_L3_error)
-      }
-    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
-    }
-    __pyx_v_stamps = ((PyArrayObject *)values[0]);
-    __pyx_v_freq = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_freq == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 329, __pyx_L3_error)
-    __pyx_v_tz = ((PyDateTime_TZInfo *)values[2]);
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("dt64arr_to_periodarr", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 329, __pyx_L3_error)
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.dt64arr_to_periodarr", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stamps), __pyx_ptype_5numpy_ndarray, 1, "stamps", 0))) __PYX_ERR(1, 329, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tz), __pyx_ptype_7cpython_8datetime_tzinfo, 1, "tz", 0))) __PYX_ERR(1, 329, __pyx_L1_error)
-  __pyx_r = __pyx_pf_6pandas_5_libs_6tslibs_10vectorized_8dt64arr_to_periodarr(__pyx_self, __pyx_v_stamps, __pyx_v_freq, __pyx_v_tz);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6pandas_5_libs_6tslibs_10vectorized_8dt64arr_to_periodarr(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_stamps, int __pyx_v_freq, PyDateTime_TZInfo *__pyx_v_tz) {
-  struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *__pyx_v_info = 0;
-  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
-  Py_ssize_t __pyx_v_n;
-  Py_ssize_t __pyx_v_pos;
-  __pyx_t_5numpy_int64_t __pyx_v_utc_val;
-  __pyx_t_5numpy_int64_t __pyx_v_local_val;
-  __pyx_t_5numpy_int64_t __pyx_v_res_val;
-  npy_datetimestruct __pyx_v_dts;
-  PyArrayObject *__pyx_v_result = 0;
-  PyArrayMultiIterObject *__pyx_v_mi = 0;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("dt64arr_to_periodarr", 0);
-/* … */
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pandas._libs.tslibs.vectorized.dt64arr_to_periodarr", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_info);
-  __Pyx_XDECREF((PyObject *)__pyx_v_result);
-  __Pyx_XDECREF((PyObject *)__pyx_v_mi);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-/* … */
-  __pyx_tuple__30 = PyTuple_Pack(13, __pyx_n_s_stamps, __pyx_n_s_freq, __pyx_n_s_tz, __pyx_n_s_info, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_pos, __pyx_n_s_utc_val, __pyx_n_s_local_val, __pyx_n_s_res_val, __pyx_n_s_dts, __pyx_n_s_result, __pyx_n_s_mi); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 329, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__30);
-  __Pyx_GIVEREF(__pyx_tuple__30);
-/* … */
-  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_6pandas_5_libs_6tslibs_10vectorized_9dt64arr_to_periodarr, NULL, __pyx_n_s_pandas__libs_tslibs_vectorized); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 329, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dt64arr_to_periodarr, __pyx_t_6) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pandas__libs_tslibs_vectorized_p, __pyx_n_s_dt64arr_to_periodarr, 329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(1, 329, __pyx_L1_error)
-
 330:     # stamps is int64_t, arbitrary ndim
-
 331:     cdef:
-
+332:         Localizer info = Localizer(tz)
-
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pandas_5_libs_6tslibs_10vectorized_Localizer), ((PyObject *)__pyx_v_tz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 332, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_info = ((struct __pyx_obj_6pandas_5_libs_6tslibs_10vectorized_Localizer *)__pyx_t_1);
-  __pyx_t_1 = 0;
-
+333:         Py_ssize_t i, n = stamps.size
-
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_stamps), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 333, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 333, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_n = __pyx_t_2;
-
+334:         Py_ssize_t pos = -1  # unused, avoid not-initialized warning
-
  __pyx_v_pos = -1L;
-
 335:         int64_t utc_val, local_val, res_val
-
 336: 
-
 337:         npy_datetimestruct dts
-
+338:         ndarray result = cnp.PyArray_EMPTY(stamps.ndim, stamps.shape, cnp.NPY_INT64, 0)
-
  __pyx_t_1 = PyArray_EMPTY(__pyx_v_stamps->nd, __pyx_v_stamps->dimensions, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 338, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 338, __pyx_L1_error)
-  __pyx_v_result = ((PyArrayObject *)__pyx_t_1);
-  __pyx_t_1 = 0;
-
+339:         cnp.broadcast mi = cnp.PyArray_MultiIterNew2(result, stamps)
-
  __pyx_t_1 = __pyx_f_5numpy_PyArray_MultiIterNew2(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_v_stamps)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 339, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_broadcast))))) __PYX_ERR(1, 339, __pyx_L1_error)
-  __pyx_v_mi = ((PyArrayMultiIterObject *)__pyx_t_1);
-  __pyx_t_1 = 0;
-
 340: 
-
+341:     for i in range(n):
-
  __pyx_t_2 = __pyx_v_n;
-  __pyx_t_3 = __pyx_t_2;
-  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
-    __pyx_v_i = __pyx_t_4;
-
 342:         # Analogous to: utc_val = stamps[i]
-
+343:         utc_val = (<int64_t*>cnp.PyArray_MultiIter_DATA(mi, 1))[0]
-
    __pyx_v_utc_val = (((__pyx_t_5numpy_int64_t *)PyArray_MultiIter_DATA(__pyx_v_mi, 1))[0]);
-
 344: 
-
+345:         if utc_val == NPY_NAT:
-
    __pyx_t_5 = ((__pyx_v_utc_val == __pyx_v_6pandas_5_libs_6tslibs_7nattype_NPY_NAT) != 0);
-    if (__pyx_t_5) {
-/* … */
-      goto __pyx_L5;
-    }
-
+346:             res_val = NPY_NAT
-
      __pyx_v_res_val = __pyx_v_6pandas_5_libs_6tslibs_7nattype_NPY_NAT;
-
 347:         else:
-
+348:             local_val = info.utc_val_to_local_val(utc_val, &pos)
-
    /*else*/ {
-      __pyx_v_local_val = __pyx_f_6pandas_5_libs_6tslibs_10vectorized_9Localizer_utc_val_to_local_val(__pyx_v_info, __pyx_v_utc_val, (&__pyx_v_pos));
-
+349:             dt64_to_dtstruct(local_val, &dts)
-
      __pyx_f_6pandas_5_libs_6tslibs_11np_datetime_dt64_to_dtstruct(__pyx_v_local_val, (&__pyx_v_dts));
-
+350:             res_val = get_period_ordinal(&dts, freq)
-
      __pyx_v_res_val = __pyx_f_6pandas_5_libs_6tslibs_6period_get_period_ordinal((&__pyx_v_dts), __pyx_v_freq);
-    }
-    __pyx_L5:;
-
 351: 
-
 352:         # Analogous to: result[i] = res_val
-
+353:         (<int64_t*>cnp.PyArray_MultiIter_DATA(mi, 0))[0] = res_val
-
    (((__pyx_t_5numpy_int64_t *)PyArray_MultiIter_DATA(__pyx_v_mi, 0))[0]) = __pyx_v_res_val;
-
 354: 
-
+355:         cnp.PyArray_MultiIter_NEXT(mi)
-
    PyArray_MultiIter_NEXT(__pyx_v_mi);
-  }
-
 356: 
-
+357:     return result
-
  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_result));
-  __pyx_r = ((PyObject *)__pyx_v_result);
-  goto __pyx_L0;
-
From 69a4ae215b28bbcf6a4ea24207a2dbeb88cd3e33 Mon Sep 17 00:00:00 2001 From: Brock Date: Tue, 26 Apr 2022 06:50:04 -0700 Subject: [PATCH 7/7] post-merge fixup --- pandas/_libs/tslibs/vectorized.pyx | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandas/_libs/tslibs/vectorized.pyx b/pandas/_libs/tslibs/vectorized.pyx index 19bc0498dec0a..6b78100705a93 100644 --- a/pandas/_libs/tslibs/vectorized.pyx +++ b/pandas/_libs/tslibs/vectorized.pyx @@ -105,8 +105,6 @@ cdef class Localizer: pos[0] = bisect_right_i8(self.tdata, utc_val, self.ntrans) - 1 return utc_val + self.deltas[pos[0]] - self.tdata = cnp.PyArray_DATA(self.trans) - @cython.boundscheck(False) @cython.wraparound(False)