Generated by Cython 3.1.2
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: move_stream.cpp
+001: '''
__pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
002: This file is part of Prolothar-Process-Discovery (More Info: https://github.com/shs-it/prolothar-process-discovery).
003:
004: Prolothar-Process-Discovery is free software: you can redistribute it and/or modify
005: it under the terms of the GNU General Public License as published by
006: the Free Software Foundation, either version 3 of the License, or
007: (at your option) any later version.
008:
009: Prolothar-Process-Discovery is distributed in the hope that it will be useful,
010: but WITHOUT ANY WARRANTY; without even the implied warranty of
011: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: GNU General Public License for more details.
013:
014: You should have received a copy of the GNU General Public License
015: along with Prolothar-Process-Discovery. If not, see <https://www.gnu.org/licenses/>.
016: '''
+017: from typing import Tuple, Dict, List
__pyx_t_2 = __Pyx_PyList_Pack(3, __pyx_mstate_global->__pyx_n_u_Tuple, __pyx_mstate_global->__pyx_n_u_Dict, __pyx_mstate_global->__pyx_n_u_List); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_typing, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Tuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Tuple, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Dict, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_List); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_List, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
018: from prolothar_common cimport mdl_utils
019:
+020: cdef str SYNCHRONOUS_MOVE = 'sync'
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_sync); __Pyx_XGOTREF(__pyx_v_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_SYNCHRONOUS_MOVE); __Pyx_DECREF_SET(__pyx_v_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_SYNCHRONOUS_MOVE, __pyx_mstate_global->__pyx_n_u_sync); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_sync);
+021: cdef str LOG_MOVE = 'log'
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_log); __Pyx_XGOTREF(__pyx_v_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_LOG_MOVE); __Pyx_DECREF_SET(__pyx_v_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_LOG_MOVE, __pyx_mstate_global->__pyx_n_u_log); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_log);
+022: cdef str MODEL_MOVE = 'model'
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_model); __Pyx_XGOTREF(__pyx_v_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MODEL_MOVE); __Pyx_DECREF_SET(__pyx_v_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MODEL_MOVE, __pyx_mstate_global->__pyx_n_u_model); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_model);
023:
+024: cdef class MoveStream():
struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream {
struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *(*copy_counts_only)(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *, int __pyx_skip_dispatch);
PyObject *(*add_log_move)(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_add_log_move *__pyx_optional_args);
PyObject *(*add_model_move)(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_add_model_move *__pyx_optional_args);
PyObject *(*add_synchronous_move)(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_add_synchronous_move *__pyx_optional_args);
PyObject *(*_MoveStream__add_move_code)(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *, PyObject *, PyObject *, int, struct __pyx_opt_args_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream___add_move_code *__pyx_optional_args);
};
static struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_vtabptr_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream;
025: """code stream of the cover that stores codes for model moves, log moves
026: and synchronous moves. model moves are activities in the
027: model that are not observable in the log. a log move is an activity that
028: is observed in the log but not explained by the model. a synchronous move
029: is behavior that is both modeled and observed"""
030:
+031: SYNCHRONOUS_MOVE = 'sync'
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_SYNCHRONOUS_MOVE, __pyx_mstate_global->__pyx_n_u_sync) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
+032: LOG_MOVE = 'log'
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_LOG_MOVE, __pyx_mstate_global->__pyx_n_u_log) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
+033: MODEL_MOVE = 'model'
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_MODEL_MOVE, __pyx_mstate_global->__pyx_n_u_model) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
034:
+035: def __init__(self):
/* Python wrapper */ static int __pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ PyDoc_STRVAR(__pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream___init__, "creates a new, empty move stream"); #if CYTHON_UPDATE_DESCRIPTOR_DOC struct wrapperbase __pyx_wrapperbase_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream___init__; #endif static int __pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (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); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return -1; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;} __pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream___init__(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream___init__(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self) { int __pyx_r; /* … */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
036: """creates a new, empty move stream"""
+037: self.__conditional_counter = {}
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_MoveStream__conditional_counter); __Pyx_DECREF(__pyx_v_self->_MoveStream__conditional_counter); __pyx_v_self->_MoveStream__conditional_counter = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+038: self.__trace_move_codes_cache = {}
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_MoveStream__trace_move_codes_cache); __Pyx_DECREF(__pyx_v_self->_MoveStream__trace_move_codes_cache); __pyx_v_self->_MoveStream__trace_move_codes_cache = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
039:
+040: cpdef MoveStream copy_counts_only(self):
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_3copy_counts_only(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 struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_f_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_copy_counts_only(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self, int __pyx_skip_dispatch) {
struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_copy = 0;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_move_stream_counter = NULL;
struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_r = NULL;
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (
#if !CYTHON_USE_TYPE_SLOTS
unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream &&
__Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
#else
unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
#endif
) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_copy_counts_only); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_3copy_counts_only)) {
__Pyx_XDECREF((PyObject *)__pyx_r);
__pyx_t_3 = NULL;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1;
__pyx_t_5 = 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_5 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
__pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __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_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream))))) __PYX_ERR(0, 40, __pyx_L1_error)
__pyx_r = ((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
__pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
__pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
__pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
}
#endif
}
/* … */
/* 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_AddTraceback("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.copy_counts_only", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_copy);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_move_stream_counter);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_3copy_counts_only(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*/
PyDoc_STRVAR(__pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_2copy_counts_only, "returns a copy of this stream. Only the counts are copied.\n All caches and any other information is not copied\n ");
static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_3copy_counts_only = {"copy_counts_only", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_3copy_counts_only, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_2copy_counts_only};
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_3copy_counts_only(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
) {
#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("copy_counts_only (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);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy_counts_only", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy_counts_only", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_2copy_counts_only(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_2copy_counts_only(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = ((PyObject *)__pyx_f_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_copy_counts_only(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __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("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.copy_counts_only", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_3copy_counts_only, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MoveStream_copy_counts_only, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_copy_counts_only, __pyx_t_3) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
041: """returns a copy of this stream. Only the counts are copied.
042: All caches and any other information is not copied
043: """
+044: cdef MoveStream copy = MoveStream()
__pyx_t_2 = NULL; __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream); __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream); __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); } __pyx_v_copy = ((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_t_1); __pyx_t_1 = 0;
+045: copy.__conditional_counter = {}
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_copy->_MoveStream__conditional_counter); __Pyx_DECREF(__pyx_v_copy->_MoveStream__conditional_counter); __pyx_v_copy->_MoveStream__conditional_counter = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+046: for context, move_stream_counter in self.__conditional_counter.items():
__pyx_t_6 = 0;
if (unlikely(__pyx_v_self->_MoveStream__conditional_counter == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
__PYX_ERR(0, 46, __pyx_L1_error)
}
__pyx_t_4 = __Pyx_dict_iterator(__pyx_v_self->_MoveStream__conditional_counter, 1, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_1);
__pyx_t_1 = __pyx_t_4;
__pyx_t_4 = 0;
while (1) {
__pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_7, &__pyx_t_6, &__pyx_t_4, &__pyx_t_2, NULL, __pyx_t_8);
if (unlikely(__pyx_t_9 == 0)) break;
if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 46, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_context, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_XDECREF_SET(__pyx_v_move_stream_counter, __pyx_t_2);
__pyx_t_2 = 0;
+047: copy.__conditional_counter[context] = dict(move_stream_counter)
__pyx_t_4 = NULL;
__Pyx_INCREF((PyObject *)(&PyDict_Type));
__pyx_t_3 = ((PyObject *)(&PyDict_Type));
__pyx_t_5 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_move_stream_counter};
__pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
if (unlikely(__pyx_v_copy->_MoveStream__conditional_counter == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 47, __pyx_L1_error)
}
if (unlikely((PyDict_SetItem(__pyx_v_copy->_MoveStream__conditional_counter, __pyx_v_context, __pyx_t_2) < 0))) __PYX_ERR(0, 47, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+048: return copy
__Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_copy); __pyx_r = __pyx_v_copy; goto __pyx_L0;
049:
+050: cpdef add_log_move(self, str last_covered_activity, int count = 1,
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_5add_log_move(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 PyObject *__pyx_f_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_add_log_move(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self, PyObject *__pyx_v_last_covered_activity, int __pyx_skip_dispatch, struct __pyx_opt_args_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_add_log_move *__pyx_optional_args) {
int __pyx_v_count = ((int)1);
/* … */
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (
#if !CYTHON_USE_TYPE_SLOTS
unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream &&
__Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
#else
unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
#endif
) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_add_log_move); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_5add_log_move)) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = NULL;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1;
__pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 50, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_add_to_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 50, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = 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_7 = 0;
}
#endif
{
PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_last_covered_activity, __pyx_t_5, __pyx_t_6};
__pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
__pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
__pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
__pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
}
#endif
}
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.add_log_move", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_5add_log_move(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*/
PyDoc_STRVAR(__pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_4add_log_move, "adds the code for a log move to this stream\n\n Args:\n last_covered_activity:\n used to compute the conditional probability of observing\n a log move. can be None at the beginning of a trace\n count:\n default is 1.\n ");
static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_5add_log_move = {"add_log_move", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_5add_log_move, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_4add_log_move};
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_5add_log_move(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
) {
PyObject *__pyx_v_last_covered_activity = 0;
int __pyx_v_count;
int __pyx_v_add_to_cache;
#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("add_log_move (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_last_covered_activity,&__pyx_mstate_global->__pyx_n_u_count,&__pyx_mstate_global->__pyx_n_u_add_to_cache,0};
PyObject* values[3] = {0,0,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 50, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 50, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 50, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 50, __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, "add_log_move", 0) < 0) __PYX_ERR(0, 50, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_log_move", 0, 1, 3, i); __PYX_ERR(0, 50, __pyx_L3_error) }
}
} else {
switch (__pyx_nargs) {
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 50, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 50, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 50, __pyx_L3_error)
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_last_covered_activity = ((PyObject*)values[0]);
if (values[1]) {
__pyx_v_count = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 50, __pyx_L3_error)
} else {
__pyx_v_count = ((int)1);
}
if (values[2]) {
__pyx_v_add_to_cache = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_add_to_cache == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L3_error)
} else {
/* … */
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
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_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_4add_log_move(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self, PyObject *__pyx_v_last_covered_activity, int __pyx_v_count, int __pyx_v_add_to_cache) {
PyObject *__pyx_r = NULL;
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 2;
__pyx_t_2.count = __pyx_v_count;
__pyx_t_2.add_to_cache = __pyx_v_add_to_cache;
__pyx_t_1 = __pyx_vtabptr_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream->add_log_move(__pyx_v_self, __pyx_v_last_covered_activity, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __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("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.add_log_move", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_5add_log_move, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MoveStream_add_log_move, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1]);
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_add_log_move, __pyx_t_3) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* … */
__pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_1, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 50, __pyx_L1_error)
__Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);
+051: bint add_to_cache = True):
int __pyx_v_add_to_cache = ((int)1);
PyObject *__pyx_r = NULL;
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_count = __pyx_optional_args->count;
if (__pyx_optional_args->__pyx_n > 1) {
__pyx_v_add_to_cache = __pyx_optional_args->add_to_cache;
}
}
}
/* … */
__pyx_v_add_to_cache = ((int)1);
}
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("add_log_move", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 50, __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("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.add_log_move", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_last_covered_activity), (&PyUnicode_Type), 1, "last_covered_activity", 1))) __PYX_ERR(0, 50, __pyx_L1_error)
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_4add_log_move(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self), __pyx_v_last_covered_activity, __pyx_v_count, __pyx_v_add_to_cache);
052: """adds the code for a log move to this stream
053:
054: Args:
055: last_covered_activity:
056: used to compute the conditional probability of observing
057: a log move. can be None at the beginning of a trace
058: count:
059: default is 1.
060: """
+061: self.__add_move_code(
__pyx_t_8.__pyx_n = 1; __pyx_t_8.add_to_cache = __pyx_v_add_to_cache; __pyx_t_2 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self->__pyx_vtab)->_MoveStream__add_move_code(__pyx_v_self, __pyx_v_last_covered_activity, ((PyObject*)__pyx_t_1), __pyx_v_count, &__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+062: last_covered_activity, LOG_MOVE, count,
__pyx_t_1 = __pyx_v_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_LOG_MOVE;
__Pyx_INCREF(__pyx_t_1);
063: add_to_cache=add_to_cache)
064:
+065: cpdef add_model_move(self, str last_covered_activity, int count = 1,
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_7add_model_move(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 PyObject *__pyx_f_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_add_model_move(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self, PyObject *__pyx_v_last_covered_activity, int __pyx_skip_dispatch, struct __pyx_opt_args_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_add_model_move *__pyx_optional_args) {
int __pyx_v_count = ((int)1);
/* … */
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (
#if !CYTHON_USE_TYPE_SLOTS
unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream &&
__Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
#else
unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
#endif
) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_add_model_move); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_7add_model_move)) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = NULL;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1;
__pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 65, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_add_to_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 65, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = 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_7 = 0;
}
#endif
{
PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_last_covered_activity, __pyx_t_5, __pyx_t_6};
__pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
__pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
__pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
__pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
}
#endif
}
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.add_model_move", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_7add_model_move(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*/
PyDoc_STRVAR(__pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_6add_model_move, "adds the code for a model move to this stream\n Args:\n last_covered_activity:\n used to compute the conditional probability of observing\n a model move. can be None at the beginning of a trace\n count:\n default is 1.\n ");
static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_7add_model_move = {"add_model_move", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_7add_model_move, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_6add_model_move};
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_7add_model_move(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
) {
PyObject *__pyx_v_last_covered_activity = 0;
int __pyx_v_count;
int __pyx_v_add_to_cache;
#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("add_model_move (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_last_covered_activity,&__pyx_mstate_global->__pyx_n_u_count,&__pyx_mstate_global->__pyx_n_u_add_to_cache,0};
PyObject* values[3] = {0,0,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 65, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 65, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 65, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 65, __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, "add_model_move", 0) < 0) __PYX_ERR(0, 65, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_model_move", 0, 1, 3, i); __PYX_ERR(0, 65, __pyx_L3_error) }
}
} else {
switch (__pyx_nargs) {
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 65, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 65, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 65, __pyx_L3_error)
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_last_covered_activity = ((PyObject*)values[0]);
if (values[1]) {
__pyx_v_count = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error)
} else {
__pyx_v_count = ((int)1);
}
if (values[2]) {
__pyx_v_add_to_cache = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_add_to_cache == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error)
} else {
/* … */
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
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_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_6add_model_move(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self, PyObject *__pyx_v_last_covered_activity, int __pyx_v_count, int __pyx_v_add_to_cache) {
PyObject *__pyx_r = NULL;
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 2;
__pyx_t_2.count = __pyx_v_count;
__pyx_t_2.add_to_cache = __pyx_v_add_to_cache;
__pyx_t_1 = __pyx_vtabptr_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream->add_model_move(__pyx_v_self, __pyx_v_last_covered_activity, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __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("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.add_model_move", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_7add_model_move, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MoveStream_add_model_move, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[2]);
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_add_model_move, __pyx_t_3) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* … */
__pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_1, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 65, __pyx_L1_error)
__Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);
+066: bint add_to_cache = True):
int __pyx_v_add_to_cache = ((int)1);
PyObject *__pyx_r = NULL;
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_count = __pyx_optional_args->count;
if (__pyx_optional_args->__pyx_n > 1) {
__pyx_v_add_to_cache = __pyx_optional_args->add_to_cache;
}
}
}
/* … */
__pyx_v_add_to_cache = ((int)1);
}
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("add_model_move", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 65, __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("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.add_model_move", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_last_covered_activity), (&PyUnicode_Type), 1, "last_covered_activity", 1))) __PYX_ERR(0, 65, __pyx_L1_error)
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_6add_model_move(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self), __pyx_v_last_covered_activity, __pyx_v_count, __pyx_v_add_to_cache);
067: """adds the code for a model move to this stream
068: Args:
069: last_covered_activity:
070: used to compute the conditional probability of observing
071: a model move. can be None at the beginning of a trace
072: count:
073: default is 1.
074: """
+075: self.__add_move_code(
__pyx_t_8.__pyx_n = 1; __pyx_t_8.add_to_cache = __pyx_v_add_to_cache; __pyx_t_2 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self->__pyx_vtab)->_MoveStream__add_move_code(__pyx_v_self, __pyx_v_last_covered_activity, ((PyObject*)__pyx_t_1), __pyx_v_count, &__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+076: last_covered_activity, MODEL_MOVE, count,
__pyx_t_1 = __pyx_v_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MODEL_MOVE;
__Pyx_INCREF(__pyx_t_1);
077: add_to_cache=add_to_cache)
078:
+079: cpdef add_synchronous_move(self, str last_covered_activity, int count = 1,
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_9add_synchronous_move(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 PyObject *__pyx_f_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_add_synchronous_move(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self, PyObject *__pyx_v_last_covered_activity, int __pyx_skip_dispatch, struct __pyx_opt_args_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_add_synchronous_move *__pyx_optional_args) {
int __pyx_v_count = ((int)1);
/* … */
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (
#if !CYTHON_USE_TYPE_SLOTS
unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream &&
__Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
#else
unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
#endif
) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_add_synchronous_move); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_9add_synchronous_move)) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = NULL;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1;
__pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_add_to_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 79, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = 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_7 = 0;
}
#endif
{
PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_last_covered_activity, __pyx_t_5, __pyx_t_6};
__pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
__pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
__pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
__pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
}
#endif
}
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.add_synchronous_move", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_9add_synchronous_move(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*/
PyDoc_STRVAR(__pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_8add_synchronous_move, "adds the code for a synchronous move to this stream\n\n Args:\n last_covered_activity:\n used to compute the conditional probability of observing\n a sync move. can be None at the beginning of a trace\n count:\n default is 1.\n ");
static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_9add_synchronous_move = {"add_synchronous_move", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_9add_synchronous_move, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_8add_synchronous_move};
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_9add_synchronous_move(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
) {
PyObject *__pyx_v_last_covered_activity = 0;
int __pyx_v_count;
int __pyx_v_add_to_cache;
#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("add_synchronous_move (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_last_covered_activity,&__pyx_mstate_global->__pyx_n_u_count,&__pyx_mstate_global->__pyx_n_u_add_to_cache,0};
PyObject* values[3] = {0,0,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 79, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 79, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 79, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 79, __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, "add_synchronous_move", 0) < 0) __PYX_ERR(0, 79, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_synchronous_move", 0, 1, 3, i); __PYX_ERR(0, 79, __pyx_L3_error) }
}
} else {
switch (__pyx_nargs) {
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 79, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 79, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 79, __pyx_L3_error)
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_last_covered_activity = ((PyObject*)values[0]);
if (values[1]) {
__pyx_v_count = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error)
} else {
__pyx_v_count = ((int)1);
}
if (values[2]) {
__pyx_v_add_to_cache = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_add_to_cache == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error)
} else {
/* … */
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
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_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_8add_synchronous_move(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self, PyObject *__pyx_v_last_covered_activity, int __pyx_v_count, int __pyx_v_add_to_cache) {
PyObject *__pyx_r = NULL;
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 2;
__pyx_t_2.count = __pyx_v_count;
__pyx_t_2.add_to_cache = __pyx_v_add_to_cache;
__pyx_t_1 = __pyx_vtabptr_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream->add_synchronous_move(__pyx_v_self, __pyx_v_last_covered_activity, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __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("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.add_synchronous_move", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_9add_synchronous_move, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MoveStream_add_synchronous_move, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[3]);
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_add_synchronous_move, __pyx_t_3) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* … */
__pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_1, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 79, __pyx_L1_error)
__Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);
+080: bint add_to_cache = True):
int __pyx_v_add_to_cache = ((int)1);
PyObject *__pyx_r = NULL;
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_count = __pyx_optional_args->count;
if (__pyx_optional_args->__pyx_n > 1) {
__pyx_v_add_to_cache = __pyx_optional_args->add_to_cache;
}
}
}
/* … */
__pyx_v_add_to_cache = ((int)1);
}
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("add_synchronous_move", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 79, __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("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.add_synchronous_move", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_last_covered_activity), (&PyUnicode_Type), 1, "last_covered_activity", 1))) __PYX_ERR(0, 79, __pyx_L1_error)
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_8add_synchronous_move(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self), __pyx_v_last_covered_activity, __pyx_v_count, __pyx_v_add_to_cache);
081: """adds the code for a synchronous move to this stream
082:
083: Args:
084: last_covered_activity:
085: used to compute the conditional probability of observing
086: a sync move. can be None at the beginning of a trace
087: count:
088: default is 1.
089: """
+090: self.__add_move_code(
__pyx_t_8.__pyx_n = 1; __pyx_t_8.add_to_cache = __pyx_v_add_to_cache; __pyx_t_2 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self->__pyx_vtab)->_MoveStream__add_move_code(__pyx_v_self, __pyx_v_last_covered_activity, ((PyObject*)__pyx_t_1), __pyx_v_count, &__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+091: last_covered_activity, SYNCHRONOUS_MOVE, count,
__pyx_t_1 = __pyx_v_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_SYNCHRONOUS_MOVE;
__Pyx_INCREF(__pyx_t_1);
092: add_to_cache=add_to_cache)
093:
+094: cdef __add_move_code(
static PyObject *__pyx_f_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream__MoveStream__add_move_code(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self, PyObject *__pyx_v_last_covered_activity, PyObject *__pyx_v_move_code, int __pyx_v_count, struct __pyx_opt_args_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream___add_move_code *__pyx_optional_args) {
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream._MoveStream__add_move_code", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_counter);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
095: self, str last_covered_activity, str move_code, int count,
+096: bint add_to_cache = True):
int __pyx_v_add_to_cache = ((int)1);
PyObject *__pyx_v_counter = 0;
PyObject *__pyx_r = NULL;
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_add_to_cache = __pyx_optional_args->add_to_cache;
}
}
+097: cdef dict counter = <dict>self.__conditional_counter.get(last_covered_activity, None)
if (unlikely(__pyx_v_self->_MoveStream__conditional_counter == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
__PYX_ERR(0, 97, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_MoveStream__conditional_counter, __pyx_v_last_covered_activity, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_counter = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
+098: if counter is None:
__pyx_t_3 = (__pyx_v_counter == ((PyObject*)Py_None));
if (__pyx_t_3) {
/* … */
}
099: counter = {
+100: SYNCHRONOUS_MOVE: 0,
__pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_v_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_SYNCHRONOUS_MOVE, __pyx_mstate_global->__pyx_int_0) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
+101: MODEL_MOVE: 0,
if (PyDict_SetItem(__pyx_t_2, __pyx_v_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MODEL_MOVE, __pyx_mstate_global->__pyx_int_0) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
+102: LOG_MOVE: 0,
if (PyDict_SetItem(__pyx_t_2, __pyx_v_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_LOG_MOVE, __pyx_mstate_global->__pyx_int_0) < 0) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_counter, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0;
103: }
+104: self.__conditional_counter[last_covered_activity] = counter
if (unlikely(__pyx_v_self->_MoveStream__conditional_counter == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 104, __pyx_L1_error)
}
if (unlikely((PyDict_SetItem(__pyx_v_self->_MoveStream__conditional_counter, __pyx_v_last_covered_activity, __pyx_v_counter) < 0))) __PYX_ERR(0, 104, __pyx_L1_error)
+105: counter[move_code] += count
if (unlikely(__pyx_v_counter == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 105, __pyx_L1_error)
}
__Pyx_INCREF(__pyx_v_counter);
__pyx_t_4 = __pyx_v_counter;
__Pyx_INCREF(__pyx_v_move_code);
__pyx_t_5 = __pyx_v_move_code;
if (unlikely(__pyx_t_4 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 105, __pyx_L1_error)
}
__pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 105, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(__pyx_t_4 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 105, __pyx_L1_error)
}
if (unlikely((PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_t_6) < 0))) __PYX_ERR(0, 105, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+106: if add_to_cache:
if (__pyx_v_add_to_cache) {
/* … */
}
+107: (<list>self.__trace_move_codes_cache[self.__current_trace]).append(
if (unlikely(__pyx_v_self->_MoveStream__trace_move_codes_cache == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 107, __pyx_L1_error)
}
__pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_self->_MoveStream__trace_move_codes_cache, __pyx_v_self->_MoveStream__current_trace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (unlikely(__pyx_t_6 == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
__PYX_ERR(0, 107, __pyx_L1_error)
}
/* … */
__pyx_t_7 = __Pyx_PyList_Append(((PyObject*)__pyx_t_6), __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 107, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+108: (last_covered_activity, move_code))
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_last_covered_activity); __Pyx_GIVEREF(__pyx_v_last_covered_activity); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_last_covered_activity) != (0)) __PYX_ERR(0, 108, __pyx_L1_error); __Pyx_INCREF(__pyx_v_move_code); __Pyx_GIVEREF(__pyx_v_move_code); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_move_code) != (0)) __PYX_ERR(0, 108, __pyx_L1_error);
109:
+110: def flip_moves(self, last_covered_activity: str, from_code: str,
/* Python wrapper */ static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_11flip_moves(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*/ PyDoc_STRVAR(__pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_10flip_moves, "in context of the given last_covered_activity, turn \"amount\" many\n \"from_code\"s into \"to_code\"s. This function will set amount to the existing\n count if amount is larger than that to ensure non-negative counts.\n "); static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_11flip_moves = {"flip_moves", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_11flip_moves, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_10flip_moves}; static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_11flip_moves(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 ) { PyObject *__pyx_v_last_covered_activity = 0; PyObject *__pyx_v_from_code = 0; PyObject *__pyx_v_to_code = 0; PyObject *__pyx_v_amount = 0; #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("flip_moves (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_last_covered_activity,&__pyx_mstate_global->__pyx_n_u_from_code,&__pyx_mstate_global->__pyx_n_u_to_code,&__pyx_mstate_global->__pyx_n_u_amount,0}; PyObject* values[4] = {0,0,0,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 110, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 110, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 110, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 110, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 110, __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, "flip_moves", 0) < 0) __PYX_ERR(0, 110, __pyx_L3_error) if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_int_neg_1)); for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("flip_moves", 0, 3, 4, i); __PYX_ERR(0, 110, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 110, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 110, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 110, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 110, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_int_neg_1)); } __pyx_v_last_covered_activity = ((PyObject*)values[0]); __pyx_v_from_code = ((PyObject*)values[1]); __pyx_v_to_code = ((PyObject*)values[2]); __pyx_v_amount = ((PyObject*)values[3]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("flip_moves", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 110, __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("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.flip_moves", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_last_covered_activity), (&PyUnicode_Type), 0, "last_covered_activity", 2))) __PYX_ERR(0, 110, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_from_code), (&PyUnicode_Type), 0, "from_code", 2))) __PYX_ERR(0, 110, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_code), (&PyUnicode_Type), 0, "to_code", 2))) __PYX_ERR(0, 111, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_amount), (&PyLong_Type), 0, "amount", 2))) __PYX_ERR(0, 111, __pyx_L1_error) __pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_10flip_moves(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self), __pyx_v_last_covered_activity, __pyx_v_from_code, __pyx_v_to_code, __pyx_v_amount); 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; 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_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_10flip_moves(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self, PyObject *__pyx_v_last_covered_activity, PyObject *__pyx_v_from_code, PyObject *__pyx_v_to_code, PyObject *__pyx_v_amount) { PyObject *__pyx_v_move_counter = NULL; PyObject *__pyx_r = NULL; __Pyx_INCREF(__pyx_v_amount); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.flip_moves", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_move_counter); __Pyx_XDECREF(__pyx_v_amount); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_last_covered_activity, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 110, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_from_code, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 110, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_to_code, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 110, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_amount, __pyx_mstate_global->__pyx_n_u_int) < 0) __PYX_ERR(0, 110, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_11flip_moves, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MoveStream_flip_moves, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[4]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_flip_moves, __pyx_t_2) < 0) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* … */ __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_int_neg_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);
111: to_code: str, amount: int = -1):
112: """in context of the given last_covered_activity, turn "amount" many
113: "from_code"s into "to_code"s. This function will set amount to the existing
114: count if amount is larger than that to ensure non-negative counts.
115: """
116: #if the given activity is for example always the last one, then it is
117: #not in the counter
+118: if last_covered_activity in self.__conditional_counter:
if (unlikely(__pyx_v_self->_MoveStream__conditional_counter == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(0, 118, __pyx_L1_error)
}
__pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_v_last_covered_activity, __pyx_v_self->_MoveStream__conditional_counter, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 118, __pyx_L1_error)
if (__pyx_t_1) {
/* … */
}
+119: move_counter = self.__conditional_counter[last_covered_activity]
if (unlikely(__pyx_v_self->_MoveStream__conditional_counter == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 119, __pyx_L1_error)
}
__pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->_MoveStream__conditional_counter, __pyx_v_last_covered_activity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_move_counter = __pyx_t_2;
__pyx_t_2 = 0;
+120: if amount < 0:
__pyx_t_2 = PyObject_RichCompare(__pyx_v_amount, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* … */ goto __pyx_L4; }
+121: amount = move_counter[from_code]
__pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_move_counter, __pyx_v_from_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(PyLong_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_2))) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_amount, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0;
122: else:
+123: amount = min(move_counter[from_code], amount)
/*else*/ {
__Pyx_INCREF(__pyx_v_amount);
__pyx_t_3 = __pyx_v_amount;
__pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_move_counter, __pyx_v_from_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error)
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_1) {
__Pyx_INCREF(__pyx_t_3);
__pyx_t_4 = __pyx_t_3;
} else {
__Pyx_INCREF(__pyx_t_2);
__pyx_t_4 = __pyx_t_2;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_2 = __pyx_t_4;
__Pyx_INCREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(PyLong_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_2))) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_DECREF_SET(__pyx_v_amount, ((PyObject*)__pyx_t_2));
__pyx_t_2 = 0;
}
__pyx_L4:;
+124: move_counter[from_code] -= amount
__Pyx_INCREF(__pyx_v_from_code); __pyx_t_6 = __pyx_v_from_code; __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_move_counter, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_v_amount); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely((PyObject_SetItem(__pyx_v_move_counter, __pyx_t_6, __pyx_t_4) < 0))) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+125: move_counter[to_code] += amount
__Pyx_INCREF(__pyx_v_to_code); __pyx_t_6 = __pyx_v_to_code; __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_move_counter, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_v_amount); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely((PyObject_SetItem(__pyx_v_move_counter, __pyx_t_6, __pyx_t_2) < 0))) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
126:
+127: def decrease_count(self, last_covered_activity: str, move_code: str,
/* Python wrapper */ static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_13decrease_count(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*/ PyDoc_STRVAR(__pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_12decrease_count, "in context of the given last_covered_activity, decreases the count\n of the given move_code. The function ensures that there is no negative\n count after its call.\n "); static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_13decrease_count = {"decrease_count", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_13decrease_count, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_12decrease_count}; static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_13decrease_count(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 ) { PyObject *__pyx_v_last_covered_activity = 0; PyObject *__pyx_v_move_code = 0; PyObject *__pyx_v_amount = 0; #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("decrease_count (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_last_covered_activity,&__pyx_mstate_global->__pyx_n_u_move_code,&__pyx_mstate_global->__pyx_n_u_amount,0}; PyObject* values[3] = {0,0,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 127, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 127, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 127, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 127, __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, "decrease_count", 0) < 0) __PYX_ERR(0, 127, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("decrease_count", 1, 3, 3, i); __PYX_ERR(0, 127, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 127, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 127, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 127, __pyx_L3_error) } __pyx_v_last_covered_activity = ((PyObject*)values[0]); __pyx_v_move_code = ((PyObject*)values[1]); __pyx_v_amount = ((PyObject*)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decrease_count", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 127, __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("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.decrease_count", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_last_covered_activity), (&PyUnicode_Type), 0, "last_covered_activity", 2))) __PYX_ERR(0, 127, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_move_code), (&PyUnicode_Type), 0, "move_code", 2))) __PYX_ERR(0, 127, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_amount), (&PyLong_Type), 0, "amount", 2))) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_12decrease_count(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self), __pyx_v_last_covered_activity, __pyx_v_move_code, __pyx_v_amount); 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; 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_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_12decrease_count(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self, PyObject *__pyx_v_last_covered_activity, PyObject *__pyx_v_move_code, PyObject *__pyx_v_amount) { PyObject *__pyx_v_count = NULL; PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.decrease_count", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_count); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_last_covered_activity, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 127, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_move_code, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 127, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_amount, __pyx_mstate_global->__pyx_n_u_int) < 0) __PYX_ERR(0, 127, __pyx_L1_error) __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_13decrease_count, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MoveStream_decrease_count, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_decrease_count, __pyx_t_3) < 0) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
128: amount: int):
129: """in context of the given last_covered_activity, decreases the count
130: of the given move_code. The function ensures that there is no negative
131: count after its call.
132: """
133: #if the given activity is for example always the last one, then it is
134: #not in the counter
+135: if last_covered_activity in self.__conditional_counter:
if (unlikely(__pyx_v_self->_MoveStream__conditional_counter == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(0, 135, __pyx_L1_error)
}
__pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_v_last_covered_activity, __pyx_v_self->_MoveStream__conditional_counter, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 135, __pyx_L1_error)
if (__pyx_t_1) {
/* … */
}
+136: count = self.__conditional_counter[last_covered_activity][move_code]
if (unlikely(__pyx_v_self->_MoveStream__conditional_counter == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 136, __pyx_L1_error)
}
__pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->_MoveStream__conditional_counter, __pyx_v_last_covered_activity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_v_move_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_count = __pyx_t_3;
__pyx_t_3 = 0;
+137: count = max(0, count - amount)
__pyx_t_3 = PyNumber_Subtract(__pyx_v_count, __pyx_v_amount); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_1) { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; } else { __pyx_t_6 = __Pyx_PyLong_From_long(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __pyx_t_6; __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_count, __pyx_t_3); __pyx_t_3 = 0;
+138: self.__conditional_counter[last_covered_activity][move_code] = count
if (unlikely(__pyx_v_self->_MoveStream__conditional_counter == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 138, __pyx_L1_error)
}
__pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->_MoveStream__conditional_counter, __pyx_v_last_covered_activity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_v_move_code, __pyx_v_count) < 0))) __PYX_ERR(0, 138, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
139:
+140: def remove_last_move(self):
/* Python wrapper */
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_15remove_last_move(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_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_15remove_last_move = {"remove_last_move", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_15remove_last_move, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_15remove_last_move(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
) {
#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("remove_last_move (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);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("remove_last_move", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("remove_last_move", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_14remove_last_move(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_14remove_last_move(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self) {
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_move = NULL;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.remove_last_move", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_move);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_15remove_last_move, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MoveStream_remove_last_move, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_remove_last_move, __pyx_t_3) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+141: context,move = self.__trace_move_codes_cache[self.__current_trace].pop()
if (unlikely(__pyx_v_self->_MoveStream__trace_move_codes_cache == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 141, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->_MoveStream__trace_move_codes_cache, __pyx_v_self->_MoveStream__current_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_Pop(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
PyObject* sequence = __pyx_t_2;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 141, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
__Pyx_INCREF(__pyx_t_3);
} else {
__pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_3);
}
#else
__pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 141, __pyx_L1_error)
__pyx_t_5 = NULL;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L4_unpacking_done;
__pyx_L3_unpacking_failed:;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_5 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 141, __pyx_L1_error)
__pyx_L4_unpacking_done:;
}
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_move = __pyx_t_3;
__pyx_t_3 = 0;
+142: self.__conditional_counter[context][move] -= 1
if (unlikely(__pyx_v_self->_MoveStream__conditional_counter == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 142, __pyx_L1_error)
}
__pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->_MoveStream__conditional_counter, __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_move);
__pyx_t_3 = __pyx_v_move;
__pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __Pyx_PyLong_SubtractObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_4) < 0))) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
143:
+144: def get_encoded_length(self, verbose=False) -> float:
/* Python wrapper */ static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_17get_encoded_length(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*/ PyDoc_STRVAR(__pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_16get_encoded_length, "retuns the MDL of this stream. this does not include the length of the\n stream because this is explicitly known by the number of traces and\n length of the traces that is encoded in the cover"); static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_17get_encoded_length = {"get_encoded_length", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_17get_encoded_length, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_16get_encoded_length}; static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_17get_encoded_length(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 ) { PyObject *__pyx_v_verbose = 0; #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("get_encoded_length (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_verbose,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(0, 144, __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(0, 144, __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, "get_encoded_length", 0) < 0) __PYX_ERR(0, 144, __pyx_L3_error) if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False)); } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 144, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False)); } __pyx_v_verbose = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_encoded_length", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 144, __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("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.get_encoded_length", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_16get_encoded_length(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self), __pyx_v_verbose); /* 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_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_16get_encoded_length(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self, PyObject *__pyx_v_verbose) { PyObject *__pyx_v_encoded_length = NULL; PyObject *__pyx_v_counter = NULL; PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.get_encoded_length", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_encoded_length); __Pyx_XDECREF(__pyx_v_counter); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < 0) __PYX_ERR(0, 144, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_17get_encoded_length, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MoveStream_get_encoded_length, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[5]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_get_encoded_length, __pyx_t_2) < 0) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
145: """retuns the MDL of this stream. this does not include the length of the
146: stream because this is explicitly known by the number of traces and
147: length of the traces that is encoded in the cover"""
+148: encoded_length = 0
__Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
__pyx_v_encoded_length = __pyx_mstate_global->__pyx_int_0;
+149: for counter in self.__conditional_counter.values():
__pyx_t_2 = 0;
if (unlikely(__pyx_v_self->_MoveStream__conditional_counter == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
__PYX_ERR(0, 149, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_dict_iterator(__pyx_v_self->_MoveStream__conditional_counter, 1, __pyx_mstate_global->__pyx_n_u_values, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_1);
__pyx_t_1 = __pyx_t_5;
__pyx_t_5 = 0;
while (1) {
__pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, NULL, &__pyx_t_5, NULL, __pyx_t_4);
if (unlikely(__pyx_t_6 == 0)) break;
if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 149, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_counter, __pyx_t_5);
__pyx_t_5 = 0;
+150: encoded_length += mdl_utils.prequential_coding_length(counter)
if (!(likely(PyDict_CheckExact(__pyx_v_counter))||((__pyx_v_counter) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_v_counter))) __PYX_ERR(0, 150, __pyx_L1_error) __pyx_t_7 = __pyx_f_16prolothar_common_9mdl_utils_prequential_coding_length(((PyObject*)__pyx_v_counter), 0, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L1_error) __pyx_t_5 = PyFloat_FromDouble(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_encoded_length, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_encoded_length, __pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
151:
+152: if verbose:
__pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 152, __pyx_L1_error) if (__pyx_t_9) { /* … */ }
+153: print('encoded length of move stream: %.2f' % encoded_length)
__pyx_t_8 = NULL;
__Pyx_INCREF(__pyx_builtin_print);
__pyx_t_5 = __pyx_builtin_print;
__pyx_t_10 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_encoded_length_of_move_stream_2f, __pyx_v_encoded_length); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 153, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_11 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_10};
__pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+154: print(self.count_move_codes())
__pyx_t_5 = NULL;
__Pyx_INCREF(__pyx_builtin_print);
__pyx_t_10 = __pyx_builtin_print;
__pyx_t_12 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_12);
__pyx_t_11 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
__pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_count_move_codes, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 154, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
}
__pyx_t_11 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_8};
__pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
155:
+156: return encoded_length
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_encoded_length); __pyx_r = __pyx_v_encoded_length; goto __pyx_L0;
157:
+158: def count_move_codes(self) -> Dict[str, int]:
/* Python wrapper */ static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_19count_move_codes(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*/ PyDoc_STRVAR(__pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_18count_move_codes, "returns a dictionary that stores for each move code how many\n times it has been used in total\n "); static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_19count_move_codes = {"count_move_codes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_19count_move_codes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_18count_move_codes}; static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_19count_move_codes(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 ) { #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("count_move_codes (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); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("count_move_codes", 1, 0, 0, __pyx_nargs); return NULL; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("count_move_codes", __pyx_kwds); return NULL;} __pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_18count_move_codes(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_18count_move_codes(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self) { PyObject *__pyx_v_total_counter = 0; PyObject *__pyx_v_counter = NULL; PyObject *__pyx_v_code = NULL; PyObject *__pyx_v_count = NULL; PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.count_move_codes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_total_counter); __Pyx_XDECREF(__pyx_v_counter); __Pyx_XDECREF(__pyx_v_code); __Pyx_XDECREF(__pyx_v_count); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Dict_str_int) < 0) __PYX_ERR(0, 158, __pyx_L1_error) __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_19count_move_codes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MoveStream_count_move_codes, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_count_move_codes, __pyx_t_3) < 0) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
159: """returns a dictionary that stores for each move code how many
160: times it has been used in total
161: """
162: cdef dict total_counter = {
+163: SYNCHRONOUS_MOVE: 0,
__pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_v_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_SYNCHRONOUS_MOVE, __pyx_mstate_global->__pyx_int_0) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
+164: MODEL_MOVE: 0,
if (PyDict_SetItem(__pyx_t_1, __pyx_v_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MODEL_MOVE, __pyx_mstate_global->__pyx_int_0) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
+165: LOG_MOVE: 0,
if (PyDict_SetItem(__pyx_t_1, __pyx_v_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_LOG_MOVE, __pyx_mstate_global->__pyx_int_0) < 0) __PYX_ERR(0, 163, __pyx_L1_error) __pyx_v_total_counter = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
166: }
+167: for counter in self.__conditional_counter.values():
__pyx_t_2 = 0;
if (unlikely(__pyx_v_self->_MoveStream__conditional_counter == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
__PYX_ERR(0, 167, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_dict_iterator(__pyx_v_self->_MoveStream__conditional_counter, 1, __pyx_mstate_global->__pyx_n_u_values, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_1);
__pyx_t_1 = __pyx_t_5;
__pyx_t_5 = 0;
while (1) {
__pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, NULL, &__pyx_t_5, NULL, __pyx_t_4);
if (unlikely(__pyx_t_6 == 0)) break;
if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_counter, __pyx_t_5);
__pyx_t_5 = 0;
+168: for code,count in counter.items():
__pyx_t_7 = 0;
if (unlikely(__pyx_v_counter == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
__PYX_ERR(0, 168, __pyx_L1_error)
}
__pyx_t_9 = __Pyx_dict_iterator(__pyx_v_counter, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_8), (&__pyx_t_6)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_5);
__pyx_t_5 = __pyx_t_9;
__pyx_t_9 = 0;
while (1) {
__pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_8, &__pyx_t_7, &__pyx_t_9, &__pyx_t_10, NULL, __pyx_t_6);
if (unlikely(__pyx_t_11 == 0)) break;
if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GOTREF(__pyx_t_10);
__Pyx_XDECREF_SET(__pyx_v_code, __pyx_t_9);
__pyx_t_9 = 0;
__Pyx_XDECREF_SET(__pyx_v_count, __pyx_t_10);
__pyx_t_10 = 0;
+169: total_counter[code] += count
__Pyx_INCREF(__pyx_v_code); __pyx_t_10 = __pyx_v_code; __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_total_counter, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_t_9, __pyx_v_count); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely((PyDict_SetItem(__pyx_v_total_counter, __pyx_t_10, __pyx_t_12) < 0))) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+170: return total_counter
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_total_counter); __pyx_r = __pyx_v_total_counter; goto __pyx_L0;
171:
+172: def get_number_of_synchronous_moves(self) -> int:
/* Python wrapper */
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_21get_number_of_synchronous_moves(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_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_21get_number_of_synchronous_moves = {"get_number_of_synchronous_moves", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_21get_number_of_synchronous_moves, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_21get_number_of_synchronous_moves(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
) {
#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("get_number_of_synchronous_moves (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);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_number_of_synchronous_moves", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_number_of_synchronous_moves", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_20get_number_of_synchronous_moves(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_20get_number_of_synchronous_moves(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.get_number_of_synchronous_moves", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
__pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_21get_number_of_synchronous_moves, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MoveStream_get_number_of_synchro, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_get_number_of_synchronous_moves, __pyx_t_2) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+173: return self.count_move_codes()[SYNCHRONOUS_MOVE]
__Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_count_move_codes, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_v_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_SYNCHRONOUS_MOVE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(PyLong_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_2))) __PYX_ERR(0, 173, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0;
174:
+175: def get_number_of_log_moves(self) -> int:
/* Python wrapper */
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_23get_number_of_log_moves(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_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_23get_number_of_log_moves = {"get_number_of_log_moves", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_23get_number_of_log_moves, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_23get_number_of_log_moves(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
) {
#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("get_number_of_log_moves (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);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_number_of_log_moves", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_number_of_log_moves", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_22get_number_of_log_moves(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_22get_number_of_log_moves(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.get_number_of_log_moves", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_23get_number_of_log_moves, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MoveStream_get_number_of_log_mov, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_get_number_of_log_moves, __pyx_t_3) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+176: return self.count_move_codes()[LOG_MOVE]
__Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_count_move_codes, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_v_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_LOG_MOVE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(PyLong_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_2))) __PYX_ERR(0, 176, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0;
177:
+178: def get_number_of_model_moves(self) -> int:
/* Python wrapper */
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_25get_number_of_model_moves(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_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_25get_number_of_model_moves = {"get_number_of_model_moves", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_25get_number_of_model_moves, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_25get_number_of_model_moves(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
) {
#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("get_number_of_model_moves (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);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_number_of_model_moves", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_number_of_model_moves", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_24get_number_of_model_moves(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_24get_number_of_model_moves(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.get_number_of_model_moves", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
__pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_25get_number_of_model_moves, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MoveStream_get_number_of_model_m, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_get_number_of_model_moves, __pyx_t_2) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+179: return self.count_move_codes()[MODEL_MOVE]
__Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_count_move_codes, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_v_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MODEL_MOVE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(PyLong_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_2))) __PYX_ERR(0, 179, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0;
180:
+181: def start_trace_covering(self, tuple trace):
/* Python wrapper */ static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_27start_trace_covering(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*/ PyDoc_STRVAR(__pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_26start_trace_covering, "signal that now the given trace starts to get covered"); static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_27start_trace_covering = {"start_trace_covering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_27start_trace_covering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_26start_trace_covering}; static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_27start_trace_covering(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 ) { PyObject *__pyx_v_trace = 0; #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("start_trace_covering (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_trace,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(0, 181, __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(0, 181, __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, "start_trace_covering", 0) < 0) __PYX_ERR(0, 181, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("start_trace_covering", 1, 1, 1, i); __PYX_ERR(0, 181, __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(0, 181, __pyx_L3_error) } __pyx_v_trace = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("start_trace_covering", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 181, __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("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.start_trace_covering", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_trace), (&PyTuple_Type), 1, "trace", 1))) __PYX_ERR(0, 181, __pyx_L1_error) __pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_26start_trace_covering(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self), __pyx_v_trace); 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; 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_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_26start_trace_covering(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self, PyObject *__pyx_v_trace) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.start_trace_covering", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_27start_trace_covering, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MoveStream_start_trace_covering, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_start_trace_covering, __pyx_t_2) < 0) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
182: """signal that now the given trace starts to get covered"""
+183: self.__current_trace = trace
__Pyx_INCREF(__pyx_v_trace); __Pyx_GIVEREF(__pyx_v_trace); __Pyx_GOTREF(__pyx_v_self->_MoveStream__current_trace); __Pyx_DECREF(__pyx_v_self->_MoveStream__current_trace); __pyx_v_self->_MoveStream__current_trace = __pyx_v_trace;
+184: self.__trace_move_codes_cache[trace] = []
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_self->_MoveStream__trace_move_codes_cache == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 184, __pyx_L1_error) } if (unlikely((PyDict_SetItem(__pyx_v_self->_MoveStream__trace_move_codes_cache, __pyx_v_trace, __pyx_t_1) < 0))) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
185:
+186: def end_trace_covering(self, tuple trace):
/* Python wrapper */ static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_29end_trace_covering(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*/ PyDoc_STRVAR(__pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_28end_trace_covering, "signal that now the given trace is covered"); static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_29end_trace_covering = {"end_trace_covering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_29end_trace_covering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_28end_trace_covering}; static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_29end_trace_covering(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 ) { CYTHON_UNUSED PyObject *__pyx_v_trace = 0; #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("end_trace_covering (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_trace,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(0, 186, __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(0, 186, __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, "end_trace_covering", 0) < 0) __PYX_ERR(0, 186, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("end_trace_covering", 1, 1, 1, i); __PYX_ERR(0, 186, __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(0, 186, __pyx_L3_error) } __pyx_v_trace = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("end_trace_covering", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 186, __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("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.end_trace_covering", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_trace), (&PyTuple_Type), 1, "trace", 1))) __PYX_ERR(0, 186, __pyx_L1_error) __pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_28end_trace_covering(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self), __pyx_v_trace); 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; 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_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_28end_trace_covering(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_trace) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_29end_trace_covering, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MoveStream_end_trace_covering, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_end_trace_covering, __pyx_t_2) < 0) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
187: """signal that now the given trace is covered"""
+188: self.__current_trace = None
__Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_MoveStream__current_trace); __Pyx_DECREF(__pyx_v_self->_MoveStream__current_trace); __pyx_v_self->_MoveStream__current_trace = ((PyObject*)Py_None);
189:
+190: def use_cache_to_cover_trace(self, trace: Tuple[str]):
/* Python wrapper */ static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_31use_cache_to_cover_trace(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*/ PyDoc_STRVAR(__pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_30use_cache_to_cover_trace, "repeats the addition of codes as it is stored in a cache for the\n same sequence of activities as the given trace"); static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_31use_cache_to_cover_trace = {"use_cache_to_cover_trace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_31use_cache_to_cover_trace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_30use_cache_to_cover_trace}; static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_31use_cache_to_cover_trace(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 ) { PyObject *__pyx_v_trace = 0; #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("use_cache_to_cover_trace (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_trace,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(0, 190, __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(0, 190, __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, "use_cache_to_cover_trace", 0) < 0) __PYX_ERR(0, 190, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("use_cache_to_cover_trace", 1, 1, 1, i); __PYX_ERR(0, 190, __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(0, 190, __pyx_L3_error) } __pyx_v_trace = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("use_cache_to_cover_trace", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 190, __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("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.use_cache_to_cover_trace", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_trace), (&PyTuple_Type), 0, "trace", 2))) __PYX_ERR(0, 190, __pyx_L1_error) __pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_30use_cache_to_cover_trace(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self), __pyx_v_trace); 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; 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_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_30use_cache_to_cover_trace(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self, PyObject *__pyx_v_trace) { PyObject *__pyx_v_move_code = NULL; PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.cover_streams.move_stream.MoveStream.use_cache_to_cover_trace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_move_code); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_trace, __pyx_mstate_global->__pyx_kp_u_Tuple_str) < 0) __PYX_ERR(0, 190, __pyx_L1_error) __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_31use_cache_to_cover_trace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MoveStream_use_cache_to_cover_tr, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_use_cache_to_cover_trace, __pyx_t_3) < 0) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
191: """repeats the addition of codes as it is stored in a cache for the
192: same sequence of activities as the given trace"""
+193: for move_code in self.__trace_move_codes_cache[trace]:
if (unlikely(__pyx_v_self->_MoveStream__trace_move_codes_cache == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 193, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->_MoveStream__trace_move_codes_cache, __pyx_v_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
__pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
__pyx_t_3 = 0;
__pyx_t_4 = NULL;
} else {
__pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
if (likely(!__pyx_t_4)) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
{
Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 193, __pyx_L1_error)
#endif
if (__pyx_t_3 >= __pyx_temp) break;
}
__pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3);
++__pyx_t_3;
} else {
{
Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 193, __pyx_L1_error)
#endif
if (__pyx_t_3 >= __pyx_temp) break;
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
#else
__pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
#endif
++__pyx_t_3;
}
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
} else {
__pyx_t_1 = __pyx_t_4(__pyx_t_2);
if (unlikely(!__pyx_t_1)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 193, __pyx_L1_error)
PyErr_Clear();
}
break;
}
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_XDECREF_SET(__pyx_v_move_code, __pyx_t_1);
__pyx_t_1 = 0;
/* … */
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+194: self.__add_move_code((<tuple>move_code)[0], (<tuple>move_code)[1], 1, add_to_cache=False)
if (unlikely(__pyx_v_move_code == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 194, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_move_code), 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 194, __pyx_L1_error)
if (unlikely(__pyx_v_move_code == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 194, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_move_code), 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(0, 194, __pyx_L1_error)
__pyx_t_7.__pyx_n = 1;
__pyx_t_7.add_to_cache = 0;
__pyx_t_6 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self->__pyx_vtab)->_MoveStream__add_move_code(__pyx_v_self, ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_5), 1, &__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 194, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
195:
+196: def get_move_codes_cache(self) -> Dict[Tuple[str], List[Tuple[str]]]:
/* Python wrapper */ static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_33get_move_codes_cache(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*/ PyDoc_STRVAR(__pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_32get_move_codes_cache, "\n provides the trace cache for move codes. the returned dictionary should\n not be changed!\n Returns\n -------\n Dict[Tuple[str], List[Tuple[str]]]\n for a given trace stores a sequence of move codes\n (last_covery_activity,move_code).\n "); static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_33get_move_codes_cache = {"get_move_codes_cache", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_33get_move_codes_cache, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_32get_move_codes_cache}; static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_33get_move_codes_cache(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 ) { #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("get_move_codes_cache (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); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_move_codes_cache", 1, 0, 0, __pyx_nargs); return NULL; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_move_codes_cache", __pyx_kwds); return NULL;} __pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_32get_move_codes_cache(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_32get_move_codes_cache(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_v_self) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Dict_Tuple_str_List_Tuple_str) < 0) __PYX_ERR(0, 196, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_33get_move_codes_cache, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MoveStream_get_move_codes_cache, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_mstate_global->__pyx_n_u_get_move_codes_cache, __pyx_t_2) < 0) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
197: """
198: provides the trace cache for move codes. the returned dictionary should
199: not be changed!
200: Returns
201: -------
202: Dict[Tuple[str], List[Tuple[str]]]
203: for a given trace stores a sequence of move codes
204: (last_covery_activity,move_code).
205: """
+206: return self.__trace_move_codes_cache
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_MoveStream__trace_move_codes_cache); __pyx_r = __pyx_v_self->_MoveStream__trace_move_codes_cache; goto __pyx_L0;