from numpy cimport (
    int64_t,
)
cdef extern from "numpy/ndarraytypes.h":
    ctypedef enum NPY_DATETIMEUNIT:
        NPY_FR_GENERIC
cdef NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil
cdef int64_t convert_reso(
    int64_t value,
    NPY_DATETIMEUNIT from_reso,
    NPY_DATETIMEUNIT to_reso,
    bint round_ok,
) except? -1
