Generated by Cython 3.0.8
Yellow lines hint at Python interaction.
Click on a line that starts with a "+
" to see the C code that Cython generated for it.
Raw output: move_stream.cpp
+001: '''
__pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Tuple); __Pyx_GIVEREF(__pyx_n_s_Tuple); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Tuple)) __PYX_ERR(0, 17, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_Dict); __Pyx_GIVEREF(__pyx_n_s_Dict); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_Dict)) __PYX_ERR(0, 17, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_List); __Pyx_GIVEREF(__pyx_n_s_List); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_List)) __PYX_ERR(0, 17, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_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_n_s_Tuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_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_n_s_Dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_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_n_s_List); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_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 import mdl_utils
__pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_mdl_utils); __Pyx_GIVEREF(__pyx_n_s_mdl_utils); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_mdl_utils)) __PYX_ERR(0, 18, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_prolothar_common, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_mdl_utils); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_mdl_utils, __pyx_t_3) < 0) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
019:
+020: from collections import Counter
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Counter); __Pyx_GIVEREF(__pyx_n_s_Counter); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Counter)) __PYX_ERR(0, 20, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __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_n_s_Counter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Counter, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
021:
+022: cdef class MoveStream():
struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream { PyObject_HEAD struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream *__pyx_vtab; PyObject *_MoveStream__conditional_counter; PyObject *_MoveStream__trace_move_codes_cache; PyObject *_MoveStream__current_trace; }; 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;
023: """code stream of the cover that stores codes for model moves, log moves
024: and synchronous moves. model moves are activities in the
025: model that are not observable in the log. a log move is an activity that
026: is observed in the log but not explained by the model. a synchronous move
027: is behavior that is both modeled and observed"""
028:
029: cdef dict __conditional_counter
030: cdef dict __trace_move_codes_cache
031: cdef tuple __current_trace
032:
+033: SYNCHRONOUS_MOVE = 'sync'
if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_SYNCHRONOUS_MOVE, __pyx_n_u_sync) < 0) __PYX_ERR(0, 33, __pyx_L1_error) PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream);
+034: LOG_MOVE = 'log'
if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_LOG_MOVE, __pyx_n_u_log) < 0) __PYX_ERR(0, 34, __pyx_L1_error) PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream);
+035: MODEL_MOVE = 'model'
if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_MODEL_MOVE, __pyx_n_u_model) < 0) __PYX_ERR(0, 35, __pyx_L1_error) PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream);
036:
+037: 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_MACROS __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;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) 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; }
038: """creates a new, empty move stream"""
+039: self.__conditional_counter = {}
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __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;
+040: self.__trace_move_codes_cache = {}
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __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;
041:
+042: 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 (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)))) { #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_n_s_copy_counts_only); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_3copy_counts_only)) { __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream))))) __PYX_ERR(0, 42, __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*)(__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_MACROS __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;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy_counts_only", 0))) 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, 42, __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_tuple__4 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* … */ __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_n_s_MoveStream_copy_counts_only, NULL, __pyx_n_s_prolothar_process_discovery_disc_2, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_copy_counts_only, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_prolothar_process_discovery_disc, __pyx_n_s_copy_counts_only, 42, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 42, __pyx_L1_error)
043: """returns a copy of this stream. Only the counts are copied.
044: All caches and any other information is not copied
045: """
+046: cdef MoveStream copy = MoveStream()
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__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;
+047: copy.__conditional_counter = {}
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __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;
+048: 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, 48, __pyx_L1_error) } __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_self->_MoveStream__conditional_counter, 1, __pyx_n_s_items, (&__pyx_t_7), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_7, &__pyx_t_6, &__pyx_t_2, &__pyx_t_3, NULL, __pyx_t_5); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_context, __pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_move_stream_counter, __pyx_t_3); __pyx_t_3 = 0;
+049: copy.__conditional_counter[context] = dict(move_stream_counter)
__pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_move_stream_counter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__pyx_v_copy->_MoveStream__conditional_counter == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 49, __pyx_L1_error) } if (unlikely((PyDict_SetItem(__pyx_v_copy->_MoveStream__conditional_counter, __pyx_v_context, __pyx_t_3) < 0))) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+050: return copy
__Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_copy); __pyx_r = __pyx_v_copy; goto __pyx_L0;
051:
+052: 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 (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)))) { #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_n_s_add_log_move); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_5add_log_move)) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_add_to_cache); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_v_last_covered_activity, __pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __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*)(__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_MACROS __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 **__pyx_pyargnames[] = {&__pyx_n_s_last_covered_activity,&__pyx_n_s_count,&__pyx_n_s_add_to_cache,0}; PyObject* values[3] = {0,0,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_last_covered_activity)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_count); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_add_to_cache); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_log_move") < 0)) __PYX_ERR(0, 52, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_last_covered_activity = ((PyObject*)values[0]); if (values[1]) { __pyx_v_count = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 52, __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, 53, __pyx_L3_error) } else { /* … */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __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, 52, __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_tuple__6 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_last_covered_activity, __pyx_n_s_count, __pyx_n_s_add_to_cache); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_prolothar_process_discovery_disc, __pyx_n_s_add_log_move, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 52, __pyx_L1_error) /* … */ __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_n_s_MoveStream_add_log_move, NULL, __pyx_n_s_prolothar_process_discovery_disc_2, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__8); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_add_log_move, __pyx_t_3) < 0) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream); __pyx_tuple__8 = PyTuple_Pack(2, __pyx_int_1, Py_True); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* … */ struct __pyx_opt_args_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_add_log_move { int __pyx_n; int count; int add_to_cache; };
+053: 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, 52, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(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, 52, __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);
054: """adds the code for a log move to this stream
055:
056: Args:
057: last_covered_activity:
058: used to compute the conditional probability of observing
059: a log move. can be None at the beginning of a trace
060: count:
061: default is 1.
062: """
+063: 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, 63, __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;
+064: last_covered_activity, MoveStream.LOG_MOVE, count,
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream), __pyx_n_s_LOG_MOVE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 64, __pyx_L1_error)
065: add_to_cache=add_to_cache)
066:
+067: 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 (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)))) { #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_n_s_add_model_move); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_7add_model_move)) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_add_to_cache); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_v_last_covered_activity, __pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __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*)(__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_MACROS __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 **__pyx_pyargnames[] = {&__pyx_n_s_last_covered_activity,&__pyx_n_s_count,&__pyx_n_s_add_to_cache,0}; PyObject* values[3] = {0,0,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_last_covered_activity)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_count); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_add_to_cache); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_model_move") < 0)) __PYX_ERR(0, 67, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_last_covered_activity = ((PyObject*)values[0]); if (values[1]) { __pyx_v_count = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __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, 68, __pyx_L3_error) } else { /* … */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __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, 67, __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_codeobj__9 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_prolothar_process_discovery_disc, __pyx_n_s_add_model_move, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 67, __pyx_L1_error) /* … */ __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_n_s_MoveStream_add_model_move, NULL, __pyx_n_s_prolothar_process_discovery_disc_2, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__10); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_add_model_move, __pyx_t_3) < 0) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream); __pyx_tuple__10 = PyTuple_Pack(2, __pyx_int_1, Py_True); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* … */ struct __pyx_opt_args_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_add_model_move { int __pyx_n; int count; int add_to_cache; };
+068: 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, 67, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(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, 67, __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);
069: """adds the code for a model move to this stream
070: Args:
071: last_covered_activity:
072: used to compute the conditional probability of observing
073: a model move. can be None at the beginning of a trace
074: count:
075: default is 1.
076: """
+077: 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, 77, __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;
+078: last_covered_activity, MoveStream.MODEL_MOVE, count,
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream), __pyx_n_s_MODEL_MOVE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 78, __pyx_L1_error)
079: add_to_cache=add_to_cache)
080:
+081: 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 (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)))) { #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_n_s_add_synchronous_move); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_9add_synchronous_move)) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_add_to_cache); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_v_last_covered_activity, __pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __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*)(__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_MACROS __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 **__pyx_pyargnames[] = {&__pyx_n_s_last_covered_activity,&__pyx_n_s_count,&__pyx_n_s_add_to_cache,0}; PyObject* values[3] = {0,0,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_last_covered_activity)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_count); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_add_to_cache); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_synchronous_move") < 0)) __PYX_ERR(0, 81, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_last_covered_activity = ((PyObject*)values[0]); if (values[1]) { __pyx_v_count = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 81, __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, 82, __pyx_L3_error) } else { /* … */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __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, 81, __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_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_prolothar_process_discovery_disc, __pyx_n_s_add_synchronous_move, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 81, __pyx_L1_error) /* … */ __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_n_s_MoveStream_add_synchronous_move, NULL, __pyx_n_s_prolothar_process_discovery_disc_2, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__12); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_add_synchronous_move, __pyx_t_3) < 0) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream); __pyx_tuple__12 = PyTuple_Pack(2, __pyx_int_1, Py_True); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* … */ struct __pyx_opt_args_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_add_synchronous_move { int __pyx_n; int count; int add_to_cache; };
+082: 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, 81, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(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, 81, __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);
083: """adds the code for a synchronous move to this stream
084:
085: Args:
086: last_covered_activity:
087: used to compute the conditional probability of observing
088: a sync move. can be None at the beginning of a trace
089: count:
090: default is 1.
091: """
+092: 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, 92, __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;
+093: last_covered_activity, MoveStream.SYNCHRONOUS_MOVE, count,
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream), __pyx_n_s_SYNCHRONOUS_MOVE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 93, __pyx_L1_error)
094: add_to_cache=add_to_cache)
095:
+096: 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; } /* … */ struct __pyx_opt_args_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream___add_move_code { int __pyx_n; int add_to_cache; };
097: self, str last_covered_activity, str move_code, int count,
+098: 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; } }
+099: 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, 99, __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, 99, __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;
+100: if counter is None:
__pyx_t_3 = (__pyx_v_counter == ((PyObject*)Py_None)); if (__pyx_t_3) { /* … */ }
101: counter = {
+102: MoveStream.SYNCHRONOUS_MOVE: 0,
__pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream), __pyx_n_s_SYNCHRONOUS_MOVE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_int_0) < 0) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+103: MoveStream.MODEL_MOVE: 0,
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream), __pyx_n_s_MODEL_MOVE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_int_0) < 0) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+104: MoveStream.LOG_MOVE: 0,
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream), __pyx_n_s_LOG_MOVE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_int_0) < 0) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_counter, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0;
105: }
+106: 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, 106, __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, 106, __pyx_L1_error)
+107: counter[move_code] += count
if (unlikely(__pyx_v_counter == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 107, __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, 107, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __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, 107, __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, 107, __pyx_L1_error) } if (unlikely((PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_t_6) < 0))) __PYX_ERR(0, 107, __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;
+108: if add_to_cache:
if (__pyx_v_add_to_cache) { /* … */ }
+109: (<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, 109, __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, 109, __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, 109, __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, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+110: (last_covered_activity, move_code))
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __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)) __PYX_ERR(0, 110, __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)) __PYX_ERR(0, 110, __pyx_L1_error);
111:
+112: 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*)(__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_MACROS __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 **__pyx_pyargnames[] = {&__pyx_n_s_last_covered_activity,&__pyx_n_s_from_code,&__pyx_n_s_to_code,&__pyx_n_s_amount,0}; PyObject* values[4] = {0,0,0,0}; values[3] = __Pyx_Arg_NewRef_FASTCALL(__pyx_k_); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_last_covered_activity)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_from_code)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("flip_moves", 0, 3, 4, 1); __PYX_ERR(0, 112, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_to_code)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("flip_moves", 0, 3, 4, 2); __PYX_ERR(0, 112, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_amount); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "flip_moves") < 0)) __PYX_ERR(0, 112, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __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, 112, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(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", 1))) __PYX_ERR(0, 112, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_from_code), (&PyUnicode_Type), 0, "from_code", 1))) __PYX_ERR(0, 112, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_code), (&PyUnicode_Type), 0, "to_code", 1))) __PYX_ERR(0, 113, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_amount), (&PyInt_Type), 0, "amount", 1))) __PYX_ERR(0, 113, __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; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __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_tuple__13 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_last_covered_activity, __pyx_n_s_from_code, __pyx_n_s_to_code, __pyx_n_s_amount, __pyx_n_s_move_counter); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_neg_1)) __PYX_ERR(0, 112, __pyx_L1_error); __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_last_covered_activity, __pyx_n_s_str) < 0) __PYX_ERR(0, 112, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_from_code, __pyx_n_s_str) < 0) __PYX_ERR(0, 112, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_to_code, __pyx_n_s_str) < 0) __PYX_ERR(0, 112, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_amount, __pyx_n_s_int) < 0) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_11flip_moves, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MoveStream_flip_moves, NULL, __pyx_n_s_prolothar_process_discovery_disc_2, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_flip_moves, __pyx_t_4) < 0) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_prolothar_process_discovery_disc, __pyx_n_s_flip_moves, 112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 112, __pyx_L1_error)
+113: to_code: str, amount: int = -1):
if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_neg_1)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_neg_1))) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_INCREF(__pyx_int_neg_1); __pyx_k_ = ((PyObject*)__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); /* … */ if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_neg_1)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_neg_1))) __PYX_ERR(0, 113, __pyx_L1_error)
114: """in context of the given last_covered_activity, turn "amount" many
115: "from_code"s into "to_code"s. This function will set amount to the existing
116: count if amount is larger than that to ensure non-negative counts.
117: """
118: #if the given activity is for example always the last one, then it is
119: #not in the counter
+120: 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, 120, __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, 120, __pyx_L1_error) if (__pyx_t_1) { /* … */ }
+121: 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, 121, __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, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_move_counter = __pyx_t_2; __pyx_t_2 = 0;
+122: if amount < 0:
__pyx_t_2 = PyObject_RichCompare(__pyx_v_amount, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* … */ goto __pyx_L4; }
+123: 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, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(__Pyx_Py3Int_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;
124: else:
+125: 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, 125, __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, 125, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 125, __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; if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_4))) __PYX_ERR(0, 125, __pyx_L1_error) __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_amount, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; } __pyx_L4:;
+126: 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, 126, __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, 126, __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, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+127: 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, 127, __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, 127, __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, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
128:
+129: 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*)(__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_MACROS __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 **__pyx_pyargnames[] = {&__pyx_n_s_last_covered_activity,&__pyx_n_s_move_code,&__pyx_n_s_amount,0}; PyObject* values[3] = {0,0,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_last_covered_activity)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 129, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_move_code)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 129, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("decrease_count", 1, 3, 3, 1); __PYX_ERR(0, 129, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_amount)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 129, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("decrease_count", 1, 3, 3, 2); __PYX_ERR(0, 129, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "decrease_count") < 0)) __PYX_ERR(0, 129, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __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, 129, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(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", 1))) __PYX_ERR(0, 129, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_move_code), (&PyUnicode_Type), 0, "move_code", 1))) __PYX_ERR(0, 129, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_amount), (&PyInt_Type), 0, "amount", 1))) __PYX_ERR(0, 130, __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; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __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_tuple__15 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_last_covered_activity, __pyx_n_s_move_code, __pyx_n_s_amount, __pyx_n_s_count); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* … */ __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_last_covered_activity, __pyx_n_s_str) < 0) __PYX_ERR(0, 129, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_move_code, __pyx_n_s_str) < 0) __PYX_ERR(0, 129, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_amount, __pyx_n_s_int) < 0) __PYX_ERR(0, 129, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_13decrease_count, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MoveStream_decrease_count, NULL, __pyx_n_s_prolothar_process_discovery_disc_2, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_decrease_count, __pyx_t_2) < 0) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_prolothar_process_discovery_disc, __pyx_n_s_decrease_count, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 129, __pyx_L1_error)
130: amount: int):
131: """in context of the given last_covered_activity, decreases the count
132: of the given move_code. The function ensures that there is no negative
133: count after its call.
134: """
135: #if the given activity is for example always the last one, then it is
136: #not in the counter
+137: 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, 137, __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, 137, __pyx_L1_error) if (__pyx_t_1) { /* … */ }
+138: 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, 138, __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, 138, __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, 138, __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;
+139: count = max(0, count - amount)
__pyx_t_3 = PyNumber_Subtract(__pyx_v_count, __pyx_v_amount); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __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, 139, __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, 139, __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_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __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;
+140: 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, 140, __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, 140, __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, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
141:
+142: 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*)(__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_MACROS __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;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "remove_last_move", 0))) 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_tuple__17 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_move); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); /* … */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_15remove_last_move, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MoveStream_remove_last_move, NULL, __pyx_n_s_prolothar_process_discovery_disc_2, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_remove_last_move, __pyx_t_2) < 0) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_prolothar_process_discovery_disc, __pyx_n_s_remove_last_move, 142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 142, __pyx_L1_error)
+143: 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, 143, __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, 143, __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, 143, __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, 143, __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_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __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, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __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, 143, __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, 143, __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;
+144: 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, 144, __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, 144, __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, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __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, 144, __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;
145:
+146: 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*)(__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_MACROS __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 **__pyx_pyargnames[] = {&__pyx_n_s_verbose,0}; PyObject* values[1] = {0}; values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose); if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_encoded_length") < 0)) __PYX_ERR(0, 146, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __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, 146, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(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 */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(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_7); __Pyx_XDECREF(__pyx_t_8); __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_tuple__19 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_verbose, __pyx_n_s_encoded_length, __pyx_n_s_counter); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_prolothar_process_discovery_disc, __pyx_n_s_get_encoded_length, 146, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 146, __pyx_L1_error) /* … */ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_float) < 0) __PYX_ERR(0, 146, __pyx_L1_error) __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_17get_encoded_length, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MoveStream_get_encoded_length, NULL, __pyx_n_s_prolothar_process_discovery_disc_2, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__21); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_get_encoded_length, __pyx_t_4) < 0) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream); __pyx_tuple__21 = PyTuple_Pack(1, Py_False); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21);
147: """retuns the MDL of this stream. this does not include the length of the
148: stream because this is explicitly known by the number of traces and
149: length of the traces that is encoded in the cover"""
+150: encoded_length = 0
__Pyx_INCREF(__pyx_int_0);
__pyx_v_encoded_length = __pyx_int_0;
+151: 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, 151, __pyx_L1_error) } __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_self->_MoveStream__conditional_counter, 1, __pyx_n_s_values, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __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, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_counter, __pyx_t_5); __pyx_t_5 = 0;
+152: encoded_length += mdl_utils.prequential_coding_length(counter)
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_mdl_utils); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_prequential_coding_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_counter}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_encoded_length, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 152, __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;
153:
+154: if verbose:
__pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 154, __pyx_L1_error) if (__pyx_t_9) { /* … */ }
+155: print('encoded length of move stream: %.2f' % encoded_length)
__pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_encoded_length_of_move_stream_2f, __pyx_v_encoded_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+156: print(self.count_move_codes())
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_count_move_codes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
157:
+158: return encoded_length
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_encoded_length); __pyx_r = __pyx_v_encoded_length; goto __pyx_L0;
159:
+160: 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*)(__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_MACROS __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;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "count_move_codes", 0))) 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_2); __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_tuple__22 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_total_counter, __pyx_n_s_counter, __pyx_n_s_code, __pyx_n_s_count); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); /* … */ __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_Dict_str_int) < 0) __PYX_ERR(0, 160, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_19count_move_codes, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MoveStream_count_move_codes, NULL, __pyx_n_s_prolothar_process_discovery_disc_2, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_count_move_codes, __pyx_t_2) < 0) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_prolothar_process_discovery_disc, __pyx_n_s_count_move_codes, 160, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 160, __pyx_L1_error)
161: """returns a dictionary that stores for each move code how many
162: times it has been used in total
163: """
164: cdef dict total_counter = {
+165: MoveStream.SYNCHRONOUS_MOVE: 0,
__pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream), __pyx_n_s_SYNCHRONOUS_MOVE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_0) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+166: MoveStream.MODEL_MOVE: 0,
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream), __pyx_n_s_MODEL_MOVE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_0) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+167: MoveStream.LOG_MOVE: 0,
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream), __pyx_n_s_LOG_MOVE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_int_0) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_total_counter = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
168: }
+169: for counter in self.__conditional_counter.values():
__pyx_t_3 = 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, 169, __pyx_L1_error) } __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_self->_MoveStream__conditional_counter, 1, __pyx_n_s_values, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_3, NULL, &__pyx_t_2, NULL, __pyx_t_5); if (unlikely(__pyx_t_6 == 0)) break; if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_counter, __pyx_t_2); __pyx_t_2 = 0;
+170: 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, 170, __pyx_L1_error) } __pyx_t_9 = __Pyx_dict_iterator(__pyx_v_counter, 0, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_6)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_9; __pyx_t_9 = 0; while (1) { __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_2, __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, 170, __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;
+171: 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, 171, __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, 171, __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, 171, __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_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+172: return total_counter
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_total_counter); __pyx_r = __pyx_v_total_counter; goto __pyx_L0;
173:
+174: 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*)(__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_MACROS __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;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_number_of_synchronous_moves", 0))) 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_XDECREF(__pyx_t_3); __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_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 174, __pyx_L1_error) __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_21get_number_of_synchronous_moves, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MoveStream_get_number_of_synchro, NULL, __pyx_n_s_prolothar_process_discovery_disc_2, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_get_number_of_synchronous_moves, __pyx_t_4) < 0) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream); /* … */ __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_prolothar_process_discovery_disc, __pyx_n_s_get_number_of_synchronous_moves, 174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 174, __pyx_L1_error)
+175: return self.count_move_codes()[MoveStream.SYNCHRONOUS_MOVE]
__Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_count_move_codes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream), __pyx_n_s_SYNCHRONOUS_MOVE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_3))) __PYX_ERR(0, 175, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0;
176:
+177: 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*)(__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_MACROS __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;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_number_of_log_moves", 0))) 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_XDECREF(__pyx_t_3); __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_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 177, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_23get_number_of_log_moves, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MoveStream_get_number_of_log_mov, NULL, __pyx_n_s_prolothar_process_discovery_disc_2, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_get_number_of_log_moves, __pyx_t_2) < 0) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream); /* … */ __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_prolothar_process_discovery_disc, __pyx_n_s_get_number_of_log_moves, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 177, __pyx_L1_error)
+178: return self.count_move_codes()[MoveStream.LOG_MOVE]
__Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_count_move_codes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream), __pyx_n_s_LOG_MOVE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_3))) __PYX_ERR(0, 178, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0;
179:
+180: 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*)(__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_MACROS __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;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_number_of_model_moves", 0))) 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_XDECREF(__pyx_t_3); __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_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 180, __pyx_L1_error) __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_25get_number_of_model_moves, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MoveStream_get_number_of_model_m, NULL, __pyx_n_s_prolothar_process_discovery_disc_2, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_get_number_of_model_moves, __pyx_t_4) < 0) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream); /* … */ __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_prolothar_process_discovery_disc, __pyx_n_s_get_number_of_model_moves, 180, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 180, __pyx_L1_error)
+181: return self.count_move_codes()[MoveStream.MODEL_MOVE]
__Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_count_move_codes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream), __pyx_n_s_MODEL_MOVE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_3))) __PYX_ERR(0, 181, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0;
182:
+183: 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*)(__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_MACROS __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 **__pyx_pyargnames[] = {&__pyx_n_s_trace,0}; PyObject* values[1] = {0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_trace)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "start_trace_covering") < 0)) __PYX_ERR(0, 183, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __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, 183, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(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, 183, __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; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __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_tuple__27 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_trace); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); /* … */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_27start_trace_covering, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MoveStream_start_trace_covering, NULL, __pyx_n_s_prolothar_process_discovery_disc_2, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_start_trace_covering, __pyx_t_4) < 0) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream); __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_prolothar_process_discovery_disc, __pyx_n_s_start_trace_covering, 183, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 183, __pyx_L1_error)
184: """signal that now the given trace starts to get covered"""
+185: 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;
+186: self.__trace_move_codes_cache[trace] = []
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __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, 186, __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, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
187:
+188: 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*)(__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_MACROS __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 **__pyx_pyargnames[] = {&__pyx_n_s_trace,0}; PyObject* values[1] = {0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_trace)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "end_trace_covering") < 0)) __PYX_ERR(0, 188, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __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, 188, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(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, 188, __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; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __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_4 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_29end_trace_covering, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MoveStream_end_trace_covering, NULL, __pyx_n_s_prolothar_process_discovery_disc_2, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_end_trace_covering, __pyx_t_4) < 0) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream); /* … */ __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_prolothar_process_discovery_disc, __pyx_n_s_end_trace_covering, 188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 188, __pyx_L1_error)
189: """signal that now the given trace is covered"""
+190: 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);
191:
+192: 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*)(__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_MACROS __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 **__pyx_pyargnames[] = {&__pyx_n_s_trace,0}; PyObject* values[1] = {0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_trace)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 192, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "use_cache_to_cover_trace") < 0)) __PYX_ERR(0, 192, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __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, 192, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(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", 1))) __PYX_ERR(0, 192, __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; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __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_tuple__30 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_trace, __pyx_n_s_move_code); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); /* … */ __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_trace, __pyx_kp_s_Tuple_str) < 0) __PYX_ERR(0, 192, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_31use_cache_to_cover_trace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MoveStream_use_cache_to_cover_tr, NULL, __pyx_n_s_prolothar_process_discovery_disc_2, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_use_cache_to_cover_trace, __pyx_t_2) < 0) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream); __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_prolothar_process_discovery_disc, __pyx_n_s_use_cache_to_cover_trace, 192, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 192, __pyx_L1_error)
193: """repeats the addition of codes as it is stored in a cache for the
194: same sequence of activities as the given trace"""
+195: 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, 195, __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, 195, __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, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __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_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 195, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 195, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 195, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 195, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 195, __pyx_L1_error) } 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;
+196: 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, 196, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_move_code), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 196, __pyx_L1_error) if (unlikely(__pyx_v_move_code == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 196, __pyx_L1_error) } __pyx_t_5 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_move_code), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(0, 196, __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, 196, __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;
197:
+198: 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*)(__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_MACROS __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;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_move_codes_cache", 0))) 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_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_kp_s_Dict_Tuple_str_List_Tuple_str) < 0) __PYX_ERR(0, 198, __pyx_L1_error) __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_10MoveStream_33get_move_codes_cache, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MoveStream_get_move_codes_cache, NULL, __pyx_n_s_prolothar_process_discovery_disc_2, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream, __pyx_n_s_get_move_codes_cache, __pyx_t_4) < 0) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11move_stream_MoveStream); /* … */ __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_prolothar_process_discovery_disc, __pyx_n_s_get_move_codes_cache, 198, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 198, __pyx_L1_error)
199: """
200: provides the trace cache for move codes. the returned dictionary should
201: not be changed!
202: Returns
203: -------
204: Dict[Tuple[str], List[Tuple[str]]]
205: for a given trace stores a sequence of move codes
206: (last_covery_activity,move_code).
207: """
+208: 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;