Cython: _windowtemplate.pxi

Generated by Cython 3.1.8

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: _windowtemplate.pxi

     001: """

     002: Template for AdjustedArray windowed iterators.

     003:

     004: This file is intended to be used by inserting it via a Cython include into a

     005: file that's defined a type symbol named `databuffer` that can be used like a

     006: 2-D numpy array.

     007:

     008: See Also

     009: --------

     010: zipline.lib._floatwindow

     011: zipline.lib._intwindow

     012: zipline.lib._datewindow

     013: """

     014: from numpy cimport ndarray

    +015: from numpy import asanyarray, dtype, issubdtype

      __pyx_t_5 = __Pyx_PyList_Pack(3, __pyx_mstate_global->__pyx_n_u_asanyarray, __pyx_mstate_global->__pyx_n_u_dtype, __pyx_mstate_global->__pyx_n_u_issubdtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy, __pyx_t_5, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_asanyarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_asanyarray, __pyx_t_5) < (0)) __PYX_ERR(1, 15, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_5) < (0)) __PYX_ERR(1, 15, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_issubdtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_issubdtype, __pyx_t_5) < (0)) __PYX_ERR(1, 15, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

     016:

     017:

    +018: class Exhausted(Exception):

      __pyx_t_4 = PyTuple_Pack(1, ((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 18, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 18, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 18, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_Exhausted, __pyx_mstate_global->__pyx_n_u_Exhausted, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_zipline_lib__uint8window, (PyObject *) NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 18, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_5 != __pyx_t_4) {
        if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(1, 18, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_Exhausted, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 18, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Exhausted, __pyx_t_4) < (0)) __PYX_ERR(1, 18, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

     019:     pass

     020:

     021:

    +022: cdef class AdjustedArrayWindow:

    struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow {
      PyObject_HEAD
      struct __pyx_vtabstruct_7zipline_3lib_12_uint8window_AdjustedArrayWindow *__pyx_vtab;
      __pyx_t_7zipline_3lib_12_uint8window_databuffer data;
      PyObject *view_kwargs;
      Py_ssize_t window_length;
      Py_ssize_t anchor;
      Py_ssize_t max_anchor;
      Py_ssize_t next_adj;
      Py_ssize_t perspective_offset;
      PyObject *rounding_places;
      PyObject *adjustments;
      PyObject *adjustment_indices;
      PyArrayObject *output;
    };
    /* … */
    struct __pyx_vtabstruct_7zipline_3lib_12_uint8window_AdjustedArrayWindow {
      PyObject *(*pop_next_adj)(struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *);
      PyObject *(*_tick_forward)(struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *, int);
      PyObject *(*_update_output)(struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *);
    };
    static struct __pyx_vtabstruct_7zipline_3lib_12_uint8window_AdjustedArrayWindow *__pyx_vtabptr_7zipline_3lib_12_uint8window_AdjustedArrayWindow;
    static CYTHON_INLINE PyObject *__pyx_f_7zipline_3lib_12_uint8window_19AdjustedArrayWindow__tick_forward(struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *, int);
    static CYTHON_INLINE PyObject *__pyx_f_7zipline_3lib_12_uint8window_19AdjustedArrayWindow__update_output(struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *);

     023:     """

     024:     An iterator representing a moving view over an AdjustedArray.

     025:

     026:     Concrete subtypes should subclass this and provide a `data` attribute for

     027:     specific types.

     028:

     029:     This object stores a copy of the data from the AdjustedArray over which

     030:     it's iterating.  At each step in the iteration, it mutates its copy to

     031:     allow us to show different data when looking back over the array.

     032:

     033:     The arrays yielded by this iterator are always views over the underlying

     034:     data.

     035:

     036:     The `rounding_places` attribute is an integer used to specify the number of

     037:     decimal places to which the data should be rounded, given that the data is

     038:     of dtype float. If `rounding_places` is None, no rounding occurs.

     039:     """

     040:     cdef:

     041:         # ctype must be defined by the file into which this is being copied.

    +042:         readonly databuffer data

    /* Python wrapper */
    static PyObject *__pyx_pw_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_4data_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_4data_1__get__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_4data___get__(((struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *)__pyx_v_self));

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

    static PyObject *__pyx_pf_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_4data___get__(struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarationsFunc
      __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43]))
      __Pyx_TraceStartFunc("__get__", __pyx_f[1], 42, 0, 0, 0, __PYX_ERR(1, 42, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 42, __pyx_L1_error)}
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->data, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 42, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 42, __pyx_L1_error));
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_TraceException(__pyx_lineno, 0, 0);
      #if CYTHON_USE_SYS_MONITORING
      __Pyx_TraceExceptionUnwind(0, 0);
      #else
      __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 42, __pyx_L1_error));
      #endif
      __Pyx_AddTraceback("zipline.lib._uint8window.AdjustedArrayWindow.data.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_PyMonitoring_ExitScope(0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +043:         readonly dict view_kwargs

    /* Python wrapper */
    static PyObject *__pyx_pw_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_11view_kwargs_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_11view_kwargs_1__get__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_11view_kwargs___get__(((struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *)__pyx_v_self));

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

    static PyObject *__pyx_pf_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_11view_kwargs___get__(struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarationsFunc
      __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44]))
      __Pyx_TraceStartFunc("__get__", __pyx_f[1], 43, 0, 0, 0, __PYX_ERR(1, 43, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->view_kwargs);
      __pyx_r = __pyx_v_self->view_kwargs;
      __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 43, __pyx_L1_error));
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_TraceException(__pyx_lineno, 0, 0);
      #if CYTHON_USE_SYS_MONITORING
      __Pyx_TraceExceptionUnwind(0, 0);
      #else
      __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 43, __pyx_L1_error));
      #endif
      __Pyx_AddTraceback("zipline.lib._uint8window.AdjustedArrayWindow.view_kwargs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_PyMonitoring_ExitScope(0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +044:         readonly Py_ssize_t window_length

    /* Python wrapper */
    static PyObject *__pyx_pw_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_13window_length_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_13window_length_1__get__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_13window_length___get__(((struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *)__pyx_v_self));

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

    static PyObject *__pyx_pf_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_13window_length___get__(struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarationsFunc
      __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45]))
      __Pyx_TraceStartFunc("__get__", __pyx_f[1], 44, 0, 0, 0, __PYX_ERR(1, 44, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->window_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 44, __pyx_L1_error));
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_TraceException(__pyx_lineno, 0, 0);
      #if CYTHON_USE_SYS_MONITORING
      __Pyx_TraceExceptionUnwind(0, 0);
      #else
      __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 44, __pyx_L1_error));
      #endif
      __Pyx_AddTraceback("zipline.lib._uint8window.AdjustedArrayWindow.window_length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_PyMonitoring_ExitScope(0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     045:         Py_ssize_t anchor, max_anchor, next_adj

     046:         Py_ssize_t perspective_offset

     047:         object rounding_places

     048:         dict adjustments

     049:         list adjustment_indices

     050:         ndarray output

     051:

    +052:     def __cinit__(self,

    /* Python wrapper */
    static int __pyx_pw_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static int __pyx_pw_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __pyx_t_7zipline_3lib_12_uint8window_databuffer __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_view_kwargs = 0;
      PyObject *__pyx_v_adjustments = 0;
      Py_ssize_t __pyx_v_offset;
      Py_ssize_t __pyx_v_window_length;
      Py_ssize_t __pyx_v_perspective_offset;
      PyObject *__pyx_v_rounding_places = 0;
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
      #endif
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      {
        PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_view_kwargs,&__pyx_mstate_global->__pyx_n_u_adjustments,&__pyx_mstate_global->__pyx_n_u_offset,&__pyx_mstate_global->__pyx_n_u_window_length,&__pyx_mstate_global->__pyx_n_u_perspective_offset,&__pyx_mstate_global->__pyx_n_u_rounding_places,0};
      PyObject* values[7] = {0,0,0,0,0,0,0};
        const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
        if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 52, __pyx_L3_error)
        if (__pyx_kwds_len > 0) {
          switch (__pyx_nargs) {
            case  7:
            values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(1, 52, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  6:
            values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 52, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  5:
            values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 52, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  4:
            values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 52, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  3:
            values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 52, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  2:
            values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 52, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 52, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          const Py_ssize_t kwd_pos_args = __pyx_nargs;
          if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(1, 52, __pyx_L3_error)
          for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
            if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, i); __PYX_ERR(1, 52, __pyx_L3_error) }
          }
        } else if (unlikely(__pyx_nargs != 7)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 52, __pyx_L3_error)
          values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 52, __pyx_L3_error)
          values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 52, __pyx_L3_error)
          values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 52, __pyx_L3_error)
          values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 52, __pyx_L3_error)
          values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 52, __pyx_L3_error)
          values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(1, 52, __pyx_L3_error)
        }
        __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(1, 53, __pyx_L3_error)
        __pyx_v_view_kwargs = ((PyObject*)values[1]);
        __pyx_v_adjustments = ((PyObject*)values[2]);
        __pyx_v_offset = __Pyx_PyIndex_AsSsize_t(values[3]); if (unlikely((__pyx_v_offset == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 56, __pyx_L3_error)
        __pyx_v_window_length = __Pyx_PyIndex_AsSsize_t(values[4]); if (unlikely((__pyx_v_window_length == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 57, __pyx_L3_error)
        __pyx_v_perspective_offset = __Pyx_PyIndex_AsSsize_t(values[5]); if (unlikely((__pyx_v_perspective_offset == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 58, __pyx_L3_error)
        __pyx_v_rounding_places = values[6];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, __pyx_nargs); __PYX_ERR(1, 52, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __PYX_XCLEAR_MEMVIEW(&__pyx_v_data, 1);
      __Pyx_AddTraceback("zipline.lib._uint8window.AdjustedArrayWindow.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return -1;
      __pyx_L4_argument_unpacking_done:;
      if (unlikely(((PyObject *)__pyx_v_data.memview) == Py_None)) {
        PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "data"); __PYX_ERR(1, 53, __pyx_L1_error)
      }
      if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_view_kwargs), (&PyDict_Type), 0, "view_kwargs", 1))) __PYX_ERR(1, 54, __pyx_L1_error)
      if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_adjustments), (&PyDict_Type), 0, "adjustments", 1))) __PYX_ERR(1, 55, __pyx_L1_error)
      __pyx_r = __pyx_pf_7zipline_3lib_12_uint8window_19AdjustedArrayWindow___cinit__(((struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *)__pyx_v_self), __pyx_v_data, __pyx_v_view_kwargs, __pyx_v_adjustments, __pyx_v_offset, __pyx_v_window_length, __pyx_v_perspective_offset, __pyx_v_rounding_places);
      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;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      goto __pyx_L7_cleaned_up;
      __pyx_L0:;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __pyx_L7_cleaned_up:;
      __PYX_XCLEAR_MEMVIEW(&__pyx_v_data, 1);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_7zipline_3lib_12_uint8window_19AdjustedArrayWindow___cinit__(struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *__pyx_v_self, __pyx_t_7zipline_3lib_12_uint8window_databuffer __pyx_v_data, PyObject *__pyx_v_view_kwargs, PyObject *__pyx_v_adjustments, Py_ssize_t __pyx_v_offset, Py_ssize_t __pyx_v_window_length, Py_ssize_t __pyx_v_perspective_offset, PyObject *__pyx_v_rounding_places) {
      int __pyx_r;
      __Pyx_TraceDeclarationsFunc
      __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35]))
      __Pyx_TraceStartFunc("__cinit__", __pyx_f[1], 52, 0, 0, 0, __PYX_ERR(1, 52, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_r = 0;
      __Pyx_TraceReturnCValue(__pyx_r, __Pyx_Owned_Py_None, 0, 0, __PYX_ERR(1, 52, __pyx_L1_error));
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_TraceException(__pyx_lineno, 0, 0);
      #if CYTHON_USE_SYS_MONITORING
      __Pyx_TraceExceptionUnwind(0, 0);
      #else
      __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 52, __pyx_L1_error));
      #endif
      __Pyx_AddTraceback("zipline.lib._uint8window.AdjustedArrayWindow.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = -1;
      __pyx_L0:;
      __Pyx_PyMonitoring_ExitScope(0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     053:                   databuffer data not None,

     054:                   dict view_kwargs not None,

     055:                   dict adjustments not None,

     056:                   Py_ssize_t offset,

     057:                   Py_ssize_t window_length,

     058:                   Py_ssize_t perspective_offset,

     059:                   object rounding_places):

    +060:         self.data = data

      __PYX_XCLEAR_MEMVIEW(&__pyx_v_self->data, 0);
      __PYX_INC_MEMVIEW(&__pyx_v_data, 1);
      __pyx_v_self->data = __pyx_v_data;

    +061:         self.view_kwargs = view_kwargs

      __Pyx_INCREF(__pyx_v_view_kwargs);
      __Pyx_GIVEREF(__pyx_v_view_kwargs);
      __Pyx_GOTREF(__pyx_v_self->view_kwargs);
      __Pyx_DECREF(__pyx_v_self->view_kwargs);
      __pyx_v_self->view_kwargs = __pyx_v_view_kwargs;

    +062:         self.adjustments = adjustments

      __Pyx_INCREF(__pyx_v_adjustments);
      __Pyx_GIVEREF(__pyx_v_adjustments);
      __Pyx_GOTREF(__pyx_v_self->adjustments);
      __Pyx_DECREF(__pyx_v_self->adjustments);
      __pyx_v_self->adjustments = __pyx_v_adjustments;

    +063:         self.adjustment_indices = sorted(adjustments, reverse=True)

      __pyx_t_2 = NULL;
      __Pyx_INCREF(__pyx_builtin_sorted);
      __pyx_t_3 = __pyx_builtin_sorted;
      __pyx_t_4 = 1;
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_v_adjustments};
        __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 63, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_reverse, Py_True, __pyx_t_5, __pyx_callargs+2, 0) < (0)) __PYX_ERR(1, 63, __pyx_L1_error)
        __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(1, 63, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_self->adjustment_indices);
      __Pyx_DECREF(__pyx_v_self->adjustment_indices);
      __pyx_v_self->adjustment_indices = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

    +064:         self.window_length = window_length

      __pyx_v_self->window_length = __pyx_v_window_length;

    +065:         self.anchor = window_length + offset - 1

      __pyx_v_self->anchor = ((__pyx_v_window_length + __pyx_v_offset) - 1);

    +066:         if perspective_offset > 1:

      __pyx_t_6 = (__pyx_v_perspective_offset > 1);
      if (unlikely(__pyx_t_6)) {
    /* … */
      }

     067:             # Limit perspective_offset to 1.

     068:             # To support an offset greater than 1, work must be done to

     069:             # ensure that adjustments are retrieved for the datetimes between

     070:             # the end of the window and the vantage point defined by the

     071:             # perspective offset.

    +072:             raise Exception("perspective_offset should not exceed 1, value "

        __pyx_t_3 = NULL;
        __Pyx_INCREF((PyObject *)(((PyTypeObject*)PyExc_Exception)));
        __pyx_t_5 = ((PyObject *)(((PyTypeObject*)PyExc_Exception)));

    +073:                             "is perspective_offset={0}".format(

        __pyx_t_7 = __pyx_mstate_global->__pyx_kp_u_perspective_offset_should_not_ex;
        __Pyx_INCREF(__pyx_t_7);

    +074:                                 perspective_offset))

        __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_perspective_offset); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 74, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_4 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 72, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(1, 72, __pyx_L1_error)

    +075:         self.perspective_offset = perspective_offset

      __pyx_v_self->perspective_offset = __pyx_v_perspective_offset;

    +076:         self.rounding_places = rounding_places

      __Pyx_INCREF(__pyx_v_rounding_places);
      __Pyx_GIVEREF(__pyx_v_rounding_places);
      __Pyx_GOTREF(__pyx_v_self->rounding_places);
      __Pyx_DECREF(__pyx_v_self->rounding_places);
      __pyx_v_self->rounding_places = __pyx_v_rounding_places;

    +077:         self.max_anchor = data.shape[0]

      __pyx_v_self->max_anchor = (__pyx_v_data.shape[0]);

     078:

    +079:         self.next_adj = self.pop_next_adj()

      __pyx_t_1 = ((struct __pyx_vtabstruct_7zipline_3lib_12_uint8window_AdjustedArrayWindow *)__pyx_v_self->__pyx_vtab)->pop_next_adj(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 79, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 79, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_self->next_adj = __pyx_t_9;

    +080:         self.output = None

      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF((PyObject *)__pyx_v_self->output);
      __Pyx_DECREF((PyObject *)__pyx_v_self->output);
      __pyx_v_self->output = ((PyArrayObject *)Py_None);

     081:

    +082:     cdef pop_next_adj(self):

    static PyObject *__pyx_f_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_pop_next_adj(struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarationsFunc
      __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36]))
      __Pyx_TraceStartFunc("pop_next_adj", __pyx_f[1], 82, 0, 0, 0, __PYX_ERR(1, 82, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_TraceException(__pyx_lineno, 0, 0);
      #if CYTHON_USE_SYS_MONITORING
      __Pyx_TraceExceptionUnwind(0, 0);
      #else
      __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 82, __pyx_L1_error));
      #endif
      __Pyx_AddTraceback("zipline.lib._uint8window.AdjustedArrayWindow.pop_next_adj", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_PyMonitoring_ExitScope(0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     083:         """

     084:         Pop the index of the next adjustment to apply from self.adjustment_indices.

     085:         """

    +086:         if len(self.adjustment_indices) > 0:

      __pyx_t_1 = __pyx_v_self->adjustment_indices;
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_t_1 == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(1, 86, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 86, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_3 = (__pyx_t_2 > 0);
      if (__pyx_t_3) {
    /* … */
      }

    +087:             return self.adjustment_indices.pop()

        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_self->adjustment_indices == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
          __PYX_ERR(1, 87, __pyx_L1_error)
        }
        __pyx_t_1 = __Pyx_PyList_Pop(__pyx_v_self->adjustment_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 87, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        __Pyx_TraceReturnValue(__pyx_r, 8, 0, __PYX_ERR(1, 87, __pyx_L1_error));
        goto __pyx_L0;

     088:         else:

    +089:             return self.max_anchor + self.perspective_offset

      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_1 = PyLong_FromSsize_t((__pyx_v_self->max_anchor + __pyx_v_self->perspective_offset)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 89, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        __Pyx_TraceReturnValue(__pyx_r, 13, 0, __PYX_ERR(1, 89, __pyx_L1_error));
        goto __pyx_L0;
      }

     090:

    +091:     def __iter__(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_3__iter__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_3__iter__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_2__iter__(((struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *)__pyx_v_self));

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

    static PyObject *__pyx_pf_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_2__iter__(struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarationsFunc
      __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37]))
      __Pyx_TraceStartFunc("__iter__", __pyx_f[1], 91, 0, 0, 0, __PYX_ERR(1, 91, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_TraceException(__pyx_lineno, 0, 0);
      #if CYTHON_USE_SYS_MONITORING
      __Pyx_TraceExceptionUnwind(0, 0);
      #else
      __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 91, __pyx_L1_error));
      #endif
      __Pyx_AddTraceback("zipline.lib._uint8window.AdjustedArrayWindow.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_PyMonitoring_ExitScope(0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +092:         return self

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __pyx_r = ((PyObject *)__pyx_v_self);
      __Pyx_TraceReturnValue(__pyx_r, 1, 0, __PYX_ERR(1, 92, __pyx_L1_error));
      goto __pyx_L0;

     093:

    +094:     def __next__(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_5__next__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_5__next__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_4__next__(((struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *)__pyx_v_self));

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

    static PyObject *__pyx_pf_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_4__next__(struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarationsFunc
      __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38]))
      __Pyx_TraceStartFunc("__next__", __pyx_f[1], 94, 0, 0, 0, __PYX_ERR(1, 94, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_TraceException(__pyx_lineno, 0, 0);
      #if CYTHON_USE_SYS_MONITORING
      __Pyx_TraceExceptionUnwind(0, 0);
      #else
      __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 94, __pyx_L1_error));
      #endif
      if (!__pyx_error_without_exception) {
        __Pyx_AddTraceback("zipline.lib._uint8window.AdjustedArrayWindow.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      }
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_PyMonitoring_ExitScope(0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +095:         try:

      {
        /*try:*/ {
    /* … */
        }
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L8_try_end;
        __pyx_L3_error:;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_TraceException(__pyx_lineno, 0, 0);
    /* … */
        __pyx_L5_except_error:;
        __Pyx_XGIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
        goto __pyx_L1_error;
        __pyx_L8_try_end:;
      }

    +096:             self._tick_forward(1)

          __pyx_t_4 = __pyx_f_7zipline_3lib_12_uint8window_19AdjustedArrayWindow__tick_forward(__pyx_v_self, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 96, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +097:         except Exhausted:

        __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Exhausted); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 97, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_7);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_ErrRestore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
        if (__pyx_t_8) {
          __Pyx_AddTraceback("zipline.lib._uint8window.AdjustedArrayWindow.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          __Pyx_TraceExceptionHandled(0);
          if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(1, 97, __pyx_L5_except_error)
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_TraceExceptionDone();

    +098:             raise StopIteration()

          __pyx_error_without_exception = 1;
          goto __pyx_L5_except_error;;
        }
        goto __pyx_L5_except_error;

     099:

    +100:         self._update_output()

      __pyx_t_4 = __pyx_f_7zipline_3lib_12_uint8window_19AdjustedArrayWindow__update_output(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 100, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +101:         return self.output

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_self->output);
      __pyx_r = ((PyObject *)__pyx_v_self->output);
      __Pyx_TraceReturnValue(__pyx_r, 11, 0, __PYX_ERR(1, 101, __pyx_L1_error));
      goto __pyx_L0;

     102:

    +103:     def seek(self, Py_ssize_t target_anchor):

    /* Python wrapper */
    static PyObject *__pyx_pw_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_7seek(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_7seek = {"seek", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_7seek, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_7seek(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      Py_ssize_t __pyx_v_target_anchor;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("seek (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_target_anchor,0};
      PyObject* values[1] = {0};
        const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
        if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 103, __pyx_L3_error)
        if (__pyx_kwds_len > 0) {
          switch (__pyx_nargs) {
            case  1:
            values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 103, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          const Py_ssize_t kwd_pos_args = __pyx_nargs;
          if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "seek", 0) < (0)) __PYX_ERR(1, 103, __pyx_L3_error)
          for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
            if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("seek", 1, 1, 1, i); __PYX_ERR(1, 103, __pyx_L3_error) }
          }
        } else if (unlikely(__pyx_nargs != 1)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 103, __pyx_L3_error)
        }
        __pyx_v_target_anchor = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_target_anchor == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 103, __pyx_L3_error)
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("seek", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 103, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_AddTraceback("zipline.lib._uint8window.AdjustedArrayWindow.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_6seek(((struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *)__pyx_v_self), __pyx_v_target_anchor);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_6seek(struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *__pyx_v_self, Py_ssize_t __pyx_v_target_anchor) {
      Py_ssize_t __pyx_v_anchor;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarationsFunc
      __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39]))
      __Pyx_TraceStartFunc("seek", __pyx_f[1], 103, 0, 0, 0, __PYX_ERR(1, 103, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_TraceException(__pyx_lineno, 0, 0);
      #if CYTHON_USE_SYS_MONITORING
      __Pyx_TraceExceptionUnwind(0, 0);
      #else
      __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 103, __pyx_L1_error));
      #endif
      __Pyx_AddTraceback("zipline.lib._uint8window.AdjustedArrayWindow.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_PyMonitoring_ExitScope(0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_7seek, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AdjustedArrayWindow_seek, NULL, __pyx_mstate_global->__pyx_n_u_zipline_lib__uint8window, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7zipline_3lib_12_uint8window_AdjustedArrayWindow, __pyx_mstate_global->__pyx_n_u_seek, __pyx_t_5) < (0)) __PYX_ERR(1, 103, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

     104:         cdef:

    +105:             Py_ssize_t anchor = self.anchor

      __pyx_t_1 = __pyx_v_self->anchor;
      __pyx_v_anchor = __pyx_t_1;

     106:

    +107:         if target_anchor < anchor:

      __pyx_t_2 = (__pyx_v_target_anchor < __pyx_v_anchor);
      if (unlikely(__pyx_t_2)) {
    /* … */
      }

    +108:             raise Exception('Can not access data after window has passed.')

        __pyx_t_4 = NULL;
        __Pyx_INCREF((PyObject *)(((PyTypeObject*)PyExc_Exception)));
        __pyx_t_5 = ((PyObject *)(((PyTypeObject*)PyExc_Exception)));
        __pyx_t_6 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Can_not_access_data_after_window};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 108, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(1, 108, __pyx_L1_error)

     109:

    +110:         if target_anchor == anchor:

      __pyx_t_2 = (__pyx_v_target_anchor == __pyx_v_anchor);
      if (__pyx_t_2) {
    /* … */
      }

    +111:             return self.output

        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF((PyObject *)__pyx_v_self->output);
        __pyx_r = ((PyObject *)__pyx_v_self->output);
        __Pyx_TraceReturnValue(__pyx_r, 16, 0, __PYX_ERR(1, 111, __pyx_L1_error));
        goto __pyx_L0;

     112:

    +113:         self._tick_forward(target_anchor - anchor)

      __pyx_t_3 = __pyx_f_7zipline_3lib_12_uint8window_19AdjustedArrayWindow__tick_forward(__pyx_v_self, (__pyx_v_target_anchor - __pyx_v_anchor)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +114:         self._update_output()

      __pyx_t_3 = __pyx_f_7zipline_3lib_12_uint8window_19AdjustedArrayWindow__update_output(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 114, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     115:

    +116:         return self.output

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_self->output);
      __pyx_r = ((PyObject *)__pyx_v_self->output);
      __Pyx_TraceReturnValue(__pyx_r, 28, 0, __PYX_ERR(1, 116, __pyx_L1_error));
      goto __pyx_L0;

     117:

    +118:     cdef inline _tick_forward(self, int N):

    static CYTHON_INLINE PyObject *__pyx_f_7zipline_3lib_12_uint8window_19AdjustedArrayWindow__tick_forward(struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *__pyx_v_self, int __pyx_v_N) {
      PyObject *__pyx_v_adjustment = 0;
      Py_ssize_t __pyx_v_anchor;
      Py_ssize_t __pyx_v_target;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarationsFunc
      __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40]))
      __Pyx_TraceStartFunc("_tick_forward", __pyx_f[1], 118, 0, 0, 0, __PYX_ERR(1, 118, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 118, __pyx_L1_error));
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_TraceException(__pyx_lineno, 0, 0);
      #if CYTHON_USE_SYS_MONITORING
      __Pyx_TraceExceptionUnwind(0, 0);
      #else
      __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 118, __pyx_L1_error));
      #endif
      __Pyx_AddTraceback("zipline.lib._uint8window.AdjustedArrayWindow._tick_forward", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_adjustment);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_PyMonitoring_ExitScope(0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     119:         cdef:

     120:             object adjustment

    +121:             Py_ssize_t anchor = self.anchor

      __pyx_t_1 = __pyx_v_self->anchor;
      __pyx_v_anchor = __pyx_t_1;

    +122:             Py_ssize_t target = anchor + N

      __pyx_v_target = (__pyx_v_anchor + __pyx_v_N);

     123:

    +124:         if target > self.max_anchor:

      __pyx_t_2 = (__pyx_v_target > __pyx_v_self->max_anchor);
      if (unlikely(__pyx_t_2)) {
    /* … */
      }

    +125:             raise Exhausted()

        __pyx_t_4 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Exhausted); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 125, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
          assert(__pyx_t_4);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 125, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(1, 125, __pyx_L1_error)

     126:

     127:         # Apply any adjustments that occured before our current anchor.

     128:         # Equivalently, apply any adjustments known **on or before** the date

     129:         # for which we're calculating a window.

    +130:         while self.next_adj < target + self.perspective_offset:

      while (1) {
        __pyx_t_2 = (__pyx_v_self->next_adj < (__pyx_v_target + __pyx_v_self->perspective_offset));
        if (!__pyx_t_2) break;

     131:

    +132:             for adjustment in self.adjustments[self.next_adj]:

        if (unlikely(__pyx_v_self->adjustments == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(1, 132, __pyx_L1_error)
        }
        __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->next_adj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 132, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_self->adjustments, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 132, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
          __pyx_t_3 = __pyx_t_5; __Pyx_INCREF(__pyx_t_3);
          __pyx_t_1 = 0;
          __pyx_t_7 = NULL;
        } else {
          __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 132, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 132, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        for (;;) {
          if (likely(!__pyx_t_7)) {
            if (likely(PyList_CheckExact(__pyx_t_3))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 132, __pyx_L1_error)
                #endif
                if (__pyx_t_1 >= __pyx_temp) break;
              }
              __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_1);
              ++__pyx_t_1;
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 132, __pyx_L1_error)
                #endif
                if (__pyx_t_1 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1));
              #else
              __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_1);
              #endif
              ++__pyx_t_1;
            }
            if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 132, __pyx_L1_error)
          } else {
            __pyx_t_5 = __pyx_t_7(__pyx_t_3);
            if (unlikely(!__pyx_t_5)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 132, __pyx_L1_error)
                PyErr_Clear();
              }
              break;
            }
          }
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_XDECREF_SET(__pyx_v_adjustment, __pyx_t_5);
          __pyx_t_5 = 0;
    /* … */
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +133:                 adjustment.mutate(self.data)

          __pyx_t_4 = __pyx_v_adjustment;
          __Pyx_INCREF(__pyx_t_4);
          if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 133, __pyx_L1_error)}
          __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_self->data, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 133, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_6 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8};
            __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_mutate, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 133, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

     134:

    +135:             self.next_adj = self.pop_next_adj()

        __pyx_t_3 = ((struct __pyx_vtabstruct_7zipline_3lib_12_uint8window_AdjustedArrayWindow *)__pyx_v_self->__pyx_vtab)->pop_next_adj(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 135, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 135, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_self->next_adj = __pyx_t_1;
      }

     136:

    +137:         self.anchor = target

      __pyx_v_self->anchor = __pyx_v_target;

     138:

    +139:     cdef inline _update_output(self):

    static CYTHON_INLINE PyObject *__pyx_f_7zipline_3lib_12_uint8window_19AdjustedArrayWindow__update_output(struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *__pyx_v_self) {
      PyArrayObject *__pyx_v_new_out = 0;
      Py_ssize_t __pyx_v_anchor;
      PyObject *__pyx_v_view_kwargs = 0;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarationsFunc
      __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41]))
      __Pyx_TraceStartFunc("_update_output", __pyx_f[1], 139, 0, 0, 0, __PYX_ERR(1, 139, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_TraceReturnValue(__pyx_r, 0, 0, __PYX_ERR(1, 139, __pyx_L1_error));
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_12);
      __Pyx_XDECREF(__pyx_t_13);
      __Pyx_TraceException(__pyx_lineno, 0, 0);
      #if CYTHON_USE_SYS_MONITORING
      __Pyx_TraceExceptionUnwind(0, 0);
      #else
      __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 139, __pyx_L1_error));
      #endif
      __Pyx_AddTraceback("zipline.lib._uint8window.AdjustedArrayWindow._update_output", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF((PyObject *)__pyx_v_new_out);
      __Pyx_XDECREF(__pyx_v_view_kwargs);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_PyMonitoring_ExitScope(0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     140:         cdef:

     141:             ndarray new_out

    +142:             Py_ssize_t anchor = self.anchor

      __pyx_t_1 = __pyx_v_self->anchor;
      __pyx_v_anchor = __pyx_t_1;

    +143:             dict view_kwargs = self.view_kwargs

      __pyx_t_2 = __pyx_v_self->view_kwargs;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_v_view_kwargs = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;

     144:

    +145:         new_out = asanyarray(self.data[anchor - self.window_length:anchor])

      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_asanyarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 145, __pyx_L1_error)}
      __pyx_t_5.data = __pyx_v_self->data.data;
      __pyx_t_5.memview = __pyx_v_self->data.memview;
      __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
      __pyx_t_6 = -1;
      if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_self->data.shape[0], __pyx_v_self->data.strides[0], __pyx_v_self->data.suboffsets[0],
        0,
        0,
        &__pyx_t_6,
        (__pyx_v_anchor - __pyx_v_self->window_length),
        __pyx_v_anchor,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(1, 145, __pyx_L1_error)
    }

    __pyx_t_5.shape[1] = __pyx_v_self->data.shape[1];
    __pyx_t_5.strides[1] = __pyx_v_self->data.strides[1];
        __pyx_t_5.suboffsets[1] = -1;

    __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_t_5, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
      __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 145, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 145, __pyx_L1_error)
      __pyx_v_new_out = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;

    +146:         if view_kwargs:

      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_view_kwargs); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(1, 146, __pyx_L1_error)
      if (__pyx_t_9) {
    /* … */
      }

    +147:             new_out = new_out.view(**view_kwargs)

        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_new_out), __pyx_mstate_global->__pyx_n_u_view); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 147, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (unlikely(__pyx_v_view_kwargs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
          __PYX_ERR(1, 147, __pyx_L1_error)
        }
        __pyx_t_4 = PyDict_Copy(__pyx_v_view_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 147, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 147, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 147, __pyx_L1_error)
        __Pyx_DECREF_SET(__pyx_v_new_out, ((PyArrayObject *)__pyx_t_7));
        __pyx_t_7 = 0;

    +148:         if self.rounding_places is not None and \

      __pyx_t_10 = (__pyx_v_self->rounding_places != Py_None);
      if (__pyx_t_10) {
      } else {
        __pyx_t_9 = __pyx_t_10;
        goto __pyx_L5_bool_binop_done;
      }
    /* … */
      if (__pyx_t_9) {
    /* … */
      }

    +149:                 issubdtype(new_out.dtype, dtype('float64')):

      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_issubdtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_new_out), __pyx_mstate_global->__pyx_n_u_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_12 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_dtype); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
        assert(__pyx_t_12);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_mstate_global->__pyx_n_u_float64};
        __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 149, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_11};
        __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 149, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(1, 149, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_9 = __pyx_t_10;
      __pyx_L5_bool_binop_done:;

    +150:             new_out = new_out.round(self.rounding_places)

        __pyx_t_2 = ((PyObject *)__pyx_v_new_out);
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_8 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->rounding_places};
          __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_round, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 150, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 150, __pyx_L1_error)
        __Pyx_DECREF_SET(__pyx_v_new_out, ((PyArrayObject *)__pyx_t_7));
        __pyx_t_7 = 0;

    +151:         new_out.setflags(write=False)

      __pyx_t_2 = ((PyObject *)__pyx_v_new_out);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
        __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 151, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_write, Py_False, __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(1, 151, __pyx_L1_error)
        __pyx_t_7 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_setflags, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 151, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    +152:         self.output = new_out

      __Pyx_INCREF((PyObject *)__pyx_v_new_out);
      __Pyx_GIVEREF((PyObject *)__pyx_v_new_out);
      __Pyx_GOTREF((PyObject *)__pyx_v_self->output);
      __Pyx_DECREF((PyObject *)__pyx_v_self->output);
      __pyx_v_self->output = __pyx_v_new_out;

     153:

    +154:     def __repr__(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_9__repr__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_9__repr__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_8__repr__(((struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *)__pyx_v_self));

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

    static PyObject *__pyx_pf_7zipline_3lib_12_uint8window_19AdjustedArrayWindow_8__repr__(struct __pyx_obj_7zipline_3lib_12_uint8window_AdjustedArrayWindow *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarationsFunc
      __Pyx_TraceFrameInit(((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42]))
      __Pyx_TraceStartFunc("__repr__", __pyx_f[1], 154, 0, 0, 0, __PYX_ERR(1, 154, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_TraceException(__pyx_lineno, 0, 0);
      #if CYTHON_USE_SYS_MONITORING
      __Pyx_TraceExceptionUnwind(0, 0);
      #else
      __Pyx_TraceReturnValue(NULL, 0, 0, __PYX_ERR(1, 154, __pyx_L1_error));
      #endif
      __Pyx_AddTraceback("zipline.lib._uint8window.AdjustedArrayWindow.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_PyMonitoring_ExitScope(0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +155:         return "<%s: window_length=%d, anchor=%d, max_anchor=%d, dtype=%r>" % (

      __Pyx_XDECREF(__pyx_r);
    /* … */
      __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_7, 11, 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 16 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 8 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 155, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      __Pyx_TraceReturnValue(__pyx_r, 1, 0, __PYX_ERR(1, 155, __pyx_L1_error));
      goto __pyx_L0;

    +156:             type(self).__name__,

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +157:             self.window_length,

      __pyx_t_1 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_self->window_length, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

    +158:             self.anchor,

      __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_self->anchor, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);

    +159:             self.max_anchor,

      __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_self->max_anchor, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);

    +160:             self.view_kwargs.get('dtype'),

      if (unlikely(__pyx_v_self->view_kwargs == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
        __PYX_ERR(1, 160, __pyx_L1_error)
      }
      __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->view_kwargs, __pyx_mstate_global->__pyx_n_u_dtype, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u__6;
      __pyx_t_7[1] = __pyx_t_2;
      __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_window_length_2;
      __pyx_t_7[3] = __pyx_t_1;
      __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_anchor;
      __pyx_t_7[5] = __pyx_t_3;
      __pyx_t_7[6] = __pyx_mstate_global->__pyx_kp_u_max_anchor;
      __pyx_t_7[7] = __pyx_t_4;
      __pyx_t_7[8] = __pyx_mstate_global->__pyx_kp_u_dtype_2;
      __pyx_t_7[9] = __pyx_t_6;
      __pyx_t_7[10] = __pyx_mstate_global->__pyx_kp_u__3;

     161:         )