/* Generated by Cython 3.2.9 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "extra_compile_args": [
            "/O2"
        ],
        "name": "ws_package.utils.hardware_event_validator",
        "sources": [
            "C:\\Users\\yash\\Desktop\\Saver_win_visible\\workstatus-python\\workstatus\\ws_package\\utils\\hardware_event_validator.py"
        ]
    },
    "module_name": "ws_package.utils.hardware_event_validator"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
/* InitLimitedAPI */
#if defined(Py_LIMITED_API)
  #if !defined(CYTHON_LIMITED_API)
  #define CYTHON_LIMITED_API 1
  #endif
#elif defined(CYTHON_LIMITED_API)
  #ifdef _MSC_VER
  #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
  #else
  #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
  #endif
#endif

#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x03080000
    #error Cython requires Python 3.8+.
#else
#define __PYX_ABI_VERSION "3_2_9"
#define CYTHON_HEX_VERSION 0x030209F0
#define CYTHON_FUTURE_DIVISION 1
/* CModulePreamble */
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
#if defined(GRAALVM_PYTHON)
  /* For very preliminary testing purposes. Most variables are set the same as PyPy.
     The existence of this section does not imply that anything works or is even tested */
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 1
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 1
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#elif defined(PYPY_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 1
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #if PY_VERSION_HEX < 0x03090000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
  #endif
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#elif defined(CYTHON_LIMITED_API)
  #ifdef Py_LIMITED_API
    #undef __PYX_LIMITED_VERSION_HEX
    #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
  #endif
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 1
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 1
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #endif
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #ifndef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 1
  #endif
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #ifdef Py_GIL_DISABLED
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
  #else
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #endif
  #if PY_VERSION_HEX < 0x030A0000
    #undef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #elif !defined(CYTHON_USE_TYPE_SLOTS)
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #ifndef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_FAST_GIL
    #define CYTHON_FAST_GIL 0
  #elif !defined(CYTHON_FAST_GIL)
    #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #ifndef CYTHON_USE_SYS_MONITORING
    #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS 0
  #elif !defined(CYTHON_USE_DICT_VERSIONS)
    #define CYTHON_USE_DICT_VERSIONS  (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 1
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
  #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
    #undef CYTHON_IMMORTAL_CONSTANTS
    #define CYTHON_IMMORTAL_CONSTANTS 0  // definitely won't work
  #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
    #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
#endif
#ifndef CYTHON_COMPRESS_STRINGS
  #define CYTHON_COMPRESS_STRINGS 1
#endif
#ifndef CYTHON_FAST_PYCCALL
#define CYTHON_FAST_PYCCALL  CYTHON_FAST_PYCALL
#endif
#ifndef CYTHON_VECTORCALL
#if CYTHON_COMPILING_IN_LIMITED_API
#define CYTHON_VECTORCALL  (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
#else
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL)
#endif
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(maybe_unused)
        #define CYTHON_UNUSED [[maybe_unused]]
      #endif
    #endif
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
  #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_USE_CPP_STD_MOVE
  #if defined(__cplusplus) && (\
    __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
    #define CYTHON_USE_CPP_STD_MOVE 1
  #else
    #define CYTHON_USE_CPP_STD_MOVE 0
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#include <stdint.h>
typedef uintptr_t  __pyx_uintptr_t;
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(fallthrough)
        #define CYTHON_FALLTHROUGH [[fallthrough]]
      #endif
    #endif
    #ifndef CYTHON_FALLTHROUGH
      #if __has_cpp_attribute(clang::fallthrough)
        #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
      #elif __has_cpp_attribute(gnu::fallthrough)
        #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
      #endif
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif
#ifndef Py_UNREACHABLE
  #define Py_UNREACHABLE()  assert(0); abort()
#endif
#ifdef __cplusplus
  template <typename T>
  struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
  #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
#else
  #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
#endif
#if CYTHON_COMPILING_IN_PYPY == 1
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX < 0x030A0000)
#else
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX < 0x03090000)
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))

/* CInitCode */
#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #elif defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

/* PythonCompatibility */
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    #ifndef CO_OPTIMIZED
    static int CO_OPTIMIZED;
    #endif
    #ifndef CO_NEWLOCALS
    static int CO_NEWLOCALS;
    #endif
    #ifndef CO_VARARGS
    static int CO_VARARGS;
    #endif
    #ifndef CO_VARKEYWORDS
    static int CO_VARKEYWORDS;
    #endif
    #ifndef CO_ASYNC_GENERATOR
    static int CO_ASYNC_GENERATOR;
    #endif
    #ifndef CO_GENERATOR
    static int CO_GENERATOR;
    #endif
    #ifndef CO_COROUTINE
    static int CO_COROUTINE;
    #endif
#else
    #ifndef CO_COROUTINE
      #define CO_COROUTINE 0x80
    #endif
    #ifndef CO_ASYNC_GENERATOR
      #define CO_ASYNC_GENERATOR 0x200
    #endif
#endif
static int __Pyx_init_co_variables(void);
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
  #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
  #define __Pyx_Py_Is(x, y)  Py_Is(x, y)
#else
  #define __Pyx_Py_Is(x, y) ((x) == (y))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
  #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
#else
  #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
  #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
#else
  #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
  #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
#else
  #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
#endif
#define __Pyx_NoneAsNull(obj)  (__Pyx_Py_IsNone(obj) ? NULL : (obj))
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#else
  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef Py_TPFLAGS_SEQUENCE
  #define Py_TPFLAGS_SEQUENCE 0
#endif
#ifndef Py_TPFLAGS_MAPPING
  #define Py_TPFLAGS_MAPPING 0
#endif
#ifndef Py_TPFLAGS_IMMUTABLETYPE
  #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
#endif
#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
  #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#ifndef METH_FASTCALL
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #if PY_VERSION_HEX >= 0x030d00A4
  #  define __Pyx_PyCFunctionFast PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
  #else
  #  define __Pyx_PyCFunctionFast _PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  #endif
#endif
#if CYTHON_METH_FASTCALL
  #define __Pyx_METH_FASTCALL METH_FASTCALL
  #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
  #define __Pyx_METH_FASTCALL METH_VARARGS
  #define __Pyx_PyCFunction_FastCall PyCFunction
  #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
  #define __pyx_vectorcallfunc vectorcallfunc
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  PY_VECTORCALL_ARGUMENTS_OFFSET
  #define __Pyx_PyVectorcall_NARGS(n)  PyVectorcall_NARGS((size_t)(n))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#if PY_VERSION_HEX >= 0x030900B1
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_CheckExact(func)
#else
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_Check(func)
#endif
#define __Pyx_CyOrPyCFunction_Check(func)  PyCFunction_Check(func)
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  (((PyCFunctionObject*)(func))->m_ml->ml_meth)
#elif !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  PyCFunction_GET_FUNCTION(func)
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func)  (((PyCFunctionObject*)(func))->m_ml->ml_flags)
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
    return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
}
#endif
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
#if CYTHON_COMPILING_IN_LIMITED_API
    return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
    return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCFunction(func, cfunc)
#if PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  ((void)m, PyType_FromSpecWithBases(s, b))
  typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  PyType_FromModuleAndSpec(m, s, b)
  #define __Pyx_PyCMethod  PyCMethod
#endif
#ifndef METH_METHOD
  #define METH_METHOD 0x200
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
#elif CYTHON_COMPILING_IN_GRAAL
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#endif
#if CYTHON_USE_MODULE_STATE
static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
{
    void *result;
    result = PyModule_GetState(op);
    if (!result)
        Py_FatalError("Couldn't find the module state");
    return result;
}
#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
#else
#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
  #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
  #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
    ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
     (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
     __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
  #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
  #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
    PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
    if (res == NULL) PyErr_Clear();
    return res;
}
#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
#define __Pyx_PyDict_GetItemStrWithError  PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
    return PyDict_GetItem(dict, name);
#else
    PyDictEntry *ep;
    PyDictObject *mp = (PyDictObject*) dict;
    long hash = ((PyStringObject *) name)->ob_shash;
    assert(hash != -1);
    ep = (mp->ma_lookup)(mp, name, hash);
    if (ep == NULL) {
        return NULL;
    }
    return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetFlags(tp)   (((PyTypeObject *)tp)->tp_flags)
  #define __Pyx_PyType_HasFeature(type, feature)  ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
#endif
#define __Pyx_PyObject_GetIterNextFunc(iterator)  __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
#if CYTHON_USE_TYPE_SPECS
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  {\
    PyTypeObject *type = Py_TYPE((PyObject*)obj);\
    assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
    PyObject_GC_Del(obj);\
    Py_DECREF(type);\
}
#else
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  PyObject_GC_Del(obj)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((void)u, (0))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)u)
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GetLength(u))
#else
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_READY(op)       (0)
  #else
    #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                                0 : _PyUnicode_Ready((PyObject *)(op)))
  #endif
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         ((int)PyUnicode_KIND(u))
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #else
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
    #else
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
    #endif
  #endif
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #if !defined(PyUnicode_DecodeUnicodeEscape)
    #define PyUnicode_DecodeUnicodeEscape(s, size, errors)  PyUnicode_Decode(s, size, "unicode_escape", errors)
  #endif
  #if !defined(PyUnicode_Contains)
    #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  #endif
  #if !defined(PyByteArray_Check)
    #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  #endif
  #if !defined(PyObject_Format)
    #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  #endif
#endif
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#elif CYTHON_COMPILING_IN_CPYTHON
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
  #define __Pyx_PySequence_ListKeepNew(obj)  PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        __Pyx_IS_TYPE(obj, &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
enum __Pyx_ReferenceSharing {
  __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
  __Pyx_ReferenceSharing_OwnStrongReference,
  __Pyx_ReferenceSharing_FunctionArgument,
  __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
};
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
    (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
      (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
      (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
#else
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  #else
    #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
  #endif
#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
  #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
#else
  #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
    __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
#endif
#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared)  ((void)(unsafe_shared),\
      __Pyx_PyList_GetItemRef(o, i))
#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
      __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
      __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
  #else
  #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
      __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
      __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
  #endif
#elif CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared)  ((void)(unsafe_shared),\
      __Pyx_NewRef(PyList_GET_ITEM(o, i)))
#else
  #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared)  ((void)(unsafe_shared),\
      __Pyx_XNewRef(PyList_GetItem(o, i)))
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyObject_GetItem(dict, key);
  if (*result == NULL) {
    if (PyErr_ExceptionMatches(PyExc_KeyError)) {
      PyErr_Clear();
      return 0;
    }
    return -1;
  }
  return 1;
}
#else
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyDict_GetItemWithError(dict, key);
  if (*result == NULL) {
    return PyErr_Occurred() ? -1 : 0;
  }
  Py_INCREF(*result);
  return 1;
}
#endif
#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
  #define __Pyx_VISIT_CONST(obj)  Py_VISIT(obj)
#else
  #define __Pyx_VISIT_CONST(obj)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
#else
  #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
#endif
#if CYTHON_ASSUME_SAFE_SIZE
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
#else
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
#define __Pyx_PyLong_AsHash_t   __Pyx_PyIndex_AsSsize_t
#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
    #define __Pyx_PySendResult PySendResult
#else
    typedef enum {
        PYGEN_RETURN = 0,
        PYGEN_ERROR = -1,
        PYGEN_NEXT = 1,
    } __Pyx_PySendResult;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
  typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
#else
  #define __Pyx_pyiter_sendfunc sendfunc
#endif
#if !CYTHON_USE_AM_SEND
#define __PYX_HAS_PY_AM_SEND 0
#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
#define __PYX_HAS_PY_AM_SEND 1
#else
#define __PYX_HAS_PY_AM_SEND 2  // our own backported implementation
#endif
#if __PYX_HAS_PY_AM_SEND < 2
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#else
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
        __Pyx_pyiter_sendfunc am_send;
    } __Pyx_PyAsyncMethodsStruct;
    #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
#endif
#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
#else
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
#endif
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get()
#else
#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
#ifdef __cplusplus
extern "C"
#endif
PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
    int value;
    PyObject *py_value = PyObject_GetAttrString(inspect, name);
    if (!py_value) return 0;
    value = (int) PyLong_AsLong(py_value);
    Py_DECREF(py_value);
    *write_to = value;
    return value != -1 || !PyErr_Occurred();
}
static int __Pyx_init_co_variables(void) {
    PyObject *inspect;
    int result;
    inspect = PyImport_ImportModule("inspect");
    result =
#if !defined(CO_OPTIMIZED)
        __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
#endif
#if !defined(CO_NEWLOCALS)
        __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
#endif
#if !defined(CO_VARARGS)
        __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
#endif
#if !defined(CO_VARKEYWORDS)
        __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
#endif
#if !defined(CO_ASYNC_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
#endif
#if !defined(CO_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
#endif
#if !defined(CO_COROUTINE)
        __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
#endif
        1;
    Py_DECREF(inspect);
    return result ? 0 : -1;
}
#else
static int __Pyx_init_co_variables(void) {
    return 0;  // It's a limited API-only feature
}
#endif

/* MathInitCode */
#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
  #ifndef _USE_MATH_DEFINES
    #define _USE_MATH_DEFINES
  #endif
#endif
#include <math.h>
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0
#endif
#ifndef CYTHON_CLINE_IN_TRACEBACK
#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#endif
#if CYTHON_CLINE_IN_TRACEBACK
#define __PYX_MARK_ERR_POS(f_index, lineno)  { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
#else
#define __PYX_MARK_ERR_POS(f_index, lineno)  { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
#endif
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

#ifdef CYTHON_EXTERN_C
    #undef __PYX_EXTERN_C
    #define __PYX_EXTERN_C CYTHON_EXTERN_C
#elif defined(__PYX_EXTERN_C)
    #ifdef _MSC_VER
    #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
    #else
    #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
    #endif
#else
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__ws_package__utils__hardware_event_validator
#define __PYX_HAVE_API__ws_package__utils__hardware_event_validator
/* Early includes */
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifdef CYTHON_FREETHREADING_COMPATIBLE
#if CYTHON_FREETHREADING_COMPATIBLE
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
#else
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
#endif
#else
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
#endif
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
#else
    #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
#endif
#define __Pyx_PyObject_AsWritableString(s)    ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#define __Pyx_PyUnicode_FromOrdinal(o)       PyUnicode_FromOrdinal((int)o)
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
    return Py_NewRef(obj);
#else
    Py_INCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
    return Py_XNewRef(obj);
#else
    Py_XINCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
#else
#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
#endif
#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_VERSION_HEX >= 0x030C00A7
  #ifndef _PyLong_SIGN_MASK
    #define _PyLong_SIGN_MASK 3
  #endif
  #ifndef _PyLong_NON_SIZE_BITS
    #define _PyLong_NON_SIZE_BITS 3
  #endif
  #define __Pyx_PyLong_Sign(x)  (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
  #define __Pyx_PyLong_IsNeg(x)  ((__Pyx_PyLong_Sign(x) & 2) != 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (!__Pyx_PyLong_IsNeg(x))
  #define __Pyx_PyLong_IsZero(x)  (__Pyx_PyLong_Sign(x) & 1)
  #define __Pyx_PyLong_IsPos(x)  (__Pyx_PyLong_Sign(x) == 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  (__Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
  #define __Pyx_PyLong_SignedDigitCount(x)\
        ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
  #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
    #define __Pyx_PyLong_IsCompact(x)     PyUnstable_Long_IsCompact((PyLongObject*) x)
    #define __Pyx_PyLong_CompactValue(x)  PyUnstable_Long_CompactValue((PyLongObject*) x)
  #else
    #define __Pyx_PyLong_IsCompact(x)     (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
    #define __Pyx_PyLong_CompactValue(x)  ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  #endif
  typedef Py_ssize_t  __Pyx_compact_pylong;
  typedef size_t  __Pyx_compact_upylong;
  #else
  #define __Pyx_PyLong_IsNeg(x)  (Py_SIZE(x) < 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (Py_SIZE(x) >= 0)
  #define __Pyx_PyLong_IsZero(x)  (Py_SIZE(x) == 0)
  #define __Pyx_PyLong_IsPos(x)  (Py_SIZE(x) > 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  __Pyx_sst_abs(Py_SIZE(x))
  #define __Pyx_PyLong_SignedDigitCount(x)  Py_SIZE(x)
  #define __Pyx_PyLong_IsCompact(x)  (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
  #define __Pyx_PyLong_CompactValue(x)\
        ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
  typedef sdigit  __Pyx_compact_pylong;
  typedef digit  __Pyx_compact_upylong;
  #endif
  #if PY_VERSION_HEX >= 0x030C00A5
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->long_value.ob_digit)
  #else
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->ob_digit)
  #endif
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
#else
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
/* PretendToInitialize */
#ifdef __cplusplus
#if __cplusplus > 201103L
#include <type_traits>
#endif
template <typename T>
static void __Pyx_pretend_to_initialize(T* ptr) {
#if __cplusplus > 201103L
    if ((std::is_trivially_default_constructible<T>::value))
#endif
        *ptr = T();
    (void)ptr;
}
#else
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
#endif


#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_m = NULL;
#endif
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * const __pyx_cfilenm = __FILE__;
static const char *__pyx_filename;

/* #### Code section: filename_table ### */

static const char* const __pyx_f[] = {
  "ws_package/utils/hardware_event_validator.py",
};
/* #### Code section: utility_code_proto_before_types ### */
/* Atomics.proto (used by UnpackUnboundCMethod) */
#include <pythread.h>
#ifndef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 1
#endif
#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __pyx_atomic_int_type int
#define __pyx_nonatomic_int_type int
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__))
    #include <stdatomic.h>
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)))
    #include <atomic>
#endif
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__) &&\
                       ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type atomic_int
    #define __pyx_atomic_ptr_type atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) atomic_load(value)
    #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C atomics"
    #endif
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
                    ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type std::atomic_int
    #define __pyx_atomic_ptr_type std::atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) std::atomic_load(value)
    #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C++ atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C++ atomics"
    #endif
#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
                    (__GNUC_MINOR__ > 1 ||\
                    (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
    #define __pyx_atomic_ptr_type void*
    #define __pyx_nonatomic_ptr_type void*
    #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
    #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
    static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
        __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using GNU atomics"
    #endif
#elif CYTHON_ATOMICS && defined(_MSC_VER)
    #include <intrin.h>
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type long
    #define __pyx_atomic_ptr_type void*
    #undef __pyx_nonatomic_int_type
    #define __pyx_nonatomic_int_type long
    #define __pyx_nonatomic_ptr_type void*
    #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
    #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
    #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
    #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
    #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
    static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
        __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #ifdef __PYX_DEBUG_ATOMICS
        #pragma message ("Using MSVC atomics")
    #endif
#else
    #undef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 0
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Not using atomics"
    #endif
#endif

/* CriticalSectionsDefinition.proto (used by CriticalSections) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection void*
#define __Pyx_PyCriticalSection2 void*
#define __Pyx_PyCriticalSection_End(cs)
#define __Pyx_PyCriticalSection2_End(cs)
#else
#define __Pyx_PyCriticalSection PyCriticalSection
#define __Pyx_PyCriticalSection2 PyCriticalSection2
#define __Pyx_PyCriticalSection_End PyCriticalSection_End
#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
#endif

/* CriticalSections.proto (used by ParseKeywordsImpl) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
#else
#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
#endif
#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
#define __Pyx_END_CRITICAL_SECTION() }
#else
#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
#endif

/* IncludeStructmemberH.proto (used by FixUpExtensionType) */
#include <structmember.h>

/* #### Code section: numeric_typedefs ### */
/* #### Code section: complex_type_declarations ### */
/* #### Code section: type_declarations ### */

/*--- Type declarations ---*/
struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread;
struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos;
struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes;
struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr;
struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes;
struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr;
struct __pyx_ctuple_int__and_int;
typedef struct __pyx_ctuple_int__and_int __pyx_ctuple_int__and_int;

/* "ws_package/utils/hardware_event_validator.py":1141
 *                 time.sleep(2.0)
 * 
 *     def _linux_drain_evdev(self) -> Tuple[bool, bool]:             # <<<<<<<<<<<<<<
 *         """Synchronously drain pending evdev events (called when pynput fires)."""
 *         if not self._linux_open_devices:
*/
struct __pyx_ctuple_int__and_int {
  int f0;
  int f1;
};

/* "ws_package/utils/hardware_event_validator.py":303
 *         )
 * 
 *     def _windows_hook_thread(self, ready_event: threading.Event, ok_flag: list):             # <<<<<<<<<<<<<<
 *         """
 *         Dedicated thread that INSTALLS and PUMPS low-level Windows hooks.
*/
struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread {
  PyObject_HEAD
  long __pyx_v_HC_ACTION;
  PyObject *__pyx_v_KBDLLHOOKSTRUCT;
  long __pyx_v_LLKHF_INJECTED;
  long __pyx_v_LLMHF_INJECTED;
  PyObject *__pyx_v_MSLLHOOKSTRUCT;
  PyObject *__pyx_v_RAWINPUTHEADER;
  PyObject *__pyx_v_RAWMOUSE;
  long __pyx_v_RID_INPUT;
  long __pyx_v_RIM_TYPEMOUSE;
  long __pyx_v_WM_KEYDOWN;
  long __pyx_v_WM_KEYUP;
  long __pyx_v_WM_MOUSEHWHEEL;
  long __pyx_v_WM_MOUSEWHEEL;
  long __pyx_v_WM_SYSKEYDOWN;
  long __pyx_v_WM_SYSKEYUP;
  PyObject *__pyx_v__raw_input_header_size;
  PyObject *__pyx_v_self;
  PyObject *__pyx_v_user32;
};


/* "ws_package/utils/hardware_event_validator.py":608
 *             ready_event.set()
 * 
 *     def _initialize_macos(self):             # <<<<<<<<<<<<<<
 *         """Initialize macOS CGEvent API for event validation"""
 *         try:
*/
struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos {
  PyObject_HEAD
  PyObject *__pyx_v_kCGEventKeyDown;
  PyObject *__pyx_v_kCGEventKeyUp;
  PyObject *__pyx_v_kCGEventLeftMouseDown;
  PyObject *__pyx_v_kCGEventMouseMoved;
  PyObject *__pyx_v_kCGEventRightMouseDown;
  long __pyx_v_kCGEventSourceStateID;
  PyObject *__pyx_v_quartz;
  PyObject *__pyx_v_self;
};


/* "ws_package/utils/hardware_event_validator.py":935
 *         return active
 * 
 *     def _scan_linux_automation_processes(self) -> bool:             # <<<<<<<<<<<<<<
 *         own_pid = os.getpid()
 *         for cmdline_path in glob.glob('/proc/[0-9]*[inserted by cython to avoid comment closer]/cmdline'):
*/
struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes {
  PyObject_HEAD
  PyObject *__pyx_v_cmdline;
};


/* "ws_package/utils/hardware_event_validator.py":949
 *             except OSError:
 *                 continue
 *             if any(marker in cmdline for marker in self._automation_markers):             # <<<<<<<<<<<<<<
 *                 return True
 *         return False
*/
struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr {
  PyObject_HEAD
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_marker;
};


/* "ws_package/utils/hardware_event_validator.py":953
 *         return False
 * 
 *     def _scan_windows_automation_processes(self) -> bool:             # <<<<<<<<<<<<<<
 *         own_pid = os.getpid()
 *         try:
*/
struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes {
  PyObject_HEAD
  PyObject *__pyx_v_haystack;
};


/* "ws_package/utils/hardware_event_validator.py":966
 *                 name = (proc.info['name'] or '').lower()
 *                 haystack = f"{cmdline} {name}"
 *                 if any(marker in haystack for marker in self._automation_markers):             # <<<<<<<<<<<<<<
 *                     return True
 *             except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
*/
struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr {
  PyObject_HEAD
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_marker;
};

/* #### Code section: utility_code_proto ### */

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, Py_ssize_t);
    void (*DECREF)(void*, PyObject*, Py_ssize_t);
    void (*GOTREF)(void*, PyObject*, Py_ssize_t);
    void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
    void* (*SetupContext)(const char*, Py_ssize_t, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
          }
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_XINCREF(r)  do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContextNogil()
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_Py_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; Py_XDECREF(tmp);\
    } while (0)
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

/* PyErrExceptionMatches.proto (used by PyObjectGetAttrStrNoError) */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* PyThreadStateGet.proto (used by PyErrFetchRestore) */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#if PY_VERSION_HEX >= 0x030C00A6
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->current_exception != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
#else
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->curexc_type != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->curexc_type)
#endif
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  (PyErr_Occurred() != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto (used by PyObjectGetAttrStrNoError) */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

/* PyObjectGetAttrStr.proto (used by PyObjectGetAttrStrNoError) */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* PyObjectGetAttrStrNoError.proto (used by GetBuiltinName) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* TupleAndListFromArray.proto (used by fastcall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
#endif
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
#endif

/* IncludeStringH.proto (used by BytesEquals) */
#include <string.h>

/* BytesEquals.proto (used by UnicodeEquals) */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

/* UnicodeEquals.proto (used by fastcall) */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

/* fastcall.proto */
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
#else
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
#endif
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
#if CYTHON_METH_FASTCALL
    #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
    #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
    #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
    static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  #else
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  #endif
#else
    #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
    #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
    #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
    #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
    #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
#endif
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#if CYTHON_METH_FASTCALL
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
#else
#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
#endif

/* py_dict_items.proto (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);

/* CallCFunction.proto (used by CallUnboundCMethod0) */
#define __Pyx_CallCFunction(cfunc, self, args)\
    ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
    ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
    ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
    ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)

/* PyObjectCall.proto (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* PyObjectCallMethO.proto (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectFastCall.proto (used by PyObjectCallOneArg) */
#define __Pyx_PyObject_FastCall(func, args, nargs)  __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs);

/* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
typedef struct {
    PyObject *type;
    PyObject **method_name;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
    __pyx_atomic_int_type initialized;
#endif
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
#if !CYTHON_ATOMICS
    return 1;
#else
    __pyx_nonatomic_int_type expected = 0;
    if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
        return 0;
    }
    return expected;
#endif
}
static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
#if CYTHON_ATOMICS
    __pyx_atomic_store(&cfunc->initialized, 2);
#endif
}
#else
#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
#endif

/* CallUnboundCMethod0.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

/* py_dict_values.proto (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);

/* OwnedDictNext.proto (used by ParseKeywordsImpl) */
#if CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
#else
CYTHON_INLINE
static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
#endif

/* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywordsImpl.export */
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name
);
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);

/* CallUnboundCMethod2.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
#else
#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2)  __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
#endif

/* ParseKeywords.proto */
static CYTHON_INLINE int __Pyx_ParseKeywords(
    PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[],
    PyObject *kwds2, PyObject *values[],
    Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);

/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

/* PyObjectDelAttr.proto (used by PyObjectSetAttrStr) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
#else
#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
#endif

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   __Pyx_PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* PyDictVersioning.proto (used by GetModuleGlobalName) */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  do {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  do {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

/* PyObjectVectorCallKwBuilder.proto */
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#if CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall
#endif
#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n)
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict
#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n)
#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value)
#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value)
#endif

/* GetTopmostException.proto (used by SaveResetException) */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* PyObjectFastCallMethod.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
#else
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
#endif

/* PySequenceContains.proto */
static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* DictGetItem.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
    (likely(PyDict_CheckExact(obj)) ?\
     __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
#endif

/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* HasAttr.proto */
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_HasAttr(o, n)  PyObject_HasAttrWithError(o, n)
#else
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
#endif

/* PyObjectVectorCallMethodKwBuilder.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_VectorcallMethod_CallFromBuilder PyObject_VectorcallMethod
#else
static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#endif

/* PyObjectLookupSpecial.proto */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
#define __Pyx_PyObject_LookupSpecial(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
#else
#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

/* ArgTypeTestFunc.export */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
        __Pyx__ArgTypeTest(obj, type, name, exact))

/* RaiseClosureNameError.proto */
static void __Pyx_RaiseClosureNameError(const char *varname);

/* ListAppend.proto (used by append) */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
        L->ob_item[len] = x;
        #else
        PyList_SET_ITEM(list, len, x);
        #endif
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* PyObjectCall2Args.proto (used by PyObjectCallMethod1) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyObjectGetMethod.proto (used by PyObjectCallMethod1) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
#endif

/* PyObjectCallMethod1.proto (used by append) */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* append.proto */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

/* Py3UpdateBases.proto */
static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);

/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

/* SetNameInClass.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
#elif CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
#else
#define __Pyx_SetNameInClass(ns, name, value)  PyObject_SetItem(ns, name, value)
#endif

/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

/* dict_setdefault.proto (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);

/* LimitedApiGetTypeDict.proto (used by SetItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp);
#endif

/* SetItemOnTypeDict.proto (used by FixUpExtensionType) */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)

/* FixUpExtensionType.proto (used by FetchCommonType) */
static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);

/* AddModuleRef.proto (used by FetchSharedCythonModule) */
#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING ) ||\
     __PYX_LIMITED_VERSION_HEX < 0x030d0000)
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
#else
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#endif

/* FetchSharedCythonModule.proto (used by FetchCommonType) */
static PyObject *__Pyx_FetchSharedCythonABIModule(void);

/* FetchCommonType.proto (used by CommonTypesMetaclass) */
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);

/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
static int __pyx_CommonTypesMetaclass_init(PyObject *module);
#define __Pyx_CommonTypesMetaclass_USED

/* CallTypeTraverse.proto (used by CythonFunctionShared) */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
#endif

/* PyMethodNew.proto (used by CythonFunctionShared) */
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);

/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
#endif

/* CythonFunctionShared.proto (used by CythonFunction) */
#define __Pyx_CyFunction_USED
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CYFUNCTION_COROUTINE     0x08
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_CyFunction_GetClassObj(f)\
      (((__pyx_CyFunctionObject *) (f))->func_classobj)
#else
  #define __Pyx_CyFunction_GetClassObj(f)\
      ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
#endif
#define __Pyx_CyFunction_SetClassObj(f, classobj)\
    __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject_HEAD
    PyObject *func;
#elif PY_VERSION_HEX < 0x030900B1
    PyCFunctionObject func;
#else
    PyCMethodObject func;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL
    __pyx_vectorcallfunc func_vectorcall;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_weakreflist;
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_dict;
#endif
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_classobj;
#endif
    PyObject *defaults;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
    PyObject *func_is_coroutine;
} __pyx_CyFunctionObject;
#undef __Pyx_CyOrPyCFunction_Check
#define __Pyx_CyFunction_Check(obj)  __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
#define __Pyx_CyOrPyCFunction_Check(obj)  __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
#define __Pyx_CyFunction_CheckExact(obj)  __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
#undef __Pyx_IsSameCFunction
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCyOrCFunction(func, cfunc)
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
                                                         PyTypeObject *defaults_type);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(PyObject *module);
#if CYTHON_METH_FASTCALL
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
#else
#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
#endif
#endif

/* CythonFunction.proto */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);

/* SetItemInt.proto */
#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck, unsafe_shared) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
               __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
                                               int is_list, int wraparound, int boundscheck, int unsafe_shared);

/* PyLongCompare.proto */
static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* ImportImpl.export */
static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level);

/* Import.proto */
static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);

/* PyImportError_Check.proto */
#define __Pyx_PyExc_ImportError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_ImportError)

/* PyLongCompare.proto */
static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* RaiseUnexpectedTypeError.proto */
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* PyRange_Check.proto */
#if CYTHON_COMPILING_IN_PYPY && !defined(PyRange_Check)
  #define PyRange_Check(obj)  __Pyx_TypeCheck((obj), &PyRange_Type)
#endif

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck, unsafe_shared) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck, int unsafe_shared);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck, int unsafe_shared);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck, int unsafe_shared);

/* ObjectGetItem.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
#else
#define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
#endif

/* RaiseUnboundLocalError.proto */
static void __Pyx_RaiseUnboundLocalError(const char *varname);

/* pep479.proto */
static void __Pyx_Generator_Replace_StopIteration(int in_async_gen);

/* PyIndexError_Check.proto */
#define __Pyx_PyExc_IndexError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_IndexError)

/* PyValueError_Check.proto */
#define __Pyx_PyExc_ValueError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_ValueError)

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
    return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
}
#endif
#define __Pyx_PyErr_ExceptionMatches2(err1, err2)  __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#ifdef PyExceptionInstance_Check
  #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj)
#else
  #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException)
#endif

/* PyOSError_Check.proto */
#define __Pyx_PyExc_OSError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_OSError)

/* PyUnicodeContains.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_ContainsTF(PyObject* substring, PyObject* text, int eq) {
    int result = PyUnicode_Contains(text, substring);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* PyObjectFormatSimple.proto */
#if CYTHON_COMPILING_IN_PYPY
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#elif CYTHON_USE_TYPE_SLOTS
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
        likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
        PyObject_Format(s, f))
#else
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#endif

/* JoinPyUnicode.export */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char);

/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* PyPermissionError_Check.proto */
#define __Pyx_PyExc_PermissionError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_PermissionError)

/* pyint_simplify.proto */
static CYTHON_INLINE int __Pyx_PyInt_FromNumber(PyObject **number_var, const char *argname, int accept_none);

/* py_dict_keys.proto */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d);

/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);

/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

/* AssertionsEnabled.proto */
#if CYTHON_COMPILING_IN_LIMITED_API  ||  PY_VERSION_HEX >= 0x030C0000
  static int __pyx_assertions_enabled_flag;
  #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
  #if __clang__ || __GNUC__
  __attribute__((no_sanitize("thread")))
  #endif
  static int __Pyx_init_assertions_enabled(void) {
    PyObject *builtins, *debug, *debug_str;
    int flag;
    builtins = PyEval_GetBuiltins();
    if (!builtins) goto bad;
    debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
    if (!debug_str) goto bad;
    debug = PyObject_GetItem(builtins, debug_str);
    Py_DECREF(debug_str);
    if (!debug) goto bad;
    flag = PyObject_IsTrue(debug);
    Py_DECREF(debug);
    if (flag == -1) goto bad;
    __pyx_assertions_enabled_flag = flag;
    return 0;
  bad:
    __pyx_assertions_enabled_flag = 1;
    return -1;
  }
#else
  #define __Pyx_init_assertions_enabled()  (0)
  #define __pyx_assertions_enabled()  (!Py_OptimizeFlag)
#endif

/* PyAssertionError_Check.proto */
#define __Pyx_PyExc_AssertionError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_AssertionError)

/* RaiseException.export */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* PyObjectCallNoArg.proto (used by pyfrozenset_new) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);

/* pyfrozenset_new.proto (used by PySetContains) */
static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it);

/* PySetContains.proto */
static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq);

/* PyFileNotFoundError_Check.proto */
#define __Pyx_PyExc_FileNotFoundError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_FileNotFoundError)

/* PyBlockingIOError_Check.proto */
#define __Pyx_PyExc_BlockingIOError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_BlockingIOError)

/* dict_getitem_default.proto */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);

/* CallUnboundCMethod1.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#else
#define __Pyx_CallUnboundCMethod1(cfunc, self, arg)  __Pyx__CallUnboundCMethod1(cfunc, self, arg)
#endif

/* pybytes_as_double.proto (used by pynumber_float) */
static double __Pyx_SlowPyString_AsDouble(PyObject *obj);
static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length);
static CYTHON_INLINE double __Pyx_PyBytes_AsDouble(PyObject *obj) {
    char* as_c_string;
    Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
    as_c_string = PyBytes_AS_STRING(obj);
    size = PyBytes_GET_SIZE(obj);
#else
    if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) {
        return (double)-1;
    }
#endif
    return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
}
static CYTHON_INLINE double __Pyx_PyByteArray_AsDouble(PyObject *obj) {
    char* as_c_string;
    Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
    as_c_string = PyByteArray_AS_STRING(obj);
    size = PyByteArray_GET_SIZE(obj);
#else
    as_c_string = PyByteArray_AsString(obj);
    if (as_c_string == NULL) {
        return (double)-1;
    }
    size = PyByteArray_Size(obj);
#endif
    return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
}

/* pyunicode_as_double.proto (used by pynumber_float) */
#if !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
static const char* __Pyx__PyUnicode_AsDouble_Copy(const void* data, const int kind, char* buffer, Py_ssize_t start, Py_ssize_t end) {
    int last_was_punctuation;
    Py_ssize_t i;
    last_was_punctuation = 1;
    for (i=start; i <= end; i++) {
        Py_UCS4 chr = PyUnicode_READ(kind, data, i);
        int is_punctuation = (chr == '_') | (chr == '.');
        *buffer = (char)chr;
        buffer += (chr != '_');
        if (unlikely(chr > 127)) goto parse_failure;
        if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure;
        last_was_punctuation = is_punctuation;
    }
    if (unlikely(last_was_punctuation)) goto parse_failure;
    *buffer = '\0';
    return buffer;
parse_failure:
    return NULL;
}
static double __Pyx__PyUnicode_AsDouble_inf_nan(const void* data, int kind, Py_ssize_t start, Py_ssize_t length) {
    int matches = 1;
    Py_UCS4 chr;
    Py_UCS4 sign = PyUnicode_READ(kind, data, start);
    int is_signed = (sign == '-') | (sign == '+');
    start += is_signed;
    length -= is_signed;
    switch (PyUnicode_READ(kind, data, start)) {
        #ifdef Py_NAN
        case 'n':
        case 'N':
            if (unlikely(length != 3)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+1);
            matches &= (chr == 'a') | (chr == 'A');
            chr = PyUnicode_READ(kind, data, start+2);
            matches &= (chr == 'n') | (chr == 'N');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_NAN : Py_NAN;
        #endif
        case 'i':
        case 'I':
            if (unlikely(length < 3)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+1);
            matches &= (chr == 'n') | (chr == 'N');
            chr = PyUnicode_READ(kind, data, start+2);
            matches &= (chr == 'f') | (chr == 'F');
            if (likely(length == 3 && matches))
                return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
            if (unlikely(length != 8)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+3);
            matches &= (chr == 'i') | (chr == 'I');
            chr = PyUnicode_READ(kind, data, start+4);
            matches &= (chr == 'n') | (chr == 'N');
            chr = PyUnicode_READ(kind, data, start+5);
            matches &= (chr == 'i') | (chr == 'I');
            chr = PyUnicode_READ(kind, data, start+6);
            matches &= (chr == 't') | (chr == 'T');
            chr = PyUnicode_READ(kind, data, start+7);
            matches &= (chr == 'y') | (chr == 'Y');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
        case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
            break;
        default:
            goto parse_failure;
    }
    return 0.0;
parse_failure:
    return -1.0;
}
static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) {
    double value;
    const char *last;
    char *end;
    Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj);
    const int kind = PyUnicode_KIND(obj);
    const void* data = PyUnicode_DATA(obj);
    start = 0;
    while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start)))
        start++;
    while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1)))
        length--;
    length -= start;
    if (unlikely(length <= 0)) goto fallback;
    value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length);
    if (unlikely(value == -1.0)) goto fallback;
    if (value != 0.0) return value;
    if (length < 40) {
        char number[40];
        last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
        if (unlikely(!last)) goto fallback;
        value = PyOS_string_to_double(number, &end, NULL);
    } else {
        char *number = (char*) PyMem_Malloc((length + 1) * sizeof(char));
        if (unlikely(!number)) goto fallback;
        last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
        if (unlikely(!last)) {
            PyMem_Free(number);
            goto fallback;
        }
        value = PyOS_string_to_double(number, &end, NULL);
        PyMem_Free(number);
    }
    if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
        return value;
    }
fallback:
    return __Pyx_SlowPyString_AsDouble(obj);
}
#endif
static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) {
#if !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(__Pyx_PyUnicode_READY(obj) == -1))
        return (double)-1;
    if (likely(PyUnicode_IS_ASCII(obj))) {
        const char *s;
        Py_ssize_t length;
        s = PyUnicode_AsUTF8AndSize(obj, &length);
        return __Pyx__PyBytes_AsDouble(obj, s, length);
    }
    return __Pyx_PyUnicode_AsDouble_WithSpaces(obj);
#else
    return __Pyx_SlowPyString_AsDouble(obj);
#endif
}

/* pynumber_float.proto */
static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj);
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : __Pyx__PyNumber_Float(x))

/* CheckTypeForFreelists.proto */
#if CYTHON_USE_FREELISTS
#if CYTHON_USE_TYPE_SPECS
#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t) == (expected_tp)))
#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS  Py_TPFLAGS_IS_ABSTRACT
#else
#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t)->tp_basicsize == (expected_size)))
#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS  (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)
#endif
#define __PYX_CHECK_TYPE_FOR_FREELISTS(t, expected_tp, expected_size)\
    (__PYX_CHECK_FINAL_TYPE_FOR_FREELISTS((t), (expected_tp), (expected_size)) &\
     (int) (!__Pyx_PyType_HasFeature((t), __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS)))
#endif

/* AllocateExtensionType.proto */
static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final);

/* PyObjectCallMethod0.proto (used by PyType_Ready) */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

/* ValidateBasesTuple.proto (used by PyType_Ready) */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
#endif

/* PyType_Ready.proto */
CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);

/* CLineInTraceback.proto (used by AddTraceback) */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#else
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#endif

/* CodeObjectCache.proto (used by AddTraceback) */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject __Pyx_CachedCodeObjectType;
#else
typedef PyCodeObject __Pyx_CachedCodeObjectType;
#endif
typedef struct {
    __Pyx_CachedCodeObjectType* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_int_type accessor_count;
  #endif
};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

/* GCCDiagnostics.proto */
#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);

/* FormatTypeName.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName
#else
static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
#endif
#else  // !LIMITED_API
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
#define __Pyx_DECREF_TypeName(obj)
#endif

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *);

/* GetRuntimeVersion.proto */
#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
static unsigned long __Pyx_cached_runtime_version = 0;
static void __Pyx_init_runtime_version(void);
#else
#define __Pyx_init_runtime_version()
#endif
static unsigned long __Pyx_get_runtime_version(void);

/* IterNextPlain.proto (used by CoroutineBase) */
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator);
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void);
#endif

/* ReturnWithStopIteration.proto (used by CoroutineBase) */
static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext);

/* CoroutineBase.proto (used by Generator) */
struct __pyx_CoroutineObject;
typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
typedef struct {
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif
typedef struct __pyx_CoroutineObject {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *gi_weakreflist;
#endif
    PyObject *classobj;
    PyObject *yieldfrom;
    __Pyx_pyiter_sendfunc yieldfrom_am_send;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    PyObject *gi_frame;
#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE)
    PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count];
    uint64_t __pyx_pymonitoring_version;
#endif
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name);
static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
static int __Pyx_Coroutine_clear(PyObject *self);
static __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_Coroutine_SwapException(self)
#define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
#else
#define __Pyx_Coroutine_SwapException(self) {\
    __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
    __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
    }
#define __Pyx_Coroutine_ResetAndClearException(self) {\
    __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
    (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
    }
#endif
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
#endif
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen);
static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen);
static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen);
static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure);
#if __PYX_HAS_PY_AM_SEND == 2
static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send);
#endif
static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg);

/* Generator.proto */
#define __Pyx_Generator_USED
#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_GeneratorType)
#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(PyObject *module);
static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);

/* DecompressString.proto */
static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);

/* MultiPhaseInitModuleState.proto */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
static PyObject *__Pyx_State_FindModule(void*);
static int __Pyx_State_AddModule(PyObject* module, void*);
static int __Pyx_State_RemoveModule(void*);
#elif CYTHON_USE_MODULE_STATE
#define __Pyx_State_FindModule PyState_FindModule
#define __Pyx_State_AddModule PyState_AddModule
#define __Pyx_State_RemoveModule PyState_RemoveModule
#endif

/* #### Code section: module_declarations ### */
/* CythonABIVersion.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
    #if CYTHON_METH_FASTCALL
        #define __PYX_FASTCALL_ABI_SUFFIX  "_fastcall"
    #else
        #define __PYX_FASTCALL_ABI_SUFFIX
    #endif
    #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#else
    #define __PYX_LIMITED_ABI_SUFFIX
#endif
#if __PYX_HAS_PY_AM_SEND == 1
    #define __PYX_AM_SEND_ABI_SUFFIX
#elif __PYX_HAS_PY_AM_SEND == 2
    #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
#else
    #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
#endif
#ifndef __PYX_MONITORING_ABI_SUFFIX
    #define __PYX_MONITORING_ABI_SUFFIX
#endif
#if CYTHON_USE_TP_FINALIZE
    #define __PYX_TP_FINALIZE_ABI_SUFFIX
#else
    #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
#endif
#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
    #define __PYX_FREELISTS_ABI_SUFFIX
#else
    #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
#endif
#define CYTHON_ABI  __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."


/* Module declarations from "ws_package.utils.hardware_event_validator" */
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "ws_package.utils.hardware_event_validator"
extern int __pyx_module_is_main_ws_package__utils__hardware_event_validator;
int __pyx_module_is_main_ws_package__utils__hardware_event_validator = 0;

/* Implementation of "ws_package.utils.hardware_event_validator" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_open;
/* #### Code section: string_decls ### */
static const char __pyx_k_Hardware_Event_Validator_Detect[] = "\nHardware Event Validator - Detects and filters synthetic input events\n\nThis module provides platform-specific validation to distinguish between\nhardware-originated input events and synthetic events from automation tools.\n\nReturn Value Contract:\n- True: Confirmed hardware event (count it)\n- False: Confirmed synthetic event (filter it)\n- None: Unknown/unavailable (ACCEPT and count it - fail-safe default)\n";
/* #### Code section: decls ### */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_2__del__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_4cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_6_linux_teardown_monitors(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_8_linux_reset_timestamps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_10reinitialize_linux(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_12_initialize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_14_initialize_windows(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_low_level_keyboard_proc(PyObject *__pyx_self, PyObject *__pyx_v_nCode, PyObject *__pyx_v_wParam, PyObject *__pyx_v_lParam); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_2low_level_mouse_proc(PyObject *__pyx_self, PyObject *__pyx_v_nCode, PyObject *__pyx_v_wParam, PyObject *__pyx_v_lParam); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_4record_raw_mouse_input(PyObject *__pyx_self, PyObject *__pyx_v_lParam); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_16_windows_hook_thread(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ready_event, PyObject *__pyx_v_ok_flag); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_17_initialize_macos_event_tap_callback(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_proxy, PyObject *__pyx_v_event_type, PyObject *__pyx_v_event, CYTHON_UNUSED PyObject *__pyx_v_user_info); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_18_initialize_macos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_initialize_linux(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_22_linux_xinput_binary(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_24_linux_discover_xtest_device_ids(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_26_linux_discover_xtest_device_ids_ctypes(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_28_automation_process_active(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_32_scan_linux_automation_processes_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_30_scan_linux_automation_processes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_34_scan_windows_automation_processes_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_32_scan_windows_automation_processes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_34_linux_automation_process_active(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_36_linux_open_evdev_devices(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_38_start_linux_evdev_reader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_40_linux_evdev_reader_thread(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_42_start_linux_xinput_monitor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_44_linux_xinput_monitor_thread(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_46_linux_drain_evdev(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_48is_enabled(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_50classify_macos_cg_event(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_52should_count_activity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_is_hardware, PyObject *__pyx_v_input_kind); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_54should_count_macos_cg_event(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_input_kind); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_56_notify_synthetic_input_filtered(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_kind); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_58is_hardware_keyboard_event(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_60drain_windows_keyboard_events(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_62is_hardware_scroll_event(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_64get_last_hw_scroll_timestamp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_66is_hardware_mouse_event(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_68is_hardware_mouse_move_event(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_70_resolve_windows_input(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, double __pyx_v_hw_ts, double __pyx_v_syn_ts); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_72_check_windows_keyboard(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_74_check_windows_mouse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_76_check_windows_mouse_move(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_78_check_windows_scroll(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_80_check_macos_keyboard(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_82_check_macos_mouse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_84_linux_ts_recent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, double __pyx_v_ts, double __pyx_v_now); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_86_check_linux_input_event(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_kind); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_88_check_linux_keyboard(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_90_check_linux_mouse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_get_hardware_validator(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_2cleanup_hardware_validator(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
/* SmallCodeConfig */
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  PyObject *__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread;
  PyObject *__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos;
  PyObject *__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes;
  PyObject *__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr;
  PyObject *__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes;
  PyObject *__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr;
  PyTypeObject *__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread;
  PyTypeObject *__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos;
  PyTypeObject *__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes;
  PyTypeObject *__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr;
  PyTypeObject *__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes;
  PyTypeObject *__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
  PyObject *__pyx_tuple[8];
  PyObject *__pyx_codeobj_tab[54];
  PyObject *__pyx_string_tab[722];
  PyObject *__pyx_number_tab[33];
/* #### Code section: module_state_contents ### */
/* CommonTypesMetaclass.module_state_decls */
PyTypeObject *__pyx_CommonTypesMetaclassType;

/* CachedMethodType.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *__Pyx_CachedMethodType;
#endif

/* CythonFunctionShared.module_state_decls */
PyTypeObject *__pyx_CyFunctionType;


#if CYTHON_USE_FREELISTS
struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *__pyx_freelist_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread[8];
int __pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos *__pyx_freelist_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos[8];
int __pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes *__pyx_freelist_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes[8];
int __pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr *__pyx_freelist_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr[8];
int __pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes *__pyx_freelist_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes[8];
int __pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr *__pyx_freelist_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr[8];
int __pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr;
#endif
/* CodeObjectCache.module_state_decls */
struct __Pyx_CodeObjectCache __pyx_code_cache;

/* IterNextPlain.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache;
#endif

/* Generator.module_state_decls */
PyTypeObject *__pyx_GeneratorType;

/* #### Code section: module_state_end ### */
} __pyx_mstatetype;

#if CYTHON_USE_MODULE_STATE
#ifdef __cplusplus
namespace {
extern struct PyModuleDef __pyx_moduledef;
} /* anonymous namespace */
#else
static struct PyModuleDef __pyx_moduledef;
#endif

#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))

#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
#else
static __pyx_mstatetype __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: constant_name_defines ### */
#define __pyx_kp_u_ __pyx_string_tab[0]
#define __pyx_kp_u_Automation_process_scan_failed_s __pyx_string_tab[1]
#define __pyx_kp_u_CGEventTapEnable_failed_acceptin __pyx_string_tab[2]
#define __pyx_kp_u_CGEventTap_creation_failed_may_n __pyx_string_tab[3]
#define __pyx_kp_u_Cannot_open_Linux_input_device_s __pyx_string_tab[4]
#define __pyx_kp_u_Could_not_create_CGEventTap_s_ac __pyx_string_tab[5]
#define __pyx_kp_u_Could_not_discover_XTEST_device __pyx_string_tab[6]
#define __pyx_kp_u_Could_not_drain_Windows_keyboard __pyx_string_tab[7]
#define __pyx_kp_u_Could_not_load_Quartz_framework __pyx_string_tab[8]
#define __pyx_kp_u_EVENT_type_d __pyx_string_tab[9]
#define __pyx_kp_u_Error_cleaning_up_Windows_hooks __pyx_string_tab[10]
#define __pyx_kp_u_Error_cleaning_up_global_hardwar __pyx_string_tab[11]
#define __pyx_kp_u_Error_cleaning_up_macOS_event_ta __pyx_string_tab[12]
#define __pyx_kp_u_Error_opening_Linux_input_device __pyx_string_tab[13]
#define __pyx_kp_u_Failed_to_initialize_Linux_hardw __pyx_string_tab[14]
#define __pyx_kp_u_Failed_to_initialize_hardware_ev __pyx_string_tab[15]
#define __pyx_kp_u_Failed_to_initialize_macOS_hardw __pyx_string_tab[16]
#define __pyx_kp_u_Failed_to_install_Windows_hooks __pyx_string_tab[17]
#define __pyx_kp_u_Fake_activity_detected_s_input_b __pyx_string_tab[18]
#define __pyx_kp_u_Fake_activity_ignored_s_input_bl __pyx_string_tab[19]
#define __pyx_kp_u_Falling_back_to_accepting_all_ev __pyx_string_tab[20]
#define __pyx_kp_u_Global_hardware_validator_cleane __pyx_string_tab[21]
#define __pyx_kp_u_Hardware_event_validation_disabl __pyx_string_tab[22]
#define __pyx_kp_u_Hardware_event_validation_not_su __pyx_string_tab[23]
#define __pyx_kp_u_Hardware_hook_thread_error_s __pyx_string_tab[24]
#define __pyx_kp_u_Hardware_mouse_move_validation_e __pyx_string_tab[25]
#define __pyx_kp_u_Hardware_scroll_validation_error __pyx_string_tab[26]
#define __pyx_kp_u_Hardware_validation_error_accept __pyx_string_tab[27]
#define __pyx_kp_u_Linux_X11_hardware_validation_in __pyx_string_tab[28]
#define __pyx_kp_u_Linux_X11_input_monitor_error_s __pyx_string_tab[29]
#define __pyx_kp_u_Linux_X11_input_monitor_started __pyx_string_tab[30]
#define __pyx_kp_u_Linux_X11_input_monitor_stopped __pyx_string_tab[31]
#define __pyx_kp_u_Linux_evdev_background_reader_st __pyx_string_tab[32]
#define __pyx_kp_u_Linux_evdev_hardware_path_ready __pyx_string_tab[33]
#define __pyx_kp_u_Linux_evdev_no_keyboard_mouse_de __pyx_string_tab[34]
#define __pyx_kp_u_Linux_evdev_opened_s_s __pyx_string_tab[35]
#define __pyx_kp_u_Linux_evdev_read_error_on_s_s __pyx_string_tab[36]
#define __pyx_kp_u_Linux_evdev_reader_error_s __pyx_string_tab[37]
#define __pyx_kp_u_Linux_hardware_validation_reinit __pyx_string_tab[38]
#define __pyx_kp_u_Linux_hardware_validation_unavai __pyx_string_tab[39]
#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[40]
#define __pyx_kp_u_Optional_bool __pyx_string_tab[41]
#define __pyx_kp_u_Optional_str __pyx_string_tab[42]
#define __pyx_kp_u_RegisterRawInputDevices_failed_e __pyx_string_tab[43]
#define __pyx_kp_u_Reinitializing_Linux_hardware_va __pyx_string_tab[44]
#define __pyx_kp_u_SendInput_AutoHotkey_on_Windows __pyx_string_tab[45]
#define __pyx_kp_u_SetWindowsHookExW_WH_KEYBOARD_LL __pyx_string_tab[46]
#define __pyx_kp_u_Set_int __pyx_string_tab[47]
#define __pyx_kp_u_System_Library_Frameworks_Appli __pyx_string_tab[48]
#define __pyx_kp_u_Tuple_bool_bool __pyx_string_tab[49]
#define __pyx_kp_u_Validates_whether_input_events __pyx_string_tab[50]
#define __pyx_kp_u_Windows_Raw_Input_mouse_sink_reg __pyx_string_tab[51]
#define __pyx_kp_u_Windows_Raw_Input_mouse_sink_una __pyx_string_tab[52]
#define __pyx_kp_u_Windows_Raw_Input_setup_failed_s __pyx_string_tab[53]
#define __pyx_kp_u_Windows_hardware_event_validatio __pyx_string_tab[54]
#define __pyx_kp_u_Windows_keyboard_hardware_valida __pyx_string_tab[55]
#define __pyx_kp_u__2 __pyx_string_tab[56]
#define __pyx_kp_u__3 __pyx_string_tab[57]
#define __pyx_kp_u__5 __pyx_string_tab[58]
#define __pyx_kp_u__6 __pyx_string_tab[59]
#define __pyx_kp_u_add_note __pyx_string_tab[60]
#define __pyx_kp_u_automation_tools __pyx_string_tab[61]
#define __pyx_kp_u_bin_xinput __pyx_string_tab[62]
#define __pyx_kp_u_ctypes_XTEST_discovery_failed_s __pyx_string_tab[63]
#define __pyx_kp_u_device_d_d __pyx_string_tab[64]
#define __pyx_kp_u_disable __pyx_string_tab[65]
#define __pyx_kp_u_enable __pyx_string_tab[66]
#define __pyx_kp_u_gc __pyx_string_tab[67]
#define __pyx_kp_u_id_d __pyx_string_tab[68]
#define __pyx_kp_u_isenabled __pyx_string_tab[69]
#define __pyx_kp_u_macOS_CGEvent_classification_fai __pyx_string_tab[70]
#define __pyx_kp_u_macOS_event_tap_disabled_and_cle __pyx_string_tab[71]
#define __pyx_kp_u_macOS_hardware_event_validation __pyx_string_tab[72]
#define __pyx_kp_u_macOS_hardware_event_validation_2 __pyx_string_tab[73]
#define __pyx_kp_u_macOS_hardware_validation_disabl __pyx_string_tab[74]
#define __pyx_kp_u_proc_0_9_cmdline __pyx_string_tab[75]
#define __pyx_kp_u_pyautogui_CGEventPost_on_macOS __pyx_string_tab[76]
#define __pyx_kp_u_pyautogui_xdotool_on_Linux __pyx_string_tab[77]
#define __pyx_kp_u_python_evdev_not_available_on_Li __pyx_string_tab[78]
#define __pyx_kp_u_root __pyx_string_tab[79]
#define __pyx_kp_u_test_xi2 __pyx_string_tab[80]
#define __pyx_kp_u_threading_Event __pyx_string_tab[81]
#define __pyx_kp_u_usr_bin_xinput __pyx_string_tab[82]
#define __pyx_kp_u_utf_8 __pyx_string_tab[83]
#define __pyx_kp_u_ws_package_utils_hardware_event_2 __pyx_string_tab[84]
#define __pyx_kp_u_xinput_binary_not_found_XTEST_pa __pyx_string_tab[85]
#define __pyx_kp_u_xinput_list_failed_while_discove __pyx_string_tab[86]
#define __pyx_kp_u_xinput_not_found_XTEST_path_dete __pyx_string_tab[87]
#define __pyx_n_u_ABS_X __pyx_string_tab[88]
#define __pyx_n_u_AccessDenied __pyx_string_tab[89]
#define __pyx_n_u_ActivityMonitor __pyx_string_tab[90]
#define __pyx_n_u_BOOL __pyx_string_tab[91]
#define __pyx_n_u_CDLL __pyx_string_tab[92]
#define __pyx_n_u_CFUNCTYPE __pyx_string_tab[93]
#define __pyx_n_u_CGEventGetIntegerValueField __pyx_string_tab[94]
#define __pyx_n_u_CGEventTapCallBack __pyx_string_tab[95]
#define __pyx_n_u_CGEventTapCreate __pyx_string_tab[96]
#define __pyx_n_u_CGEventTapEnable __pyx_string_tab[97]
#define __pyx_n_u_CallNextHookEx __pyx_string_tab[98]
#define __pyx_n_u_DEVNULL __pyx_string_tab[99]
#define __pyx_n_u_DWORD __pyx_string_tab[100]
#define __pyx_n_u_Darwin __pyx_string_tab[101]
#define __pyx_n_u_Dict __pyx_string_tab[102]
#define __pyx_n_u_DispatchMessageW __pyx_string_tab[103]
#define __pyx_n_u_Display __pyx_string_tab[104]
#define __pyx_n_u_EV_ABS __pyx_string_tab[105]
#define __pyx_n_u_EV_KEY __pyx_string_tab[106]
#define __pyx_n_u_EV_REL __pyx_string_tab[107]
#define __pyx_n_u_Event __pyx_string_tab[108]
#define __pyx_n_u_GetMessageW __pyx_string_tab[109]
#define __pyx_n_u_GetModuleHandleW __pyx_string_tab[110]
#define __pyx_n_u_GetRawInputData __pyx_string_tab[111]
#define __pyx_n_u_HANDLE __pyx_string_tab[112]
#define __pyx_n_u_HC_ACTION __pyx_string_tab[113]
#define __pyx_n_u_HHOOK __pyx_string_tab[114]
#define __pyx_n_u_HINSTANCE __pyx_string_tab[115]
#define __pyx_n_u_HOOKPROC __pyx_string_tab[116]
#define __pyx_n_u_HWND __pyx_string_tab[117]
#define __pyx_n_u_HardwareEventValidator __pyx_string_tab[118]
#define __pyx_n_u_HardwareEventValidator___del __pyx_string_tab[119]
#define __pyx_n_u_HardwareEventValidator___init __pyx_string_tab[120]
#define __pyx_n_u_HardwareEventValidator__automati __pyx_string_tab[121]
#define __pyx_n_u_HardwareEventValidator__check_li __pyx_string_tab[122]
#define __pyx_n_u_HardwareEventValidator__check_li_2 __pyx_string_tab[123]
#define __pyx_n_u_HardwareEventValidator__check_li_3 __pyx_string_tab[124]
#define __pyx_n_u_HardwareEventValidator__check_ma __pyx_string_tab[125]
#define __pyx_n_u_HardwareEventValidator__check_ma_2 __pyx_string_tab[126]
#define __pyx_n_u_HardwareEventValidator__check_wi __pyx_string_tab[127]
#define __pyx_n_u_HardwareEventValidator__check_wi_2 __pyx_string_tab[128]
#define __pyx_n_u_HardwareEventValidator__check_wi_3 __pyx_string_tab[129]
#define __pyx_n_u_HardwareEventValidator__check_wi_4 __pyx_string_tab[130]
#define __pyx_n_u_HardwareEventValidator__initiali __pyx_string_tab[131]
#define __pyx_n_u_HardwareEventValidator__initiali_2 __pyx_string_tab[132]
#define __pyx_n_u_HardwareEventValidator__initiali_3 __pyx_string_tab[133]
#define __pyx_n_u_HardwareEventValidator__initiali_4 __pyx_string_tab[134]
#define __pyx_n_u_HardwareEventValidator__initiali_5 __pyx_string_tab[135]
#define __pyx_n_u_HardwareEventValidator__linux_au __pyx_string_tab[136]
#define __pyx_n_u_HardwareEventValidator__linux_di __pyx_string_tab[137]
#define __pyx_n_u_HardwareEventValidator__linux_di_2 __pyx_string_tab[138]
#define __pyx_n_u_HardwareEventValidator__linux_di_3 __pyx_string_tab[139]
#define __pyx_n_u_HardwareEventValidator__linux_dr __pyx_string_tab[140]
#define __pyx_n_u_HardwareEventValidator__linux_ev __pyx_string_tab[141]
#define __pyx_n_u_HardwareEventValidator__linux_op __pyx_string_tab[142]
#define __pyx_n_u_HardwareEventValidator__linux_re __pyx_string_tab[143]
#define __pyx_n_u_HardwareEventValidator__linux_te __pyx_string_tab[144]
#define __pyx_n_u_HardwareEventValidator__linux_ts __pyx_string_tab[145]
#define __pyx_n_u_HardwareEventValidator__linux_xi __pyx_string_tab[146]
#define __pyx_n_u_HardwareEventValidator__linux_xi_2 __pyx_string_tab[147]
#define __pyx_n_u_HardwareEventValidator__notify_s __pyx_string_tab[148]
#define __pyx_n_u_HardwareEventValidator__resolve __pyx_string_tab[149]
#define __pyx_n_u_HardwareEventValidator__scan_lin __pyx_string_tab[150]
#define __pyx_n_u_HardwareEventValidator__scan_lin_2 __pyx_string_tab[151]
#define __pyx_n_u_HardwareEventValidator__scan_win __pyx_string_tab[152]
#define __pyx_n_u_HardwareEventValidator__scan_win_2 __pyx_string_tab[153]
#define __pyx_n_u_HardwareEventValidator__start_li __pyx_string_tab[154]
#define __pyx_n_u_HardwareEventValidator__start_li_2 __pyx_string_tab[155]
#define __pyx_n_u_HardwareEventValidator__windows __pyx_string_tab[156]
#define __pyx_n_u_HardwareEventValidator__windows_2 __pyx_string_tab[157]
#define __pyx_n_u_HardwareEventValidator__windows_3 __pyx_string_tab[158]
#define __pyx_n_u_HardwareEventValidator__windows_4 __pyx_string_tab[159]
#define __pyx_n_u_HardwareEventValidator__windows_5 __pyx_string_tab[160]
#define __pyx_n_u_HardwareEventValidator__windows_6 __pyx_string_tab[161]
#define __pyx_n_u_HardwareEventValidator__windows_7 __pyx_string_tab[162]
#define __pyx_n_u_HardwareEventValidator__windows_8 __pyx_string_tab[163]
#define __pyx_n_u_HardwareEventValidator__windows_9 __pyx_string_tab[164]
#define __pyx_n_u_HardwareEventValidator_classify __pyx_string_tab[165]
#define __pyx_n_u_HardwareEventValidator_cleanup __pyx_string_tab[166]
#define __pyx_n_u_HardwareEventValidator_drain_win __pyx_string_tab[167]
#define __pyx_n_u_HardwareEventValidator_get_last __pyx_string_tab[168]
#define __pyx_n_u_HardwareEventValidator_is_enable __pyx_string_tab[169]
#define __pyx_n_u_HardwareEventValidator_is_hardwa __pyx_string_tab[170]
#define __pyx_n_u_HardwareEventValidator_is_hardwa_2 __pyx_string_tab[171]
#define __pyx_n_u_HardwareEventValidator_is_hardwa_3 __pyx_string_tab[172]
#define __pyx_n_u_HardwareEventValidator_is_hardwa_4 __pyx_string_tab[173]
#define __pyx_n_u_HardwareEventValidator_reinitial __pyx_string_tab[174]
#define __pyx_n_u_HardwareEventValidator_should_co __pyx_string_tab[175]
#define __pyx_n_u_HardwareEventValidator_should_co_2 __pyx_string_tab[176]
#define __pyx_n_u_InputDevice __pyx_string_tab[177]
#define __pyx_n_u_KBDLLHOOKSTRUCT __pyx_string_tab[178]
#define __pyx_n_u_KEY_A __pyx_string_tab[179]
#define __pyx_n_u_LLKHF_INJECTED __pyx_string_tab[180]
#define __pyx_n_u_LLMHF_INJECTED __pyx_string_tab[181]
#define __pyx_n_u_LPARAM __pyx_string_tab[182]
#define __pyx_n_u_LPCWSTR __pyx_string_tab[183]
#define __pyx_n_u_Linux __pyx_string_tab[184]
#define __pyx_n_u_LinuxEvdevReader __pyx_string_tab[185]
#define __pyx_n_u_LinuxX11XTESTMonitor __pyx_string_tab[186]
#define __pyx_n_u_Lock __pyx_string_tab[187]
#define __pyx_n_u_LogWriter __pyx_string_tab[188]
#define __pyx_n_u_MSG __pyx_string_tab[189]
#define __pyx_n_u_MSLLHOOKSTRUCT __pyx_string_tab[190]
#define __pyx_n_u_NoSuchProcess __pyx_string_tab[191]
#define __pyx_n_u_None __pyx_string_tab[192]
#define __pyx_n_u_Optional __pyx_string_tab[193]
#define __pyx_n_u_PIPE __pyx_string_tab[194]
#define __pyx_n_u_POINT __pyx_string_tab[195]
#define __pyx_n_u_POINTER __pyx_string_tab[196]
#define __pyx_n_u_Popen __pyx_string_tab[197]
#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[198]
#define __pyx_n_u_Quartz __pyx_string_tab[199]
#define __pyx_n_u_Queue __pyx_string_tab[200]
#define __pyx_n_u_RAWINPUTDEVICE __pyx_string_tab[201]
#define __pyx_n_u_RAWINPUTHEADER __pyx_string_tab[202]
#define __pyx_n_u_RAWMOUSE __pyx_string_tab[203]
#define __pyx_n_u_RIDEV_INPUTSINK __pyx_string_tab[204]
#define __pyx_n_u_RID_INPUT __pyx_string_tab[205]
#define __pyx_n_u_RIM_TYPEMOUSE __pyx_string_tab[206]
#define __pyx_n_u_RI_MOUSE_BUTTONS __pyx_string_tab[207]
#define __pyx_n_u_RI_MOUSE_HWHEEL __pyx_string_tab[208]
#define __pyx_n_u_RI_MOUSE_WHEEL __pyx_string_tab[209]
#define __pyx_n_u_RegisterRawInputDevices __pyx_string_tab[210]
#define __pyx_n_u_STDOUT __pyx_string_tab[211]
#define __pyx_n_u_Set __pyx_string_tab[212]
#define __pyx_n_u_SetWindowsHookExW __pyx_string_tab[213]
#define __pyx_n_u_Structure __pyx_string_tab[214]
#define __pyx_n_u_Thread __pyx_string_tab[215]
#define __pyx_n_u_TranslateMessage __pyx_string_tab[216]
#define __pyx_n_u_Tuple __pyx_string_tab[217]
#define __pyx_n_u_UINT __pyx_string_tab[218]
#define __pyx_n_u_ULONG __pyx_string_tab[219]
#define __pyx_n_u_UnhookWindowsHookEx __pyx_string_tab[220]
#define __pyx_n_u_WH_KEYBOARD_LL __pyx_string_tab[221]
#define __pyx_n_u_WH_MOUSE_LL __pyx_string_tab[222]
#define __pyx_n_u_WINDOWS_HW_CONFIRM_WINDOW __pyx_string_tab[223]
#define __pyx_n_u_WINDOWS_RAW_CONFIRM_WINDOW __pyx_string_tab[224]
#define __pyx_n_u_WINDOWS_SYN_FILTER_WINDOW __pyx_string_tab[225]
#define __pyx_n_u_WINFUNCTYPE __pyx_string_tab[226]
#define __pyx_n_u_WM_INPUT __pyx_string_tab[227]
#define __pyx_n_u_WM_KEYDOWN __pyx_string_tab[228]
#define __pyx_n_u_WM_KEYUP __pyx_string_tab[229]
#define __pyx_n_u_WM_MOUSEHWHEEL __pyx_string_tab[230]
#define __pyx_n_u_WM_MOUSEMOVE __pyx_string_tab[231]
#define __pyx_n_u_WM_MOUSEWHEEL __pyx_string_tab[232]
#define __pyx_n_u_WM_SYSKEYDOWN __pyx_string_tab[233]
#define __pyx_n_u_WM_SYSKEYUP __pyx_string_tab[234]
#define __pyx_n_u_WPARAM __pyx_string_tab[235]
#define __pyx_n_u_WinDLL __pyx_string_tab[236]
#define __pyx_n_u_Windows __pyx_string_tab[237]
#define __pyx_n_u_X11 __pyx_string_tab[238]
#define __pyx_n_u_XCloseDisplay __pyx_string_tab[239]
#define __pyx_n_u_XIDeviceInfo __pyx_string_tab[240]
#define __pyx_n_u_XIFreeDeviceInfo __pyx_string_tab[241]
#define __pyx_n_u_XIQueryDevice __pyx_string_tab[242]
#define __pyx_n_u_XIQueryVersion __pyx_string_tab[243]
#define __pyx_n_u_XOpenDisplay __pyx_string_tab[244]
#define __pyx_n_u_XTEST __pyx_string_tab[245]
#define __pyx_n_u_X_OK __pyx_string_tab[246]
#define __pyx_n_u_Xi __pyx_string_tab[247]
#define __pyx_n_u_ZombieProcess __pyx_string_tab[248]
#define __pyx_n_u__8 __pyx_string_tab[249]
#define __pyx_n_u_absinfo __pyx_string_tab[250]
#define __pyx_n_u_access __pyx_string_tab[251]
#define __pyx_n_u_active __pyx_string_tab[252]
#define __pyx_n_u_add __pyx_string_tab[253]
#define __pyx_n_u_annotate __pyx_string_tab[254]
#define __pyx_n_u_append __pyx_string_tab[255]
#define __pyx_n_u_args __pyx_string_tab[256]
#define __pyx_n_u_argtypes __pyx_string_tab[257]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[258]
#define __pyx_n_u_attachment __pyx_string_tab[259]
#define __pyx_n_u_autokey __pyx_string_tab[260]
#define __pyx_n_u_automation_markers __pyx_string_tab[261]
#define __pyx_n_u_automation_process_active __pyx_string_tab[262]
#define __pyx_n_u_automation_scan_cache_active __pyx_string_tab[263]
#define __pyx_n_u_automation_scan_cache_ts __pyx_string_tab[264]
#define __pyx_n_u_automation_scan_interval __pyx_string_tab[265]
#define __pyx_n_u_bool __pyx_string_tab[266]
#define __pyx_n_u_buf __pyx_string_tab[267]
#define __pyx_n_u_bufsize __pyx_string_tab[268]
#define __pyx_n_u_byref __pyx_string_tab[269]
#define __pyx_n_u_c_bool __pyx_string_tab[270]
#define __pyx_n_u_c_char_p __pyx_string_tab[271]
#define __pyx_n_u_c_int __pyx_string_tab[272]
#define __pyx_n_u_c_int64 __pyx_string_tab[273]
#define __pyx_n_u_c_long __pyx_string_tab[274]
#define __pyx_n_u_c_uint32 __pyx_string_tab[275]
#define __pyx_n_u_c_uint64 __pyx_string_tab[276]
#define __pyx_n_u_c_ulong __pyx_string_tab[277]
#define __pyx_n_u_c_ushort __pyx_string_tab[278]
#define __pyx_n_u_c_void_p __pyx_string_tab[279]
#define __pyx_n_u_callback_ref __pyx_string_tab[280]
#define __pyx_n_u_candidate __pyx_string_tab[281]
#define __pyx_n_u_capabilities __pyx_string_tab[282]
#define __pyx_n_u_caps __pyx_string_tab[283]
#define __pyx_n_u_cast __pyx_string_tab[284]
#define __pyx_n_u_check_linux_input_event __pyx_string_tab[285]
#define __pyx_n_u_check_linux_keyboard __pyx_string_tab[286]
#define __pyx_n_u_check_linux_mouse __pyx_string_tab[287]
#define __pyx_n_u_check_macos_keyboard __pyx_string_tab[288]
#define __pyx_n_u_check_macos_mouse __pyx_string_tab[289]
#define __pyx_n_u_check_output __pyx_string_tab[290]
#define __pyx_n_u_check_windows_keyboard __pyx_string_tab[291]
#define __pyx_n_u_check_windows_mouse __pyx_string_tab[292]
#define __pyx_n_u_check_windows_mouse_move __pyx_string_tab[293]
#define __pyx_n_u_check_windows_scroll __pyx_string_tab[294]
#define __pyx_n_u_class_getitem __pyx_string_tab[295]
#define __pyx_n_u_classes __pyx_string_tab[296]
#define __pyx_n_u_classify_macos_cg_event __pyx_string_tab[297]
#define __pyx_n_u_cleanup __pyx_string_tab[298]
#define __pyx_n_u_cleanup_hardware_validator __pyx_string_tab[299]
#define __pyx_n_u_clear __pyx_string_tab[300]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[301]
#define __pyx_n_u_close __pyx_string_tab[302]
#define __pyx_n_u_cmdline __pyx_string_tab[303]
#define __pyx_n_u_cmdline_path __pyx_string_tab[304]
#define __pyx_n_u_collections __pyx_string_tab[305]
#define __pyx_n_u_config __pyx_string_tab[306]
#define __pyx_n_u_contents __pyx_string_tab[307]
#define __pyx_n_u_copy __pyx_string_tab[308]
#define __pyx_n_u_create_string_buffer __pyx_string_tab[309]
#define __pyx_n_u_ctypes __pyx_string_tab[310]
#define __pyx_n_u_ctypes_util __pyx_string_tab[311]
#define __pyx_n_u_ctypes_wintypes __pyx_string_tab[312]
#define __pyx_n_u_current_event_type __pyx_string_tab[313]
#define __pyx_n_u_current_time __pyx_string_tab[314]
#define __pyx_n_u_daemon __pyx_string_tab[315]
#define __pyx_n_u_debug __pyx_string_tab[316]
#define __pyx_n_u_decode __pyx_string_tab[317]
#define __pyx_n_u_del __pyx_string_tab[318]
#define __pyx_n_u_deque __pyx_string_tab[319]
#define __pyx_n_u_device __pyx_string_tab[320]
#define __pyx_n_u_device_match __pyx_string_tab[321]
#define __pyx_n_u_deviceid __pyx_string_tab[322]
#define __pyx_n_u_devices __pyx_string_tab[323]
#define __pyx_n_u_discard __pyx_string_tab[324]
#define __pyx_n_u_display __pyx_string_tab[325]
#define __pyx_n_u_doc __pyx_string_tab[326]
#define __pyx_n_u_drain_windows_keyboard_events __pyx_string_tab[327]
#define __pyx_n_u_dwExtraInfo __pyx_string_tab[328]
#define __pyx_n_u_dwFlags __pyx_string_tab[329]
#define __pyx_n_u_dwSize __pyx_string_tab[330]
#define __pyx_n_u_dwType __pyx_string_tab[331]
#define __pyx_n_u_e __pyx_string_tab[332]
#define __pyx_n_u_e2 __pyx_string_tab[333]
#define __pyx_n_u_ecodes __pyx_string_tab[334]
#define __pyx_n_u_enabled __pyx_string_tab[335]
#define __pyx_n_u_enabled_2 __pyx_string_tab[336]
#define __pyx_n_u_enter __pyx_string_tab[337]
#define __pyx_n_u_env __pyx_string_tab[338]
#define __pyx_n_u_environ __pyx_string_tab[339]
#define __pyx_n_u_evdev __pyx_string_tab[340]
#define __pyx_n_u_evdev_module __pyx_string_tab[341]
#define __pyx_n_u_evdev_now __pyx_string_tab[342]
#define __pyx_n_u_evdev_recent __pyx_string_tab[343]
#define __pyx_n_u_evdev_ts __pyx_string_tab[344]
#define __pyx_n_u_event __pyx_string_tab[345]
#define __pyx_n_u_event_data __pyx_string_tab[346]
#define __pyx_n_u_event_mask __pyx_string_tab[347]
#define __pyx_n_u_event_match __pyx_string_tab[348]
#define __pyx_n_u_event_tap __pyx_string_tab[349]
#define __pyx_n_u_event_tap_callback __pyx_string_tab[350]
#define __pyx_n_u_event_type __pyx_string_tab[351]
#define __pyx_n_u_events __pyx_string_tab[352]
#define __pyx_n_u_exit __pyx_string_tab[353]
#define __pyx_n_u_fake_activity __pyx_string_tab[354]
#define __pyx_n_u_fake_detector __pyx_string_tab[355]
#define __pyx_n_u_fd __pyx_string_tab[356]
#define __pyx_n_u_fd_map __pyx_string_tab[357]
#define __pyx_n_u_fields __pyx_string_tab[358]
#define __pyx_n_u_file __pyx_string_tab[359]
#define __pyx_n_u_fileno __pyx_string_tab[360]
#define __pyx_n_u_find_library __pyx_string_tab[361]
#define __pyx_n_u_flags __pyx_string_tab[362]
#define __pyx_n_u_float __pyx_string_tab[363]
#define __pyx_n_u_found_keyboard __pyx_string_tab[364]
#define __pyx_n_u_found_mouse __pyx_string_tab[365]
#define __pyx_n_u_from_buffer_copy __pyx_string_tab[366]
#define __pyx_n_u_func __pyx_string_tab[367]
#define __pyx_n_u_genexpr __pyx_string_tab[368]
#define __pyx_n_u_get __pyx_string_tab[369]
#define __pyx_n_u_get_hardware_validator __pyx_string_tab[370]
#define __pyx_n_u_get_last_error __pyx_string_tab[371]
#define __pyx_n_u_get_last_hw_scroll_timestamp __pyx_string_tab[372]
#define __pyx_n_u_getpid __pyx_string_tab[373]
#define __pyx_n_u_glob __pyx_string_tab[374]
#define __pyx_n_u_got __pyx_string_tab[375]
#define __pyx_n_u_group __pyx_string_tab[376]
#define __pyx_n_u_hDevice __pyx_string_tab[377]
#define __pyx_n_u_handle __pyx_string_tab[378]
#define __pyx_n_u_hardware_event_validation_enable __pyx_string_tab[379]
#define __pyx_n_u_hardware_events_counted __pyx_string_tab[380]
#define __pyx_n_u_hardware_validator __pyx_string_tab[381]
#define __pyx_n_u_haystack __pyx_string_tab[382]
#define __pyx_n_u_header __pyx_string_tab[383]
#define __pyx_n_u_hmod __pyx_string_tab[384]
#define __pyx_n_u_hook_ok __pyx_string_tab[385]
#define __pyx_n_u_hook_ready __pyx_string_tab[386]
#define __pyx_n_u_hook_thread __pyx_string_tab[387]
#define __pyx_n_u_hw_age __pyx_string_tab[388]
#define __pyx_n_u_hw_recent __pyx_string_tab[389]
#define __pyx_n_u_hw_ts __pyx_string_tab[390]
#define __pyx_n_u_hwndTarget __pyx_string_tab[391]
#define __pyx_n_u_ids __pyx_string_tab[392]
#define __pyx_n_u_ignore __pyx_string_tab[393]
#define __pyx_n_u_index __pyx_string_tab[394]
#define __pyx_n_u_info __pyx_string_tab[395]
#define __pyx_n_u_init __pyx_string_tab[396]
#define __pyx_n_u_initialize __pyx_string_tab[397]
#define __pyx_n_u_initialize_linux __pyx_string_tab[398]
#define __pyx_n_u_initialize_macos __pyx_string_tab[399]
#define __pyx_n_u_initialize_windows __pyx_string_tab[400]
#define __pyx_n_u_initialized __pyx_string_tab[401]
#define __pyx_n_u_injected __pyx_string_tab[402]
#define __pyx_n_u_input __pyx_string_tab[403]
#define __pyx_n_u_input_kind __pyx_string_tab[404]
#define __pyx_n_u_int __pyx_string_tab[405]
#define __pyx_n_u_is_alive __pyx_string_tab[406]
#define __pyx_n_u_is_coroutine __pyx_string_tab[407]
#define __pyx_n_u_is_down __pyx_string_tab[408]
#define __pyx_n_u_is_enabled __pyx_string_tab[409]
#define __pyx_n_u_is_hardware __pyx_string_tab[410]
#define __pyx_n_u_is_hardware_keyboard_event __pyx_string_tab[411]
#define __pyx_n_u_is_hardware_mouse_event __pyx_string_tab[412]
#define __pyx_n_u_is_hardware_mouse_move_event __pyx_string_tab[413]
#define __pyx_n_u_is_hardware_scroll_event __pyx_string_tab[414]
#define __pyx_n_u_is_keyboard __pyx_string_tab[415]
#define __pyx_n_u_is_mouse __pyx_string_tab[416]
#define __pyx_n_u_is_move __pyx_string_tab[417]
#define __pyx_n_u_is_repeat __pyx_string_tab[418]
#define __pyx_n_u_is_scroll __pyx_string_tab[419]
#define __pyx_n_u_is_up __pyx_string_tab[420]
#define __pyx_n_u_isfile __pyx_string_tab[421]
#define __pyx_n_u_items __pyx_string_tab[422]
#define __pyx_n_u_kCGEventKeyDown __pyx_string_tab[423]
#define __pyx_n_u_kCGEventKeyUp __pyx_string_tab[424]
#define __pyx_n_u_kCGEventLeftMouseDown __pyx_string_tab[425]
#define __pyx_n_u_kCGEventMouseMoved __pyx_string_tab[426]
#define __pyx_n_u_kCGEventRightMouseDown __pyx_string_tab[427]
#define __pyx_n_u_kCGEventSourceStateCombinedSessi __pyx_string_tab[428]
#define __pyx_n_u_kCGEventSourceStateHIDSystemStat __pyx_string_tab[429]
#define __pyx_n_u_kCGEventSourceStateID __pyx_string_tab[430]
#define __pyx_n_u_kCGEventSourceStatePrivate __pyx_string_tab[431]
#define __pyx_n_u_kCGEventTapOptionDefault __pyx_string_tab[432]
#define __pyx_n_u_kCGHeadInsertEventTap __pyx_string_tab[433]
#define __pyx_n_u_kb __pyx_string_tab[434]
#define __pyx_n_u_kernel32 __pyx_string_tab[435]
#define __pyx_n_u_key_codes __pyx_string_tab[436]
#define __pyx_n_u_keyboard __pyx_string_tab[437]
#define __pyx_n_u_keyboard_events __pyx_string_tab[438]
#define __pyx_n_u_keyboard_found __pyx_string_tab[439]
#define __pyx_n_u_keyboard_hook __pyx_string_tab[440]
#define __pyx_n_u_keyboard_proc __pyx_string_tab[441]
#define __pyx_n_u_keys __pyx_string_tab[442]
#define __pyx_n_u_kill __pyx_string_tab[443]
#define __pyx_n_u_lLastX __pyx_string_tab[444]
#define __pyx_n_u_lLastY __pyx_string_tab[445]
#define __pyx_n_u_lParam __pyx_string_tab[446]
#define __pyx_n_u_label __pyx_string_tab[447]
#define __pyx_n_u_last_synthetic_warning_ts __pyx_string_tab[448]
#define __pyx_n_u_libx11 __pyx_string_tab[449]
#define __pyx_n_u_libxi __pyx_string_tab[450]
#define __pyx_n_u_line __pyx_string_tab[451]
#define __pyx_n_u_linux_automation_process_active __pyx_string_tab[452]
#define __pyx_n_u_linux_correlation_window __pyx_string_tab[453]
#define __pyx_n_u_linux_discover_xtest_device_ids __pyx_string_tab[454]
#define __pyx_n_u_linux_discover_xtest_device_ids_2 __pyx_string_tab[455]
#define __pyx_n_u_linux_drain_evdev __pyx_string_tab[456]
#define __pyx_n_u_linux_evdev_available __pyx_string_tab[457]
#define __pyx_n_u_linux_evdev_reader_thread __pyx_string_tab[458]
#define __pyx_n_u_linux_evdev_thread __pyx_string_tab[459]
#define __pyx_n_u_linux_last_evdev_keyboard_ts __pyx_string_tab[460]
#define __pyx_n_u_linux_last_evdev_mouse_ts __pyx_string_tab[461]
#define __pyx_n_u_linux_last_hw_keyboard_ts __pyx_string_tab[462]
#define __pyx_n_u_linux_last_hw_mouse_ts __pyx_string_tab[463]
#define __pyx_n_u_linux_last_xtest_keyboard_ts __pyx_string_tab[464]
#define __pyx_n_u_linux_last_xtest_mouse_ts __pyx_string_tab[465]
#define __pyx_n_u_linux_lock __pyx_string_tab[466]
#define __pyx_n_u_linux_open_devices __pyx_string_tab[467]
#define __pyx_n_u_linux_open_evdev_devices __pyx_string_tab[468]
#define __pyx_n_u_linux_reset_timestamps __pyx_string_tab[469]
#define __pyx_n_u_linux_teardown_monitors __pyx_string_tab[470]
#define __pyx_n_u_linux_ts_recent __pyx_string_tab[471]
#define __pyx_n_u_linux_xinput_binary __pyx_string_tab[472]
#define __pyx_n_u_linux_xinput_monitor_active __pyx_string_tab[473]
#define __pyx_n_u_linux_xinput_monitor_thread __pyx_string_tab[474]
#define __pyx_n_u_linux_xinput_path __pyx_string_tab[475]
#define __pyx_n_u_linux_xinput_process __pyx_string_tab[476]
#define __pyx_n_u_linux_xinput_thread __pyx_string_tab[477]
#define __pyx_n_u_linux_xtest_device_ids __pyx_string_tab[478]
#define __pyx_n_u_list __pyx_string_tab[479]
#define __pyx_n_u_list_devices __pyx_string_tab[480]
#define __pyx_n_u_logger __pyx_string_tab[481]
#define __pyx_n_u_low_level_keyboard_proc __pyx_string_tab[482]
#define __pyx_n_u_low_level_mouse_proc __pyx_string_tab[483]
#define __pyx_n_u_lower __pyx_string_tab[484]
#define __pyx_n_u_macos_constants __pyx_string_tab[485]
#define __pyx_n_u_macos_direct_validation __pyx_string_tab[486]
#define __pyx_n_u_macos_event_tap __pyx_string_tab[487]
#define __pyx_n_u_macos_event_tap_callback __pyx_string_tab[488]
#define __pyx_n_u_macos_last_keyboard_event __pyx_string_tab[489]
#define __pyx_n_u_macos_last_mouse_event __pyx_string_tab[490]
#define __pyx_n_u_macos_lock __pyx_string_tab[491]
#define __pyx_n_u_macos_quartz __pyx_string_tab[492]
#define __pyx_n_u_macos_quartz_available __pyx_string_tab[493]
#define __pyx_n_u_macos_quartz_module __pyx_string_tab[494]
#define __pyx_n_u_main __pyx_string_tab[495]
#define __pyx_n_u_major __pyx_string_tab[496]
#define __pyx_n_u_marker __pyx_string_tab[497]
#define __pyx_n_u_match __pyx_string_tab[498]
#define __pyx_n_u_maxlen __pyx_string_tab[499]
#define __pyx_n_u_message __pyx_string_tab[500]
#define __pyx_n_u_metaclass __pyx_string_tab[501]
#define __pyx_n_u_minor __pyx_string_tab[502]
#define __pyx_n_u_module __pyx_string_tab[503]
#define __pyx_n_u_mouse __pyx_string_tab[504]
#define __pyx_n_u_mouseData __pyx_string_tab[505]
#define __pyx_n_u_mouse_events __pyx_string_tab[506]
#define __pyx_n_u_mouse_found __pyx_string_tab[507]
#define __pyx_n_u_mouse_hook __pyx_string_tab[508]
#define __pyx_n_u_mouse_proc __pyx_string_tab[509]
#define __pyx_n_u_mro_entries __pyx_string_tab[510]
#define __pyx_n_u_ms __pyx_string_tab[511]
#define __pyx_n_u_msg __pyx_string_tab[512]
#define __pyx_n_u_nCode __pyx_string_tab[513]
#define __pyx_n_u_name __pyx_string_tab[514]
#define __pyx_n_u_name_2 __pyx_string_tab[515]
#define __pyx_n_u_name_lower __pyx_string_tab[516]
#define __pyx_n_u_ndevices __pyx_string_tab[517]
#define __pyx_n_u_next __pyx_string_tab[518]
#define __pyx_n_u_notify_synthetic_input_filtered __pyx_string_tab[519]
#define __pyx_n_u_now __pyx_string_tab[520]
#define __pyx_n_u_num_classes __pyx_string_tab[521]
#define __pyx_n_u_ok_flag __pyx_string_tab[522]
#define __pyx_n_u_open __pyx_string_tab[523]
#define __pyx_n_u_opened __pyx_string_tab[524]
#define __pyx_n_u_os __pyx_string_tab[525]
#define __pyx_n_u_output __pyx_string_tab[526]
#define __pyx_n_u_own_pid __pyx_string_tab[527]
#define __pyx_n_u_path __pyx_string_tab[528]
#define __pyx_n_u_pid __pyx_string_tab[529]
#define __pyx_n_u_platform __pyx_string_tab[530]
#define __pyx_n_u_platform_2 __pyx_string_tab[531]
#define __pyx_n_u_platform_hint __pyx_string_tab[532]
#define __pyx_n_u_poll __pyx_string_tab[533]
#define __pyx_n_u_pop __pyx_string_tab[534]
#define __pyx_n_u_prepare __pyx_string_tab[535]
#define __pyx_n_u_proc __pyx_string_tab[536]
#define __pyx_n_u_process_iter __pyx_string_tab[537]
#define __pyx_n_u_proxy __pyx_string_tab[538]
#define __pyx_n_u_psutil __pyx_string_tab[539]
#define __pyx_n_u_pt __pyx_string_tab[540]
#define __pyx_n_u_pyautogui __pyx_string_tab[541]
#define __pyx_n_u_qualname __pyx_string_tab[542]
#define __pyx_n_u_quartz __pyx_string_tab[543]
#define __pyx_n_u_queue __pyx_string_tab[544]
#define __pyx_n_u_raw_input_header_size __pyx_string_tab[545]
#define __pyx_n_u_raw_recent __pyx_string_tab[546]
#define __pyx_n_u_raw_ts __pyx_string_tab[547]
#define __pyx_n_u_rb __pyx_string_tab[548]
#define __pyx_n_u_rdi __pyx_string_tab[549]
#define __pyx_n_u_re __pyx_string_tab[550]
#define __pyx_n_u_read __pyx_string_tab[551]
#define __pyx_n_u_readable __pyx_string_tab[552]
#define __pyx_n_u_ready_event __pyx_string_tab[553]
#define __pyx_n_u_record_raw_mouse_input __pyx_string_tab[554]
#define __pyx_n_u_reinitialize_linux __pyx_string_tab[555]
#define __pyx_n_u_replace __pyx_string_tab[556]
#define __pyx_n_u_resolve_windows_input __pyx_string_tab[557]
#define __pyx_n_u_resolved __pyx_string_tab[558]
#define __pyx_n_u_restype __pyx_string_tab[559]
#define __pyx_n_u_ret __pyx_string_tab[560]
#define __pyx_n_u_return __pyx_string_tab[561]
#define __pyx_n_u_scanCode __pyx_string_tab[562]
#define __pyx_n_u_scan_code __pyx_string_tab[563]
#define __pyx_n_u_scan_linux_automation_processes __pyx_string_tab[564]
#define __pyx_n_u_scan_windows_automation_process __pyx_string_tab[565]
#define __pyx_n_u_scroll_ts __pyx_string_tab[566]
#define __pyx_n_u_search __pyx_string_tab[567]
#define __pyx_n_u_select __pyx_string_tab[568]
#define __pyx_n_u_self __pyx_string_tab[569]
#define __pyx_n_u_send __pyx_string_tab[570]
#define __pyx_n_u_set __pyx_string_tab[571]
#define __pyx_n_u_set_blocking __pyx_string_tab[572]
#define __pyx_n_u_set_name __pyx_string_tab[573]
#define __pyx_n_u_setdefault __pyx_string_tab[574]
#define __pyx_n_u_should_count_activity __pyx_string_tab[575]
#define __pyx_n_u_should_count_macos_cg_event __pyx_string_tab[576]
#define __pyx_n_u_shutil __pyx_string_tab[577]
#define __pyx_n_u_size __pyx_string_tab[578]
#define __pyx_n_u_sizeof __pyx_string_tab[579]
#define __pyx_n_u_slave_id __pyx_string_tab[580]
#define __pyx_n_u_sleep __pyx_string_tab[581]
#define __pyx_n_u_source_id __pyx_string_tab[582]
#define __pyx_n_u_split __pyx_string_tab[583]
#define __pyx_n_u_splitlines __pyx_string_tab[584]
#define __pyx_n_u_start __pyx_string_tab[585]
#define __pyx_n_u_start_linux_evdev_reader __pyx_string_tab[586]
#define __pyx_n_u_start_linux_xinput_monitor __pyx_string_tab[587]
#define __pyx_n_u_stderr __pyx_string_tab[588]
#define __pyx_n_u_stdout __pyx_string_tab[589]
#define __pyx_n_u_stop_hooks __pyx_string_tab[590]
#define __pyx_n_u_str __pyx_string_tab[591]
#define __pyx_n_u_strip __pyx_string_tab[592]
#define __pyx_n_u_stripped __pyx_string_tab[593]
#define __pyx_n_u_subprocess __pyx_string_tab[594]
#define __pyx_n_u_syn_age __pyx_string_tab[595]
#define __pyx_n_u_syn_recent __pyx_string_tab[596]
#define __pyx_n_u_syn_ts __pyx_string_tab[597]
#define __pyx_n_u_synthetic_events_filtered __pyx_string_tab[598]
#define __pyx_n_u_synthetic_warning_interval __pyx_string_tab[599]
#define __pyx_n_u_system __pyx_string_tab[600]
#define __pyx_n_u_target __pyx_string_tab[601]
#define __pyx_n_u_terminate __pyx_string_tab[602]
#define __pyx_n_u_test __pyx_string_tab[603]
#define __pyx_n_u_text __pyx_string_tab[604]
#define __pyx_n_u_threading __pyx_string_tab[605]
#define __pyx_n_u_throw __pyx_string_tab[606]
#define __pyx_n_u_time __pyx_string_tab[607]
#define __pyx_n_u_timeout __pyx_string_tab[608]
#define __pyx_n_u_timestamp __pyx_string_tab[609]
#define __pyx_n_u_ts __pyx_string_tab[610]
#define __pyx_n_u_type __pyx_string_tab[611]
#define __pyx_n_u_typing __pyx_string_tab[612]
#define __pyx_n_u_uinput __pyx_string_tab[613]
#define __pyx_n_u_ulExtraInformation __pyx_string_tab[614]
#define __pyx_n_u_ulRawButtons __pyx_string_tab[615]
#define __pyx_n_u_upper __pyx_string_tab[616]
#define __pyx_n_u_usButtonData __pyx_string_tab[617]
#define __pyx_n_u_usButtonFlags __pyx_string_tab[618]
#define __pyx_n_u_usFlags __pyx_string_tab[619]
#define __pyx_n_u_usReserved __pyx_string_tab[620]
#define __pyx_n_u_usUsage __pyx_string_tab[621]
#define __pyx_n_u_usUsagePage __pyx_string_tab[622]
#define __pyx_n_u_use __pyx_string_tab[623]
#define __pyx_n_u_use_last_error __pyx_string_tab[624]
#define __pyx_n_u_user32 __pyx_string_tab[625]
#define __pyx_n_u_user_info __pyx_string_tab[626]
#define __pyx_n_u_util __pyx_string_tab[627]
#define __pyx_n_u_validation_enabled __pyx_string_tab[628]
#define __pyx_n_u_value __pyx_string_tab[629]
#define __pyx_n_u_values __pyx_string_tab[630]
#define __pyx_n_u_virtual __pyx_string_tab[631]
#define __pyx_n_u_vkCode __pyx_string_tab[632]
#define __pyx_n_u_vk_code __pyx_string_tab[633]
#define __pyx_n_u_wParam __pyx_string_tab[634]
#define __pyx_n_u_wait __pyx_string_tab[635]
#define __pyx_n_u_warning __pyx_string_tab[636]
#define __pyx_n_u_which __pyx_string_tab[637]
#define __pyx_n_u_windows_event_queue __pyx_string_tab[638]
#define __pyx_n_u_windows_hook_handles __pyx_string_tab[639]
#define __pyx_n_u_windows_hook_thread __pyx_string_tab[640]
#define __pyx_n_u_windows_hooks __pyx_string_tab[641]
#define __pyx_n_u_windows_keyboard_events __pyx_string_tab[642]
#define __pyx_n_u_windows_keys_down __pyx_string_tab[643]
#define __pyx_n_u_windows_last_hw_keyboard_ts __pyx_string_tab[644]
#define __pyx_n_u_windows_last_hw_mouse_ts __pyx_string_tab[645]
#define __pyx_n_u_windows_last_hw_scroll_ts __pyx_string_tab[646]
#define __pyx_n_u_windows_last_keyboard_event __pyx_string_tab[647]
#define __pyx_n_u_windows_last_mouse_event __pyx_string_tab[648]
#define __pyx_n_u_windows_last_raw_mouse_ts __pyx_string_tab[649]
#define __pyx_n_u_windows_last_syn_keyboard_ts __pyx_string_tab[650]
#define __pyx_n_u_windows_last_syn_mouse_ts __pyx_string_tab[651]
#define __pyx_n_u_windows_lock __pyx_string_tab[652]
#define __pyx_n_u_windows_raw_input_active __pyx_string_tab[653]
#define __pyx_n_u_windows_use_mouse_ll_hook __pyx_string_tab[654]
#define __pyx_n_u_wintypes __pyx_string_tab[655]
#define __pyx_n_u_wparam __pyx_string_tab[656]
#define __pyx_n_u_ws_package_configs __pyx_string_tab[657]
#define __pyx_n_u_ws_package_log_writer __pyx_string_tab[658]
#define __pyx_n_u_ws_package_utils_hardware_event __pyx_string_tab[659]
#define __pyx_n_u_xdotool __pyx_string_tab[660]
#define __pyx_n_u_xinput __pyx_string_tab[661]
#define __pyx_n_u_xinput_bin __pyx_string_tab[662]
#define __pyx_n_u_xtest_recent __pyx_string_tab[663]
#define __pyx_n_u_xtest_ts __pyx_string_tab[664]
#define __pyx_n_u_ydotool __pyx_string_tab[665]
#define __pyx_kp_b__4 __pyx_string_tab[666]
#define __pyx_kp_b__5 __pyx_string_tab[667]
#define __pyx_kp_b_iso88591_00J_vWA_vWA_Q_Q_Q_Q_Q_Q_Q_Q_Q_Q __pyx_string_tab[668]
#define __pyx_kp_b_iso88591_0_4_Q_1_T_wc_1_2_6_z_F_q_1_A_DA __pyx_string_tab[669]
#define __pyx_kp_b_iso88591_1_A_a_HE_a_l_1_fF_S_a_S_3is_v_8 __pyx_string_tab[670]
#define __pyx_kp_b_iso88591_1_Oq_4t_c_D_A_1_t_q __pyx_string_tab[671]
#define __pyx_kp_b_iso88591_1_e1_Q_Q_Q_T_82Q_T_82Q_q_q_q_q __pyx_string_tab[672]
#define __pyx_kp_b_iso88591_2_1_T_a_1_A_Q_q_HF_Q_xwd_BgQm1 __pyx_string_tab[673]
#define __pyx_kp_b_iso88591_2_G1_D_Qa_c_fAT_t3a_fE_81IU_S_b __pyx_string_tab[674]
#define __pyx_kp_b_iso88591_2_t_a __pyx_string_tab[675]
#define __pyx_kp_b_iso88591_381_d_q_d_Q_Q_4q_4q_A_A_4q_4q_A __pyx_string_tab[676]
#define __pyx_kp_b_iso88591_3a_4A_1 __pyx_string_tab[677]
#define __pyx_kp_b_iso88591_4A_G1_1_HF_q_1_4uAWCq_U_4uA_3fA __pyx_string_tab[678]
#define __pyx_kp_b_iso88591_4t_a_1_t_c_t_0_1_t_a_1_t_a_A_LA __pyx_string_tab[679]
#define __pyx_kp_b_iso88591_4t_a_1_t_c_t_1_4_q_A_SST_1 __pyx_string_tab[680]
#define __pyx_kp_b_iso88591_81_d_q_D_32T_a_Q_q_Qd_a_ha __pyx_string_tab[681]
#define __pyx_kp_b_iso88591_9_WI_q_uAV5_Qa_e1F_AQ_4wc_Q_a_1 __pyx_string_tab[682]
#define __pyx_kp_b_iso88591_A __pyx_string_tab[683]
#define __pyx_kp_b_iso88591_A_1_a_1_a_a_1 __pyx_string_tab[684]
#define __pyx_kp_b_iso88591_A_3c_Q_3c_T_T_a_4q_1_d_a_1_z_q_Q __pyx_string_tab[685]
#define __pyx_kp_b_iso88591_A_4_0_1 __pyx_string_tab[686]
#define __pyx_kp_b_iso88591_A_4_PPQ_t1_0_haq_a_Q_7q_1_2_q_1 __pyx_string_tab[687]
#define __pyx_kp_b_iso88591_A_4_Q_e1A_O1_F_1_Q_A_O1_a_e1_q_A __pyx_string_tab[688]
#define __pyx_kp_b_iso88591_A_4_T_B_1_IWA_4q_1_q_F_1 __pyx_string_tab[689]
#define __pyx_kp_b_iso88591_A_4t1_4_D_9G1_4q_1_a __pyx_string_tab[690]
#define __pyx_kp_b_iso88591_A_4t1_7_A_a_a_d_q_Jd_IV5_Q_5_c __pyx_string_tab[691]
#define __pyx_kp_b_iso88591_A_4t_a_1_t_c_t_31_1_t_1_1_t_1_A __pyx_string_tab[692]
#define __pyx_kp_b_iso88591_A_6_q_6_vQgQ_t7_2V7_1_5Qd_0_5_fA __pyx_string_tab[693]
#define __pyx_kp_b_iso88591_A_A_0_L_e1_0_uAQ_4A_a_3_mST_0_V __pyx_string_tab[694]
#define __pyx_kp_b_iso88591_A_A_4t_a_1_s_a_q_1_1_q __pyx_string_tab[695]
#define __pyx_kp_b_iso88591_A_A_a_t7_j_A_4q_e1_J_Qa_d_a_T_wa __pyx_string_tab[696]
#define __pyx_kp_b_iso88591_A_A_fM_A_Q_V1_vQ_Ye1_ivQ_1A_IWA __pyx_string_tab[697]
#define __pyx_kp_b_iso88591_A_L_M_A_a_Q_E_q_A_fM_A_Q_QgQ_Q_q __pyx_string_tab[698]
#define __pyx_kp_b_iso88591_A_O1_4_Zt4q__D_1_T_2_47MQa_xs_a __pyx_string_tab[699]
#define __pyx_kp_b_iso88591_A_d_q_D_2_D_4q_t_c_a_1_A_q_Q_q __pyx_string_tab[700]
#define __pyx_kp_b_iso88591_A_d_q_b_Q_4r_L_G7_t7_A_XWE_XRq_U __pyx_string_tab[701]
#define __pyx_kp_b_iso88591_A_q_F2Na_1A_0t5_6Gq_A_9_9_4D8LL __pyx_string_tab[702]
#define __pyx_kp_b_iso88591_A_t1_5_uD_E_Cq_Ja_E_Q_Q_A_Jd_fA __pyx_string_tab[703]
#define __pyx_kp_b_iso88591_A_t4q_q_Q_T_9_a_4uA_z_Qm5_Rz_XZ __pyx_string_tab[704]
#define __pyx_kp_b_iso88591_A_t_T_Q __pyx_string_tab[705]
#define __pyx_kp_b_iso88591_A_t_c_1_a_1_a_ha_PPTTU_L_A_QQR_1 __pyx_string_tab[706]
#define __pyx_kp_b_iso88591_A_vS_AQ_7_Q_uAXV81DTTU_uBgRq_v_A __pyx_string_tab[707]
#define __pyx_kp_b_iso88591_A_vS_V5_xq_QQR_4q_1_Qa_l_Ja_d_q __pyx_string_tab[708]
#define __pyx_kp_b_iso88591_Q_A_Q_4_awa_1 __pyx_string_tab[709]
#define __pyx_kp_b_iso88591__7 __pyx_string_tab[710]
#define __pyx_kp_b_iso88591_a __pyx_string_tab[711]
#define __pyx_kp_b_iso88591_a_4q_4q_M_z_RuG1Kt2WA_PRRS_q_q __pyx_string_tab[712]
#define __pyx_kp_b_iso88591_a_4t_a_1_t_c_t_5Q_4_q_A_WWX_1 __pyx_string_tab[713]
#define __pyx_kp_b_iso88591_a_4t_c_D_3a_1_5_Q __pyx_string_tab[714]
#define __pyx_kp_b_iso88591_a_e1_Q_A_Q_Q_t_2_7_y_1_q_T_82Q __pyx_string_tab[715]
#define __pyx_kp_b_iso88591_q_4_0_1 __pyx_string_tab[716]
#define __pyx_kp_b_iso88591_q_Kq_t_c_t7_6_1_Q_Qd_V1_1_A_H_1 __pyx_string_tab[717]
#define __pyx_kp_b_iso88591_q_e1_Q_D_A_Q_z_d_Kr_q_4_awa_1 __pyx_string_tab[718]
#define __pyx_kp_b_iso88591_q_t4q_q_Q_T_E_4uA_z_Qm5_Rz_XZZ __pyx_string_tab[719]
#define __pyx_kp_b_iso88591_q_xq_A_Na __pyx_string_tab[720]
#define __pyx_kp_b_iso88591_z_t1D_T_4r_Q __pyx_string_tab[721]
#define __pyx_float_0_0 __pyx_number_tab[0]
#define __pyx_float_0_2 __pyx_number_tab[1]
#define __pyx_float_0_3 __pyx_number_tab[2]
#define __pyx_float_0_4 __pyx_number_tab[3]
#define __pyx_float_0_5 __pyx_number_tab[4]
#define __pyx_float_2_0 __pyx_number_tab[5]
#define __pyx_float_3_0 __pyx_number_tab[6]
#define __pyx_float_0_04 __pyx_number_tab[7]
#define __pyx_float_0_05 __pyx_number_tab[8]
#define __pyx_float_0_10 __pyx_number_tab[9]
#define __pyx_float_0_15 __pyx_number_tab[10]
#define __pyx_float_0_75 __pyx_number_tab[11]
#define __pyx_float_60_0 __pyx_number_tab[12]
#define __pyx_int_0 __pyx_number_tab[13]
#define __pyx_int_neg_1 __pyx_number_tab[14]
#define __pyx_int_1 __pyx_number_tab[15]
#define __pyx_int_2 __pyx_number_tab[16]
#define __pyx_int_3 __pyx_number_tab[17]
#define __pyx_int_4 __pyx_number_tab[18]
#define __pyx_int_5 __pyx_number_tab[19]
#define __pyx_int_6 __pyx_number_tab[20]
#define __pyx_int_10 __pyx_number_tab[21]
#define __pyx_int_11 __pyx_number_tab[22]
#define __pyx_int_13 __pyx_number_tab[23]
#define __pyx_int_14 __pyx_number_tab[24]
#define __pyx_int_15 __pyx_number_tab[25]
#define __pyx_int_16 __pyx_number_tab[26]
#define __pyx_int_17 __pyx_number_tab[27]
#define __pyx_int_63 __pyx_number_tab[28]
#define __pyx_int_255 __pyx_number_tab[29]
#define __pyx_int_512 __pyx_number_tab[30]
#define __pyx_int_1024 __pyx_number_tab[31]
#define __pyx_int_2048 __pyx_number_tab[32]
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
  __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
  if (!clear_module_state) return 0;
  Py_CLEAR(clear_module_state->__pyx_d);
  Py_CLEAR(clear_module_state->__pyx_b);
  Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __Pyx_State_RemoveModule(NULL);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread);
  Py_CLEAR(clear_module_state->__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread);
  Py_CLEAR(clear_module_state->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos);
  Py_CLEAR(clear_module_state->__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos);
  Py_CLEAR(clear_module_state->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes);
  Py_CLEAR(clear_module_state->__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes);
  Py_CLEAR(clear_module_state->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes);
  Py_CLEAR(clear_module_state->__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes);
  Py_CLEAR(clear_module_state->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr);
  for (int i=0; i<8; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
  for (int i=0; i<54; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<722; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<33; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_clear_contents ### */
/* CommonTypesMetaclass.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);

/* CythonFunctionShared.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CyFunctionType);

/* Generator.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_GeneratorType);

/* #### Code section: module_state_clear_end ### */
return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
  if (!traverse_module_state) return 0;
  Py_VISIT(traverse_module_state->__pyx_d);
  Py_VISIT(traverse_module_state->__pyx_b);
  Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
  Py_VISIT(traverse_module_state->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread);
  Py_VISIT(traverse_module_state->__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread);
  Py_VISIT(traverse_module_state->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos);
  Py_VISIT(traverse_module_state->__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos);
  Py_VISIT(traverse_module_state->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes);
  Py_VISIT(traverse_module_state->__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes);
  Py_VISIT(traverse_module_state->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes);
  Py_VISIT(traverse_module_state->__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes);
  Py_VISIT(traverse_module_state->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr);
  for (int i=0; i<8; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
  for (int i=0; i<54; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<722; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<33; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_traverse_contents ### */
/* CommonTypesMetaclass.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);

/* CythonFunctionShared.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CyFunctionType);

/* Generator.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_GeneratorType);

/* #### Code section: module_state_traverse_end ### */
return 0;
}
#endif
/* #### Code section: module_code ### */

/* "ws_package/utils/hardware_event_validator.py":52
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self._enabled = False
 *         self._platform = platform.system()
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_1__init__(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_1__init__(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 52, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 52, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(0, 52, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 52, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 52, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator___init__(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_validation_enabled = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "ws_package/utils/hardware_event_validator.py":53
 * 
 *     def __init__(self):
 *         self._enabled = False             # <<<<<<<<<<<<<<
 *         self._platform = platform.system()
 *         self._initialized = False
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_enabled, Py_False) < (0)) __PYX_ERR(0, 53, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":54
 *     def __init__(self):
 *         self._enabled = False
 *         self._platform = platform.system()             # <<<<<<<<<<<<<<
 *         self._initialized = False
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_platform); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_system); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2, __pyx_t_1) < (0)) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":55
 *         self._enabled = False
 *         self._platform = platform.system()
 *         self._initialized = False             # <<<<<<<<<<<<<<
 * 
 *         # Platform-specific state
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_initialized, Py_False) < (0)) __PYX_ERR(0, 55, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":58
 * 
 *         # Platform-specific state
 *         self._windows_hooks = {}             # <<<<<<<<<<<<<<
 *         self._windows_hook_handles = {}
 *         self._windows_event_queue = queue.Queue()
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_hooks, __pyx_t_1) < (0)) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":59
 *         # Platform-specific state
 *         self._windows_hooks = {}
 *         self._windows_hook_handles = {}             # <<<<<<<<<<<<<<
 *         self._windows_event_queue = queue.Queue()
 *         self._windows_last_keyboard_event = {'injected': None, 'timestamp': 0}
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_hook_handles, __pyx_t_1) < (0)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":60
 *         self._windows_hooks = {}
 *         self._windows_hook_handles = {}
 *         self._windows_event_queue = queue.Queue()             # <<<<<<<<<<<<<<
 *         self._windows_last_keyboard_event = {'injected': None, 'timestamp': 0}
 *         self._windows_last_mouse_event = {'injected': None, 'timestamp': 0}
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_queue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Queue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_event_queue, __pyx_t_1) < (0)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":61
 *         self._windows_hook_handles = {}
 *         self._windows_event_queue = queue.Queue()
 *         self._windows_last_keyboard_event = {'injected': None, 'timestamp': 0}             # <<<<<<<<<<<<<<
 *         self._windows_last_mouse_event = {'injected': None, 'timestamp': 0}
 *         self._windows_last_hw_keyboard_ts = 0.0
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_injected, Py_None) < (0)) __PYX_ERR(0, 61, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_timestamp, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 61, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_keyboard_event, __pyx_t_1) < (0)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":62
 *         self._windows_event_queue = queue.Queue()
 *         self._windows_last_keyboard_event = {'injected': None, 'timestamp': 0}
 *         self._windows_last_mouse_event = {'injected': None, 'timestamp': 0}             # <<<<<<<<<<<<<<
 *         self._windows_last_hw_keyboard_ts = 0.0
 *         self._windows_last_hw_mouse_ts = 0.0
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_injected, Py_None) < (0)) __PYX_ERR(0, 62, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_timestamp, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 62, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_mouse_event, __pyx_t_1) < (0)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":63
 *         self._windows_last_keyboard_event = {'injected': None, 'timestamp': 0}
 *         self._windows_last_mouse_event = {'injected': None, 'timestamp': 0}
 *         self._windows_last_hw_keyboard_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._windows_last_hw_mouse_ts = 0.0
 *         self._windows_last_syn_keyboard_ts = 0.0
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_hw_keyboard_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 63, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":64
 *         self._windows_last_mouse_event = {'injected': None, 'timestamp': 0}
 *         self._windows_last_hw_keyboard_ts = 0.0
 *         self._windows_last_hw_mouse_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._windows_last_syn_keyboard_ts = 0.0
 *         self._windows_last_syn_mouse_ts = 0.0
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_hw_mouse_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 64, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":65
 *         self._windows_last_hw_keyboard_ts = 0.0
 *         self._windows_last_hw_mouse_ts = 0.0
 *         self._windows_last_syn_keyboard_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._windows_last_syn_mouse_ts = 0.0
 *         self._windows_last_hw_scroll_ts = 0.0
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_syn_keyboard_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 65, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":66
 *         self._windows_last_hw_mouse_ts = 0.0
 *         self._windows_last_syn_keyboard_ts = 0.0
 *         self._windows_last_syn_mouse_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._windows_last_hw_scroll_ts = 0.0
 *         self._windows_last_raw_mouse_ts = 0.0
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_syn_mouse_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 66, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":67
 *         self._windows_last_syn_keyboard_ts = 0.0
 *         self._windows_last_syn_mouse_ts = 0.0
 *         self._windows_last_hw_scroll_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._windows_last_raw_mouse_ts = 0.0
 *         self._windows_raw_input_active = False
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_hw_scroll_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 67, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":68
 *         self._windows_last_syn_mouse_ts = 0.0
 *         self._windows_last_hw_scroll_ts = 0.0
 *         self._windows_last_raw_mouse_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._windows_raw_input_active = False
 *         self._windows_use_mouse_ll_hook = False
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_raw_mouse_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 68, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":69
 *         self._windows_last_hw_scroll_ts = 0.0
 *         self._windows_last_raw_mouse_ts = 0.0
 *         self._windows_raw_input_active = False             # <<<<<<<<<<<<<<
 *         self._windows_use_mouse_ll_hook = False
 *         self._windows_keyboard_events = deque(maxlen=512)
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_raw_input_active, Py_False) < (0)) __PYX_ERR(0, 69, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":70
 *         self._windows_last_raw_mouse_ts = 0.0
 *         self._windows_raw_input_active = False
 *         self._windows_use_mouse_ll_hook = False             # <<<<<<<<<<<<<<
 *         self._windows_keyboard_events = deque(maxlen=512)
 *         self._windows_keys_down = set()
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_use_mouse_ll_hook, Py_False) < (0)) __PYX_ERR(0, 70, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":71
 *         self._windows_raw_input_active = False
 *         self._windows_use_mouse_ll_hook = False
 *         self._windows_keyboard_events = deque(maxlen=512)             # <<<<<<<<<<<<<<
 *         self._windows_keys_down = set()
 *         self._macos_quartz_available = False
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_deque); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_maxlen, __pyx_mstate_global->__pyx_int_512, __pyx_t_2, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 71, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_keyboard_events, __pyx_t_1) < (0)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":72
 *         self._windows_use_mouse_ll_hook = False
 *         self._windows_keyboard_events = deque(maxlen=512)
 *         self._windows_keys_down = set()             # <<<<<<<<<<<<<<
 *         self._macos_quartz_available = False
 *         self._macos_direct_validation = False
*/
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_keys_down, __pyx_t_1) < (0)) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":73
 *         self._windows_keyboard_events = deque(maxlen=512)
 *         self._windows_keys_down = set()
 *         self._macos_quartz_available = False             # <<<<<<<<<<<<<<
 *         self._macos_direct_validation = False
 *         self._macos_quartz_module = None
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_quartz_available, Py_False) < (0)) __PYX_ERR(0, 73, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":74
 *         self._windows_keys_down = set()
 *         self._macos_quartz_available = False
 *         self._macos_direct_validation = False             # <<<<<<<<<<<<<<
 *         self._macos_quartz_module = None
 *         self._linux_evdev_available = False
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_direct_validation, Py_False) < (0)) __PYX_ERR(0, 74, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":75
 *         self._macos_quartz_available = False
 *         self._macos_direct_validation = False
 *         self._macos_quartz_module = None             # <<<<<<<<<<<<<<
 *         self._linux_evdev_available = False
 *         self._linux_open_devices = []
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_quartz_module, Py_None) < (0)) __PYX_ERR(0, 75, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":76
 *         self._macos_direct_validation = False
 *         self._macos_quartz_module = None
 *         self._linux_evdev_available = False             # <<<<<<<<<<<<<<
 *         self._linux_open_devices = []
 *         self._linux_lock = threading.Lock()
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_evdev_available, Py_False) < (0)) __PYX_ERR(0, 76, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":77
 *         self._macos_quartz_module = None
 *         self._linux_evdev_available = False
 *         self._linux_open_devices = []             # <<<<<<<<<<<<<<
 *         self._linux_lock = threading.Lock()
 *         self._linux_last_evdev_keyboard_ts = 0.0
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_open_devices, __pyx_t_1) < (0)) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":78
 *         self._linux_evdev_available = False
 *         self._linux_open_devices = []
 *         self._linux_lock = threading.Lock()             # <<<<<<<<<<<<<<
 *         self._linux_last_evdev_keyboard_ts = 0.0
 *         self._linux_last_evdev_mouse_ts = 0.0
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Lock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_lock, __pyx_t_1) < (0)) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":79
 *         self._linux_open_devices = []
 *         self._linux_lock = threading.Lock()
 *         self._linux_last_evdev_keyboard_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._linux_last_evdev_mouse_ts = 0.0
 *         self._linux_last_xtest_keyboard_ts = 0.0
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_evdev_keyboard_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 79, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":80
 *         self._linux_lock = threading.Lock()
 *         self._linux_last_evdev_keyboard_ts = 0.0
 *         self._linux_last_evdev_mouse_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._linux_last_xtest_keyboard_ts = 0.0
 *         self._linux_last_xtest_mouse_ts = 0.0
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_evdev_mouse_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 80, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":81
 *         self._linux_last_evdev_keyboard_ts = 0.0
 *         self._linux_last_evdev_mouse_ts = 0.0
 *         self._linux_last_xtest_keyboard_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._linux_last_xtest_mouse_ts = 0.0
 *         self._linux_last_hw_keyboard_ts = 0.0
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_xtest_keyboard_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 81, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":82
 *         self._linux_last_evdev_mouse_ts = 0.0
 *         self._linux_last_xtest_keyboard_ts = 0.0
 *         self._linux_last_xtest_mouse_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._linux_last_hw_keyboard_ts = 0.0
 *         self._linux_last_hw_mouse_ts = 0.0
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_xtest_mouse_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 82, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":83
 *         self._linux_last_xtest_keyboard_ts = 0.0
 *         self._linux_last_xtest_mouse_ts = 0.0
 *         self._linux_last_hw_keyboard_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._linux_last_hw_mouse_ts = 0.0
 *         self._linux_xtest_device_ids: Set[int] = set()
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_hw_keyboard_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 83, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":84
 *         self._linux_last_xtest_mouse_ts = 0.0
 *         self._linux_last_hw_keyboard_ts = 0.0
 *         self._linux_last_hw_mouse_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._linux_xtest_device_ids: Set[int] = set()
 *         self._linux_xinput_process = None
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_hw_mouse_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 84, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":85
 *         self._linux_last_hw_keyboard_ts = 0.0
 *         self._linux_last_hw_mouse_ts = 0.0
 *         self._linux_xtest_device_ids: Set[int] = set()             # <<<<<<<<<<<<<<
 *         self._linux_xinput_process = None
 *         self._linux_xinput_thread = None
*/
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xtest_device_ids, __pyx_t_1) < (0)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":86
 *         self._linux_last_hw_mouse_ts = 0.0
 *         self._linux_xtest_device_ids: Set[int] = set()
 *         self._linux_xinput_process = None             # <<<<<<<<<<<<<<
 *         self._linux_xinput_thread = None
 *         self._linux_xinput_monitor_active = False
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_process, Py_None) < (0)) __PYX_ERR(0, 86, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":87
 *         self._linux_xtest_device_ids: Set[int] = set()
 *         self._linux_xinput_process = None
 *         self._linux_xinput_thread = None             # <<<<<<<<<<<<<<
 *         self._linux_xinput_monitor_active = False
 *         self._linux_evdev_thread = None
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_thread, Py_None) < (0)) __PYX_ERR(0, 87, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":88
 *         self._linux_xinput_process = None
 *         self._linux_xinput_thread = None
 *         self._linux_xinput_monitor_active = False             # <<<<<<<<<<<<<<
 *         self._linux_evdev_thread = None
 *         self._linux_correlation_window = 0.75
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_monitor_active, Py_False) < (0)) __PYX_ERR(0, 88, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":89
 *         self._linux_xinput_thread = None
 *         self._linux_xinput_monitor_active = False
 *         self._linux_evdev_thread = None             # <<<<<<<<<<<<<<
 *         self._linux_correlation_window = 0.75
 *         self._linux_xinput_path = None
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_evdev_thread, Py_None) < (0)) __PYX_ERR(0, 89, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":90
 *         self._linux_xinput_monitor_active = False
 *         self._linux_evdev_thread = None
 *         self._linux_correlation_window = 0.75             # <<<<<<<<<<<<<<
 *         self._linux_xinput_path = None
 *         self._automation_markers = (
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_correlation_window, __pyx_mstate_global->__pyx_float_0_75) < (0)) __PYX_ERR(0, 90, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":91
 *         self._linux_evdev_thread = None
 *         self._linux_correlation_window = 0.75
 *         self._linux_xinput_path = None             # <<<<<<<<<<<<<<
 *         self._automation_markers = (
 *             'fake_detector',
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_path, Py_None) < (0)) __PYX_ERR(0, 91, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":92
 *         self._linux_correlation_window = 0.75
 *         self._linux_xinput_path = None
 *         self._automation_markers = (             # <<<<<<<<<<<<<<
 *             'fake_detector',
 *             'fake_activity',
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_automation_markers, __pyx_mstate_global->__pyx_tuple[0]) < (0)) __PYX_ERR(0, 92, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":100
 *             'autokey',
 *         )
 *         self._automation_scan_cache_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._automation_scan_cache_active = False
 *         self._automation_scan_interval = 3.0
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_automation_scan_cache_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 100, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":101
 *         )
 *         self._automation_scan_cache_ts = 0.0
 *         self._automation_scan_cache_active = False             # <<<<<<<<<<<<<<
 *         self._automation_scan_interval = 3.0
 *         self._last_synthetic_warning_ts = 0.0
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_automation_scan_cache_active, Py_False) < (0)) __PYX_ERR(0, 101, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":102
 *         self._automation_scan_cache_ts = 0.0
 *         self._automation_scan_cache_active = False
 *         self._automation_scan_interval = 3.0             # <<<<<<<<<<<<<<
 *         self._last_synthetic_warning_ts = 0.0
 *         self._synthetic_warning_interval = 60.0
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_automation_scan_interval, __pyx_mstate_global->__pyx_float_3_0) < (0)) __PYX_ERR(0, 102, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":103
 *         self._automation_scan_cache_active = False
 *         self._automation_scan_interval = 3.0
 *         self._last_synthetic_warning_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._synthetic_warning_interval = 60.0
 *         self._stop_hooks = False
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_last_synthetic_warning_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 103, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":104
 *         self._automation_scan_interval = 3.0
 *         self._last_synthetic_warning_ts = 0.0
 *         self._synthetic_warning_interval = 60.0             # <<<<<<<<<<<<<<
 *         self._stop_hooks = False
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_synthetic_warning_interval, __pyx_mstate_global->__pyx_float_60_0) < (0)) __PYX_ERR(0, 104, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":105
 *         self._last_synthetic_warning_ts = 0.0
 *         self._synthetic_warning_interval = 60.0
 *         self._stop_hooks = False             # <<<<<<<<<<<<<<
 * 
 *         # Statistics
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_stop_hooks, Py_False) < (0)) __PYX_ERR(0, 105, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":108
 * 
 *         # Statistics
 *         self.hardware_events_counted = 0             # <<<<<<<<<<<<<<
 *         self.synthetic_events_filtered = 0
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_hardware_events_counted, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 108, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":109
 *         # Statistics
 *         self.hardware_events_counted = 0
 *         self.synthetic_events_filtered = 0             # <<<<<<<<<<<<<<
 * 
 *         # Check if validation is enabled via config
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_synthetic_events_filtered, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 109, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":112
 * 
 *         # Check if validation is enabled via config
 *         try:             # <<<<<<<<<<<<<<
 *             validation_enabled = config('hardware_event_validation_enabled', 'ActivityMonitor', 'bool')
 *             if validation_enabled is False:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":113
 *         # Check if validation is enabled via config
 *         try:
 *             validation_enabled = config('hardware_event_validation_enabled', 'ActivityMonitor', 'bool')             # <<<<<<<<<<<<<<
 *             if validation_enabled is False:
 *                 logger.info("Hardware event validation disabled via config")
*/
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_validation_enabled = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "ws_package/utils/hardware_event_validator.py":114
 *         try:
 *             validation_enabled = config('hardware_event_validation_enabled', 'ActivityMonitor', 'bool')
 *             if validation_enabled is False:             # <<<<<<<<<<<<<<
 *                 logger.info("Hardware event validation disabled via config")
 *                 return
*/
      __pyx_t_9 = (__pyx_v_validation_enabled == Py_False);
      if (__pyx_t_9) {

        /* "ws_package/utils/hardware_event_validator.py":115
 *             validation_enabled = config('hardware_event_validation_enabled', 'ActivityMonitor', 'bool')
 *             if validation_enabled is False:
 *                 logger.info("Hardware event validation disabled via config")             # <<<<<<<<<<<<<<
 *                 return
 *         except Exception:
*/
        __pyx_t_1 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
          assert(__pyx_t_1);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Hardware_event_validation_disabl};
          __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "ws_package/utils/hardware_event_validator.py":116
 *             if validation_enabled is False:
 *                 logger.info("Hardware event validation disabled via config")
 *                 return             # <<<<<<<<<<<<<<
 *         except Exception:
 *             # Default to enabled if config read fails
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L7_try_return;

        /* "ws_package/utils/hardware_event_validator.py":114
 *         try:
 *             validation_enabled = config('hardware_event_validation_enabled', 'ActivityMonitor', 'bool')
 *             if validation_enabled is False:             # <<<<<<<<<<<<<<
 *                 logger.info("Hardware event validation disabled via config")
 *                 return
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":112
 * 
 *         # Check if validation is enabled via config
 *         try:             # <<<<<<<<<<<<<<
 *             validation_enabled = config('hardware_event_validation_enabled', 'ActivityMonitor', 'bool')
 *             if validation_enabled is False:
*/
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ws_package/utils/hardware_event_validator.py":117
 *                 logger.info("Hardware event validation disabled via config")
 *                 return
 *         except Exception:             # <<<<<<<<<<<<<<
 *             # Default to enabled if config read fails
 *             pass
*/
    __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_10) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "ws_package/utils/hardware_event_validator.py":112
 * 
 *         # Check if validation is enabled via config
 *         try:             # <<<<<<<<<<<<<<
 *             validation_enabled = config('hardware_event_validation_enabled', 'ActivityMonitor', 'bool')
 *             if validation_enabled is False:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    __pyx_L8_try_end:;
  }

  /* "ws_package/utils/hardware_event_validator.py":122
 * 
 *         # Initialize platform-specific detection
 *         self._initialize()             # <<<<<<<<<<<<<<
 * 
 *     def __del__(self):
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_initialize, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ws_package/utils/hardware_event_validator.py":52
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self._enabled = False
 *         self._platform = platform.system()
*/

  /* 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("ws_package.utils.hardware_event_validator.HardwareEventValidator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_validation_enabled);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":124
 *         self._initialize()
 * 
 *     def __del__(self):             # <<<<<<<<<<<<<<
 *         """Cleanup hooks on destruction"""
 *         try:
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_3__del__(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_2__del__, "Cleanup hooks on destruction");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_3__del__ = {"__del__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_3__del__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_2__del__};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_3__del__(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 124, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 124, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__del__", 0) < (0)) __PYX_ERR(0, 124, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__del__", 1, 1, 1, i); __PYX_ERR(0, 124, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 124, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__del__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 124, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_2__del__(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_2__del__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__del__", 0);

  /* "ws_package/utils/hardware_event_validator.py":126
 *     def __del__(self):
 *         """Cleanup hooks on destruction"""
 *         try:             # <<<<<<<<<<<<<<
 *             self.cleanup()
 *         except Exception:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":127
 *         """Cleanup hooks on destruction"""
 *         try:
 *             self.cleanup()             # <<<<<<<<<<<<<<
 *         except Exception:
 *             pass
*/
      __pyx_t_5 = __pyx_v_self;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_cleanup, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":126
 *     def __del__(self):
 *         """Cleanup hooks on destruction"""
 *         try:             # <<<<<<<<<<<<<<
 *             self.cleanup()
 *         except Exception:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ws_package/utils/hardware_event_validator.py":128
 *         try:
 *             self.cleanup()
 *         except Exception:             # <<<<<<<<<<<<<<
 *             pass
 * 
*/
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_7) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "ws_package/utils/hardware_event_validator.py":126
 *     def __del__(self):
 *         """Cleanup hooks on destruction"""
 *         try:             # <<<<<<<<<<<<<<
 *             self.cleanup()
 *         except Exception:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ws_package/utils/hardware_event_validator.py":124
 *         self._initialize()
 * 
 *     def __del__(self):             # <<<<<<<<<<<<<<
 *         """Cleanup hooks on destruction"""
 *         try:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":131
 *             pass
 * 
 *     def cleanup(self):             # <<<<<<<<<<<<<<
 *         """Clean up platform-specific resources"""
 *         self._stop_hooks = True
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_5cleanup(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_4cleanup, "Clean up platform-specific resources");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_5cleanup = {"cleanup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_5cleanup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_4cleanup};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_5cleanup(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cleanup (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 131, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 131, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "cleanup", 0) < (0)) __PYX_ERR(0, 131, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("cleanup", 1, 1, 1, i); __PYX_ERR(0, 131, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 131, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cleanup", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 131, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_4cleanup(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_4cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_user32 = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_v_quartz = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  char const *__pyx_t_23;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cleanup", 0);

  /* "ws_package/utils/hardware_event_validator.py":133
 *     def cleanup(self):
 *         """Clean up platform-specific resources"""
 *         self._stop_hooks = True             # <<<<<<<<<<<<<<
 * 
 *         if self._platform == "Windows" and self._windows_hook_handles:
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_stop_hooks, Py_True) < (0)) __PYX_ERR(0, 133, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":135
 *         self._stop_hooks = True
 * 
 *         if self._platform == "Windows" and self._windows_hook_handles:             # <<<<<<<<<<<<<<
 *             try:
 *                 user32 = self._windows_hooks.get('user32')
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Windows, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_hook_handles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "ws_package/utils/hardware_event_validator.py":136
 * 
 *         if self._platform == "Windows" and self._windows_hook_handles:
 *             try:             # <<<<<<<<<<<<<<
 *                 user32 = self._windows_hooks.get('user32')
 *                 if user32:
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":137
 *         if self._platform == "Windows" and self._windows_hook_handles:
 *             try:
 *                 user32 = self._windows_hooks.get('user32')             # <<<<<<<<<<<<<<
 *                 if user32:
 *                     if 'keyboard' in self._windows_hook_handles:
*/
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_hooks); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 137, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = __pyx_t_8;
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_9 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_n_u_user32};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_v_user32 = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "ws_package/utils/hardware_event_validator.py":138
 *             try:
 *                 user32 = self._windows_hooks.get('user32')
 *                 if user32:             # <<<<<<<<<<<<<<
 *                     if 'keyboard' in self._windows_hook_handles:
 *                         user32.UnhookWindowsHookEx(self._windows_hook_handles['keyboard'])
*/
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_user32); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 138, __pyx_L6_error)
        if (__pyx_t_1) {

          /* "ws_package/utils/hardware_event_validator.py":139
 *                 user32 = self._windows_hooks.get('user32')
 *                 if user32:
 *                     if 'keyboard' in self._windows_hook_handles:             # <<<<<<<<<<<<<<
 *                         user32.UnhookWindowsHookEx(self._windows_hook_handles['keyboard'])
 *                     if 'mouse' in self._windows_hook_handles:
*/
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_hook_handles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_keyboard, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 139, __pyx_L6_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (__pyx_t_1) {

            /* "ws_package/utils/hardware_event_validator.py":140
 *                 if user32:
 *                     if 'keyboard' in self._windows_hook_handles:
 *                         user32.UnhookWindowsHookEx(self._windows_hook_handles['keyboard'])             # <<<<<<<<<<<<<<
 *                     if 'mouse' in self._windows_hook_handles:
 *                         user32.UnhookWindowsHookEx(self._windows_hook_handles['mouse'])
*/
            __pyx_t_8 = __pyx_v_user32;
            __Pyx_INCREF(__pyx_t_8);
            __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_hook_handles); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 140, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_keyboard); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 140, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_9 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_10};
              __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_UnhookWindowsHookEx, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_2);
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

            /* "ws_package/utils/hardware_event_validator.py":139
 *                 user32 = self._windows_hooks.get('user32')
 *                 if user32:
 *                     if 'keyboard' in self._windows_hook_handles:             # <<<<<<<<<<<<<<
 *                         user32.UnhookWindowsHookEx(self._windows_hook_handles['keyboard'])
 *                     if 'mouse' in self._windows_hook_handles:
*/
          }

          /* "ws_package/utils/hardware_event_validator.py":141
 *                     if 'keyboard' in self._windows_hook_handles:
 *                         user32.UnhookWindowsHookEx(self._windows_hook_handles['keyboard'])
 *                     if 'mouse' in self._windows_hook_handles:             # <<<<<<<<<<<<<<
 *                         user32.UnhookWindowsHookEx(self._windows_hook_handles['mouse'])
 *             except Exception as e:
*/
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_hook_handles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_mouse, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 141, __pyx_L6_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (__pyx_t_1) {

            /* "ws_package/utils/hardware_event_validator.py":142
 *                         user32.UnhookWindowsHookEx(self._windows_hook_handles['keyboard'])
 *                     if 'mouse' in self._windows_hook_handles:
 *                         user32.UnhookWindowsHookEx(self._windows_hook_handles['mouse'])             # <<<<<<<<<<<<<<
 *             except Exception as e:
 *                 logger.debug("Error cleaning up Windows hooks: %s", e)
*/
            __pyx_t_10 = __pyx_v_user32;
            __Pyx_INCREF(__pyx_t_10);
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_hook_handles); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 142, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_mouse); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 142, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_9 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_7};
              __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_UnhookWindowsHookEx, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_2);
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

            /* "ws_package/utils/hardware_event_validator.py":141
 *                     if 'keyboard' in self._windows_hook_handles:
 *                         user32.UnhookWindowsHookEx(self._windows_hook_handles['keyboard'])
 *                     if 'mouse' in self._windows_hook_handles:             # <<<<<<<<<<<<<<
 *                         user32.UnhookWindowsHookEx(self._windows_hook_handles['mouse'])
 *             except Exception as e:
*/
          }

          /* "ws_package/utils/hardware_event_validator.py":138
 *             try:
 *                 user32 = self._windows_hooks.get('user32')
 *                 if user32:             # <<<<<<<<<<<<<<
 *                     if 'keyboard' in self._windows_hook_handles:
 *                         user32.UnhookWindowsHookEx(self._windows_hook_handles['keyboard'])
*/
        }

        /* "ws_package/utils/hardware_event_validator.py":136
 * 
 *         if self._platform == "Windows" and self._windows_hook_handles:
 *             try:             # <<<<<<<<<<<<<<
 *                 user32 = self._windows_hooks.get('user32')
 *                 if user32:
*/
      }
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L11_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "ws_package/utils/hardware_event_validator.py":143
 *                     if 'mouse' in self._windows_hook_handles:
 *                         user32.UnhookWindowsHookEx(self._windows_hook_handles['mouse'])
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 logger.debug("Error cleaning up Windows hooks: %s", e)
 * 
*/
      __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_11) {
        __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_10) < 0) __PYX_ERR(0, 143, __pyx_L8_except_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_7);
        __pyx_v_e = __pyx_t_7;
        /*try:*/ {

          /* "ws_package/utils/hardware_event_validator.py":144
 *                         user32.UnhookWindowsHookEx(self._windows_hook_handles['mouse'])
 *             except Exception as e:
 *                 logger.debug("Error cleaning up Windows hooks: %s", e)             # <<<<<<<<<<<<<<
 * 
 *         if self._platform == "Darwin" and hasattr(self, '_macos_event_tap'):
*/
          __pyx_t_12 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 144, __pyx_L20_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 144, __pyx_L20_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_9 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_14);
            assert(__pyx_t_12);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
            __pyx_t_9 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_mstate_global->__pyx_kp_u_Error_cleaning_up_Windows_hooks, __pyx_v_e};
            __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 144, __pyx_L20_error)
            __Pyx_GOTREF(__pyx_t_8);
          }
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }

        /* "ws_package/utils/hardware_event_validator.py":143
 *                     if 'mouse' in self._windows_hook_handles:
 *                         user32.UnhookWindowsHookEx(self._windows_hook_handles['mouse'])
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 logger.debug("Error cleaning up Windows hooks: %s", e)
 * 
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            goto __pyx_L21;
          }
          __pyx_L20_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
            if ( unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_22);
            __pyx_t_11 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
            __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
            __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
            goto __pyx_L8_except_error;
          }
          __pyx_L21:;
        }
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L7_exception_handled;
      }
      goto __pyx_L8_except_error;

      /* "ws_package/utils/hardware_event_validator.py":136
 * 
 *         if self._platform == "Windows" and self._windows_hook_handles:
 *             try:             # <<<<<<<<<<<<<<
 *                 user32 = self._windows_hooks.get('user32')
 *                 if user32:
*/
      __pyx_L8_except_error:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      goto __pyx_L1_error;
      __pyx_L7_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      __pyx_L11_try_end:;
    }

    /* "ws_package/utils/hardware_event_validator.py":135
 *         self._stop_hooks = True
 * 
 *         if self._platform == "Windows" and self._windows_hook_handles:             # <<<<<<<<<<<<<<
 *             try:
 *                 user32 = self._windows_hooks.get('user32')
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":146
 *                 logger.debug("Error cleaning up Windows hooks: %s", e)
 * 
 *         if self._platform == "Darwin" and hasattr(self, '_macos_event_tap'):             # <<<<<<<<<<<<<<
 *             try:
 *                 if self._macos_quartz_available and hasattr(self, '_macos_quartz') and self._macos_event_tap:
*/
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_Darwin, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L27_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_HasAttr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_event_tap); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 146, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L27_bool_binop_done:;
  if (__pyx_t_1) {

    /* "ws_package/utils/hardware_event_validator.py":147
 * 
 *         if self._platform == "Darwin" and hasattr(self, '_macos_event_tap'):
 *             try:             # <<<<<<<<<<<<<<
 *                 if self._macos_quartz_available and hasattr(self, '_macos_quartz') and self._macos_event_tap:
 *                     quartz = self._macos_quartz
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":148
 *         if self._platform == "Darwin" and hasattr(self, '_macos_event_tap'):
 *             try:
 *                 if self._macos_quartz_available and hasattr(self, '_macos_quartz') and self._macos_event_tap:             # <<<<<<<<<<<<<<
 *                     quartz = self._macos_quartz
 *                     # Disable the event tap first
*/
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_quartz_available); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 148, __pyx_L29_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 148, __pyx_L29_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (__pyx_t_3) {
        } else {
          __pyx_t_1 = __pyx_t_3;
          goto __pyx_L36_bool_binop_done;
        }
        __pyx_t_3 = __Pyx_HasAttr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_quartz); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 148, __pyx_L29_error)
        if (__pyx_t_3) {
        } else {
          __pyx_t_1 = __pyx_t_3;
          goto __pyx_L36_bool_binop_done;
        }
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_event_tap); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 148, __pyx_L29_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 148, __pyx_L29_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_1 = __pyx_t_3;
        __pyx_L36_bool_binop_done:;
        if (__pyx_t_1) {

          /* "ws_package/utils/hardware_event_validator.py":149
 *             try:
 *                 if self._macos_quartz_available and hasattr(self, '_macos_quartz') and self._macos_event_tap:
 *                     quartz = self._macos_quartz             # <<<<<<<<<<<<<<
 *                     # Disable the event tap first
 *                     quartz.CGEventTapEnable(self._macos_event_tap, False)
*/
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_quartz); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 149, __pyx_L29_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_v_quartz = __pyx_t_10;
          __pyx_t_10 = 0;

          /* "ws_package/utils/hardware_event_validator.py":151
 *                     quartz = self._macos_quartz
 *                     # Disable the event tap first
 *                     quartz.CGEventTapEnable(self._macos_event_tap, False)             # <<<<<<<<<<<<<<
 *                     # Wait longer for CFRunLoop to process the disable command
 *                     # This ensures WindowServer fully releases the event tap and flushes queued events
*/
          __pyx_t_7 = __pyx_v_quartz;
          __Pyx_INCREF(__pyx_t_7);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_event_tap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L29_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_9 = 0;
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_2, Py_False};
            __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_CGEventTapEnable, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 151, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_10);
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

          /* "ws_package/utils/hardware_event_validator.py":154
 *                     # Wait longer for CFRunLoop to process the disable command
 *                     # This ensures WindowServer fully releases the event tap and flushes queued events
 *                     time.sleep(0.5)  # Increased from 0.2s to allow WindowServer to flush queued events             # <<<<<<<<<<<<<<
 *                     # Clear references to allow proper cleanup
 *                     self._macos_event_tap = None
*/
          __pyx_t_2 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 154, __pyx_L29_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_sleep); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 154, __pyx_L29_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_9 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_8))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
            assert(__pyx_t_2);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
            __pyx_t_9 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_float_0_5};
            __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 154, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_10);
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

          /* "ws_package/utils/hardware_event_validator.py":156
 *                     time.sleep(0.5)  # Increased from 0.2s to allow WindowServer to flush queued events
 *                     # Clear references to allow proper cleanup
 *                     self._macos_event_tap = None             # <<<<<<<<<<<<<<
 *                     self._macos_quartz_available = False
 *                     logger.debug("macOS event tap disabled and cleaned up")
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_event_tap, Py_None) < (0)) __PYX_ERR(0, 156, __pyx_L29_error)

          /* "ws_package/utils/hardware_event_validator.py":157
 *                     # Clear references to allow proper cleanup
 *                     self._macos_event_tap = None
 *                     self._macos_quartz_available = False             # <<<<<<<<<<<<<<
 *                     logger.debug("macOS event tap disabled and cleaned up")
 *             except Exception as e:
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_quartz_available, Py_False) < (0)) __PYX_ERR(0, 157, __pyx_L29_error)

          /* "ws_package/utils/hardware_event_validator.py":158
 *                     self._macos_event_tap = None
 *                     self._macos_quartz_available = False
 *                     logger.debug("macOS event tap disabled and cleaned up")             # <<<<<<<<<<<<<<
 *             except Exception as e:
 *                 logger.debug("Error cleaning up macOS event tap: %s", e)
*/
          __pyx_t_8 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L29_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 158, __pyx_L29_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_9 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
            assert(__pyx_t_8);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
            __pyx_t_9 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_macOS_event_tap_disabled_and_cle};
            __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 158, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_10);
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

          /* "ws_package/utils/hardware_event_validator.py":148
 *         if self._platform == "Darwin" and hasattr(self, '_macos_event_tap'):
 *             try:
 *                 if self._macos_quartz_available and hasattr(self, '_macos_quartz') and self._macos_event_tap:             # <<<<<<<<<<<<<<
 *                     quartz = self._macos_quartz
 *                     # Disable the event tap first
*/
        }

        /* "ws_package/utils/hardware_event_validator.py":147
 * 
 *         if self._platform == "Darwin" and hasattr(self, '_macos_event_tap'):
 *             try:             # <<<<<<<<<<<<<<
 *                 if self._macos_quartz_available and hasattr(self, '_macos_quartz') and self._macos_event_tap:
 *                     quartz = self._macos_quartz
*/
      }
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L34_try_end;
      __pyx_L29_error:;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "ws_package/utils/hardware_event_validator.py":159
 *                     self._macos_quartz_available = False
 *                     logger.debug("macOS event tap disabled and cleaned up")
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 logger.debug("Error cleaning up macOS event tap: %s", e)
 *                 # Ensure we mark as unavailable even on error
*/
      __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_15) {
        __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 159, __pyx_L31_except_error)
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __pyx_v_e = __pyx_t_7;
        /*try:*/ {

          /* "ws_package/utils/hardware_event_validator.py":160
 *                     logger.debug("macOS event tap disabled and cleaned up")
 *             except Exception as e:
 *                 logger.debug("Error cleaning up macOS event tap: %s", e)             # <<<<<<<<<<<<<<
 *                 # Ensure we mark as unavailable even on error
 *                 self._macos_quartz_available = False
*/
          __pyx_t_14 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 160, __pyx_L44_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 160, __pyx_L44_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_9 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_13))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
            assert(__pyx_t_14);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
            __pyx_t_9 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Error_cleaning_up_macOS_event_ta, __pyx_v_e};
            __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L44_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "ws_package/utils/hardware_event_validator.py":162
 *                 logger.debug("Error cleaning up macOS event tap: %s", e)
 *                 # Ensure we mark as unavailable even on error
 *                 self._macos_quartz_available = False             # <<<<<<<<<<<<<<
 *                 if hasattr(self, '_macos_event_tap'):
 *                     self._macos_event_tap = None
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_quartz_available, Py_False) < (0)) __PYX_ERR(0, 162, __pyx_L44_error)

          /* "ws_package/utils/hardware_event_validator.py":163
 *                 # Ensure we mark as unavailable even on error
 *                 self._macos_quartz_available = False
 *                 if hasattr(self, '_macos_event_tap'):             # <<<<<<<<<<<<<<
 *                     self._macos_event_tap = None
 * 
*/
          __pyx_t_1 = __Pyx_HasAttr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_event_tap); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 163, __pyx_L44_error)
          if (__pyx_t_1) {

            /* "ws_package/utils/hardware_event_validator.py":164
 *                 self._macos_quartz_available = False
 *                 if hasattr(self, '_macos_event_tap'):
 *                     self._macos_event_tap = None             # <<<<<<<<<<<<<<
 * 
 *         if self._platform == "Linux":
*/
            if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_event_tap, Py_None) < (0)) __PYX_ERR(0, 164, __pyx_L44_error)

            /* "ws_package/utils/hardware_event_validator.py":163
 *                 # Ensure we mark as unavailable even on error
 *                 self._macos_quartz_available = False
 *                 if hasattr(self, '_macos_event_tap'):             # <<<<<<<<<<<<<<
 *                     self._macos_event_tap = None
 * 
*/
          }
        }

        /* "ws_package/utils/hardware_event_validator.py":159
 *                     self._macos_quartz_available = False
 *                     logger.debug("macOS event tap disabled and cleaned up")
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 logger.debug("Error cleaning up macOS event tap: %s", e)
 *                 # Ensure we mark as unavailable even on error
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            goto __pyx_L45;
          }
          __pyx_L44_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17);
            if ( unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_17);
            __pyx_t_15 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_23 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_18, __pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ErrRestore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
            __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0;
            __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_23;
            goto __pyx_L31_except_error;
          }
          __pyx_L45:;
        }
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L30_exception_handled;
      }
      goto __pyx_L31_except_error;

      /* "ws_package/utils/hardware_event_validator.py":147
 * 
 *         if self._platform == "Darwin" and hasattr(self, '_macos_event_tap'):
 *             try:             # <<<<<<<<<<<<<<
 *                 if self._macos_quartz_available and hasattr(self, '_macos_quartz') and self._macos_event_tap:
 *                     quartz = self._macos_quartz
*/
      __pyx_L31_except_error:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4);
      goto __pyx_L1_error;
      __pyx_L30_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4);
      __pyx_L34_try_end:;
    }

    /* "ws_package/utils/hardware_event_validator.py":146
 *                 logger.debug("Error cleaning up Windows hooks: %s", e)
 * 
 *         if self._platform == "Darwin" and hasattr(self, '_macos_event_tap'):             # <<<<<<<<<<<<<<
 *             try:
 *                 if self._macos_quartz_available and hasattr(self, '_macos_quartz') and self._macos_event_tap:
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":166
 *                     self._macos_event_tap = None
 * 
 *         if self._platform == "Linux":             # <<<<<<<<<<<<<<
 *             self._linux_teardown_monitors()
 * 
*/
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Linux, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__pyx_t_1) {

    /* "ws_package/utils/hardware_event_validator.py":167
 * 
 *         if self._platform == "Linux":
 *             self._linux_teardown_monitors()             # <<<<<<<<<<<<<<
 * 
 *     def _linux_teardown_monitors(self):
*/
    __pyx_t_7 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_linux_teardown_monitors, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "ws_package/utils/hardware_event_validator.py":166
 *                     self._macos_event_tap = None
 * 
 *         if self._platform == "Linux":             # <<<<<<<<<<<<<<
 *             self._linux_teardown_monitors()
 * 
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":131
 *             pass
 * 
 *     def cleanup(self):             # <<<<<<<<<<<<<<
 *         """Clean up platform-specific resources"""
 *         self._stop_hooks = True
*/

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_user32);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_quartz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":169
 *             self._linux_teardown_monitors()
 * 
 *     def _linux_teardown_monitors(self):             # <<<<<<<<<<<<<<
 *         """Stop Linux evdev/xinput monitor threads and close device handles."""
 *         proc = self._linux_xinput_process
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_7_linux_teardown_monitors(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_6_linux_teardown_monitors, "Stop Linux evdev/xinput monitor threads and close device handles.");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_7_linux_teardown_monitors = {"_linux_teardown_monitors", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_7_linux_teardown_monitors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_6_linux_teardown_monitors};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_7_linux_teardown_monitors(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_linux_teardown_monitors (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 169, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_linux_teardown_monitors", 0) < (0)) __PYX_ERR(0, 169, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_linux_teardown_monitors", 1, 1, 1, i); __PYX_ERR(0, 169, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 169, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_linux_teardown_monitors", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 169, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_teardown_monitors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_6_linux_teardown_monitors(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_6_linux_teardown_monitors(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_proc = NULL;
  PyObject *__pyx_v_device = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  Py_ssize_t __pyx_t_16;
  PyObject *(*__pyx_t_17)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_linux_teardown_monitors", 0);

  /* "ws_package/utils/hardware_event_validator.py":171
 *     def _linux_teardown_monitors(self):
 *         """Stop Linux evdev/xinput monitor threads and close device handles."""
 *         proc = self._linux_xinput_process             # <<<<<<<<<<<<<<
 *         if proc is not None and proc.poll() is None:
 *             try:
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_process); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_proc = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":172
 *         """Stop Linux evdev/xinput monitor threads and close device handles."""
 *         proc = self._linux_xinput_process
 *         if proc is not None and proc.poll() is None:             # <<<<<<<<<<<<<<
 *             try:
 *                 proc.terminate()
*/
  __pyx_t_3 = (__pyx_v_proc != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __pyx_v_proc;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_poll, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_3 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "ws_package/utils/hardware_event_validator.py":173
 *         proc = self._linux_xinput_process
 *         if proc is not None and proc.poll() is None:
 *             try:             # <<<<<<<<<<<<<<
 *                 proc.terminate()
 *                 proc.wait(timeout=2.0)
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":174
 *         if proc is not None and proc.poll() is None:
 *             try:
 *                 proc.terminate()             # <<<<<<<<<<<<<<
 *                 proc.wait(timeout=2.0)
 *             except Exception:
*/
        __pyx_t_4 = __pyx_v_proc;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_terminate, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":175
 *             try:
 *                 proc.terminate()
 *                 proc.wait(timeout=2.0)             # <<<<<<<<<<<<<<
 *             except Exception:
 *                 try:
*/
        __pyx_t_4 = __pyx_v_proc;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, NULL};
          __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 175, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_timeout, __pyx_mstate_global->__pyx_float_2_0, __pyx_t_9, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 175, __pyx_L6_error)
          __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_wait, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":173
 *         proc = self._linux_xinput_process
 *         if proc is not None and proc.poll() is None:
 *             try:             # <<<<<<<<<<<<<<
 *                 proc.terminate()
 *                 proc.wait(timeout=2.0)
*/
      }
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L11_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "ws_package/utils/hardware_event_validator.py":176
 *                 proc.terminate()
 *                 proc.wait(timeout=2.0)
 *             except Exception:             # <<<<<<<<<<<<<<
 *                 try:
 *                     proc.kill()
*/
      __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_10) {
        __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_teardown_monitors", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_9, &__pyx_t_4) < 0) __PYX_ERR(0, 176, __pyx_L8_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_4);

        /* "ws_package/utils/hardware_event_validator.py":177
 *                 proc.wait(timeout=2.0)
 *             except Exception:
 *                 try:             # <<<<<<<<<<<<<<
 *                     proc.kill()
 *                 except Exception:
*/
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_13);
          /*try:*/ {

            /* "ws_package/utils/hardware_event_validator.py":178
 *             except Exception:
 *                 try:
 *                     proc.kill()             # <<<<<<<<<<<<<<
 *                 except Exception:
 *                     pass
*/
            __pyx_t_15 = __pyx_v_proc;
            __Pyx_INCREF(__pyx_t_15);
            __pyx_t_5 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_15, NULL};
              __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_kill, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 178, __pyx_L14_error)
              __Pyx_GOTREF(__pyx_t_14);
            }
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

            /* "ws_package/utils/hardware_event_validator.py":177
 *                 proc.wait(timeout=2.0)
 *             except Exception:
 *                 try:             # <<<<<<<<<<<<<<
 *                     proc.kill()
 *                 except Exception:
*/
          }
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          goto __pyx_L21_try_end;
          __pyx_L14_error:;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;

          /* "ws_package/utils/hardware_event_validator.py":179
 *                 try:
 *                     proc.kill()
 *                 except Exception:             # <<<<<<<<<<<<<<
 *                     pass
 *         self._linux_xinput_process = None
*/
          __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
          if (__pyx_t_10) {
            __Pyx_ErrRestore(0,0,0);
            goto __pyx_L15_exception_handled;
          }
          goto __pyx_L16_except_error;

          /* "ws_package/utils/hardware_event_validator.py":177
 *                 proc.wait(timeout=2.0)
 *             except Exception:
 *                 try:             # <<<<<<<<<<<<<<
 *                     proc.kill()
 *                 except Exception:
*/
          __pyx_L16_except_error:;
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
          goto __pyx_L8_except_error;
          __pyx_L15_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
          __pyx_L21_try_end:;
        }
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L7_exception_handled;
      }
      goto __pyx_L8_except_error;

      /* "ws_package/utils/hardware_event_validator.py":173
 *         proc = self._linux_xinput_process
 *         if proc is not None and proc.poll() is None:
 *             try:             # <<<<<<<<<<<<<<
 *                 proc.terminate()
 *                 proc.wait(timeout=2.0)
*/
      __pyx_L8_except_error:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L1_error;
      __pyx_L7_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      __pyx_L11_try_end:;
    }

    /* "ws_package/utils/hardware_event_validator.py":172
 *         """Stop Linux evdev/xinput monitor threads and close device handles."""
 *         proc = self._linux_xinput_process
 *         if proc is not None and proc.poll() is None:             # <<<<<<<<<<<<<<
 *             try:
 *                 proc.terminate()
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":181
 *                 except Exception:
 *                     pass
 *         self._linux_xinput_process = None             # <<<<<<<<<<<<<<
 *         self._linux_xinput_monitor_active = False
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_process, Py_None) < (0)) __PYX_ERR(0, 181, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":182
 *                     pass
 *         self._linux_xinput_process = None
 *         self._linux_xinput_monitor_active = False             # <<<<<<<<<<<<<<
 * 
 *         for device in self._linux_open_devices:
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_monitor_active, Py_False) < (0)) __PYX_ERR(0, 182, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":184
 *         self._linux_xinput_monitor_active = False
 * 
 *         for device in self._linux_open_devices:             # <<<<<<<<<<<<<<
 *             try:
 *                 device.close()
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_open_devices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_9 = __pyx_t_4; __Pyx_INCREF(__pyx_t_9);
    __pyx_t_16 = 0;
    __pyx_t_17 = NULL;
  } else {
    __pyx_t_16 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_17 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 184, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_17)) {
      if (likely(PyList_CheckExact(__pyx_t_9))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 184, __pyx_L1_error)
          #endif
          if (__pyx_t_16 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_16;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 184, __pyx_L1_error)
          #endif
          if (__pyx_t_16 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_16));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_16);
        #endif
        ++__pyx_t_16;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_17(__pyx_t_9);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 184, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_device, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "ws_package/utils/hardware_event_validator.py":185
 * 
 *         for device in self._linux_open_devices:
 *             try:             # <<<<<<<<<<<<<<
 *                 device.close()
 *             except Exception:
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_6);
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":186
 *         for device in self._linux_open_devices:
 *             try:
 *                 device.close()             # <<<<<<<<<<<<<<
 *             except Exception:
 *                 pass
*/
        __pyx_t_1 = __pyx_v_device;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_close, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L26_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "ws_package/utils/hardware_event_validator.py":185
 * 
 *         for device in self._linux_open_devices:
 *             try:             # <<<<<<<<<<<<<<
 *                 device.close()
 *             except Exception:
*/
      }
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L33_try_end;
      __pyx_L26_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":187
 *             try:
 *                 device.close()
 *             except Exception:             # <<<<<<<<<<<<<<
 *                 pass
 *         self._linux_open_devices = []
*/
      __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_10) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L27_exception_handled;
      }
      goto __pyx_L28_except_error;

      /* "ws_package/utils/hardware_event_validator.py":185
 * 
 *         for device in self._linux_open_devices:
 *             try:             # <<<<<<<<<<<<<<
 *                 device.close()
 *             except Exception:
*/
      __pyx_L28_except_error:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      goto __pyx_L1_error;
      __pyx_L27_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      __pyx_L33_try_end:;
    }

    /* "ws_package/utils/hardware_event_validator.py":184
 *         self._linux_xinput_monitor_active = False
 * 
 *         for device in self._linux_open_devices:             # <<<<<<<<<<<<<<
 *             try:
 *                 device.close()
*/
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "ws_package/utils/hardware_event_validator.py":189
 *             except Exception:
 *                 pass
 *         self._linux_open_devices = []             # <<<<<<<<<<<<<<
 * 
 *     def _linux_reset_timestamps(self):
*/
  __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_open_devices, __pyx_t_9) < (0)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "ws_package/utils/hardware_event_validator.py":169
 *             self._linux_teardown_monitors()
 * 
 *     def _linux_teardown_monitors(self):             # <<<<<<<<<<<<<<
 *         """Stop Linux evdev/xinput monitor threads and close device handles."""
 *         proc = self._linux_xinput_process
*/

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_teardown_monitors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_proc);
  __Pyx_XDECREF(__pyx_v_device);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":191
 *         self._linux_open_devices = []
 * 
 *     def _linux_reset_timestamps(self):             # <<<<<<<<<<<<<<
 *         """Clear correlation timestamps (e.g. after scripted input session)."""
 *         with self._linux_lock:
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_9_linux_reset_timestamps(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_8_linux_reset_timestamps, "Clear correlation timestamps (e.g. after scripted input session).");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_9_linux_reset_timestamps = {"_linux_reset_timestamps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_9_linux_reset_timestamps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_8_linux_reset_timestamps};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_9_linux_reset_timestamps(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_linux_reset_timestamps (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 191, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 191, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_linux_reset_timestamps", 0) < (0)) __PYX_ERR(0, 191, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_linux_reset_timestamps", 1, 1, 1, i); __PYX_ERR(0, 191, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 191, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_linux_reset_timestamps", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 191, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_reset_timestamps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_8_linux_reset_timestamps(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_8_linux_reset_timestamps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_linux_reset_timestamps", 0);

  /* "ws_package/utils/hardware_event_validator.py":193
 *     def _linux_reset_timestamps(self):
 *         """Clear correlation timestamps (e.g. after scripted input session)."""
 *         with self._linux_lock:             # <<<<<<<<<<<<<<
 *             self._linux_last_evdev_keyboard_ts = 0.0
 *             self._linux_last_evdev_mouse_ts = 0.0
*/
  /*with:*/ {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {

          /* "ws_package/utils/hardware_event_validator.py":194
 *         """Clear correlation timestamps (e.g. after scripted input session)."""
 *         with self._linux_lock:
 *             self._linux_last_evdev_keyboard_ts = 0.0             # <<<<<<<<<<<<<<
 *             self._linux_last_evdev_mouse_ts = 0.0
 *             self._linux_last_xtest_keyboard_ts = 0.0
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_evdev_keyboard_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 194, __pyx_L7_error)

          /* "ws_package/utils/hardware_event_validator.py":195
 *         with self._linux_lock:
 *             self._linux_last_evdev_keyboard_ts = 0.0
 *             self._linux_last_evdev_mouse_ts = 0.0             # <<<<<<<<<<<<<<
 *             self._linux_last_xtest_keyboard_ts = 0.0
 *             self._linux_last_xtest_mouse_ts = 0.0
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_evdev_mouse_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 195, __pyx_L7_error)

          /* "ws_package/utils/hardware_event_validator.py":196
 *             self._linux_last_evdev_keyboard_ts = 0.0
 *             self._linux_last_evdev_mouse_ts = 0.0
 *             self._linux_last_xtest_keyboard_ts = 0.0             # <<<<<<<<<<<<<<
 *             self._linux_last_xtest_mouse_ts = 0.0
 *             self._linux_last_hw_keyboard_ts = 0.0
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_xtest_keyboard_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 196, __pyx_L7_error)

          /* "ws_package/utils/hardware_event_validator.py":197
 *             self._linux_last_evdev_mouse_ts = 0.0
 *             self._linux_last_xtest_keyboard_ts = 0.0
 *             self._linux_last_xtest_mouse_ts = 0.0             # <<<<<<<<<<<<<<
 *             self._linux_last_hw_keyboard_ts = 0.0
 *             self._linux_last_hw_mouse_ts = 0.0
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_xtest_mouse_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 197, __pyx_L7_error)

          /* "ws_package/utils/hardware_event_validator.py":198
 *             self._linux_last_xtest_keyboard_ts = 0.0
 *             self._linux_last_xtest_mouse_ts = 0.0
 *             self._linux_last_hw_keyboard_ts = 0.0             # <<<<<<<<<<<<<<
 *             self._linux_last_hw_mouse_ts = 0.0
 * 
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_hw_keyboard_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 198, __pyx_L7_error)

          /* "ws_package/utils/hardware_event_validator.py":199
 *             self._linux_last_xtest_mouse_ts = 0.0
 *             self._linux_last_hw_keyboard_ts = 0.0
 *             self._linux_last_hw_mouse_ts = 0.0             # <<<<<<<<<<<<<<
 * 
 *     def reinitialize_linux(self):
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_hw_mouse_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 199, __pyx_L7_error)

          /* "ws_package/utils/hardware_event_validator.py":193
 *     def _linux_reset_timestamps(self):
 *         """Clear correlation timestamps (e.g. after scripted input session)."""
 *         with self._linux_lock:             # <<<<<<<<<<<<<<
 *             self._linux_last_evdev_keyboard_ts = 0.0
 *             self._linux_last_evdev_mouse_ts = 0.0
*/
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_reset_timestamps", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_5) < 0) __PYX_ERR(0, 193, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_5);
          __pyx_t_4 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 193, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (__pyx_t_11 < (0)) __PYX_ERR(0, 193, __pyx_L9_except_error)
          __pyx_t_12 = (!__pyx_t_11);
          if (unlikely(__pyx_t_12)) {
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_5);
            __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_5);
            __pyx_t_1 = 0;  __pyx_t_3 = 0;  __pyx_t_5 = 0; 
            __PYX_ERR(0, 193, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_2) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[2], NULL);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 193, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "ws_package/utils/hardware_event_validator.py":191
 *         self._linux_open_devices = []
 * 
 *     def _linux_reset_timestamps(self):             # <<<<<<<<<<<<<<
 *         """Clear correlation timestamps (e.g. after scripted input session)."""
 *         with self._linux_lock:
*/

  /* 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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_reset_timestamps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":201
 *             self._linux_last_hw_mouse_ts = 0.0
 * 
 *     def reinitialize_linux(self):             # <<<<<<<<<<<<<<
 *         """
 *         Restart Linux monitors after a listener restart.
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_11reinitialize_linux(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_10reinitialize_linux, "\n        Restart Linux monitors after a listener restart.\n\n        cleanup() alone leaves evdev/xinput dead while is_enabled() stays True,\n        which breaks real activity tracking after scripted input sessions.\n        ");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_11reinitialize_linux = {"reinitialize_linux", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_11reinitialize_linux, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_10reinitialize_linux};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_11reinitialize_linux(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reinitialize_linux (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 201, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 201, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "reinitialize_linux", 0) < (0)) __PYX_ERR(0, 201, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("reinitialize_linux", 1, 1, 1, i); __PYX_ERR(0, 201, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 201, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reinitialize_linux", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 201, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.reinitialize_linux", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_10reinitialize_linux(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_10reinitialize_linux(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reinitialize_linux", 0);

  /* "ws_package/utils/hardware_event_validator.py":208
 *         which breaks real activity tracking after scripted input sessions.
 *         """
 *         if self._platform != "Linux":             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Linux, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "ws_package/utils/hardware_event_validator.py":209
 *         """
 *         if self._platform != "Linux":
 *             return             # <<<<<<<<<<<<<<
 * 
 *         logger.info("Reinitializing Linux hardware validation monitors")
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":208
 *         which breaks real activity tracking after scripted input sessions.
 *         """
 *         if self._platform != "Linux":             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":211
 *             return
 * 
 *         logger.info("Reinitializing Linux hardware validation monitors")             # <<<<<<<<<<<<<<
 *         self._stop_hooks = True
 *         time.sleep(0.4)
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Reinitializing_Linux_hardware_va};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":212
 * 
 *         logger.info("Reinitializing Linux hardware validation monitors")
 *         self._stop_hooks = True             # <<<<<<<<<<<<<<
 *         time.sleep(0.4)
 *         self._linux_teardown_monitors()
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_stop_hooks, Py_True) < (0)) __PYX_ERR(0, 212, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":213
 *         logger.info("Reinitializing Linux hardware validation monitors")
 *         self._stop_hooks = True
 *         time.sleep(0.4)             # <<<<<<<<<<<<<<
 *         self._linux_teardown_monitors()
 *         self._linux_reset_timestamps()
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sleep); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_float_0_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":214
 *         self._stop_hooks = True
 *         time.sleep(0.4)
 *         self._linux_teardown_monitors()             # <<<<<<<<<<<<<<
 *         self._linux_reset_timestamps()
 *         self._stop_hooks = False
*/
  __pyx_t_4 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_linux_teardown_monitors, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":215
 *         time.sleep(0.4)
 *         self._linux_teardown_monitors()
 *         self._linux_reset_timestamps()             # <<<<<<<<<<<<<<
 *         self._stop_hooks = False
 *         self._initialize_linux()
*/
  __pyx_t_4 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_linux_reset_timestamps, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":216
 *         self._linux_teardown_monitors()
 *         self._linux_reset_timestamps()
 *         self._stop_hooks = False             # <<<<<<<<<<<<<<
 *         self._initialize_linux()
 *         logger.info(
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_stop_hooks, Py_False) < (0)) __PYX_ERR(0, 216, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":217
 *         self._linux_reset_timestamps()
 *         self._stop_hooks = False
 *         self._initialize_linux()             # <<<<<<<<<<<<<<
 *         logger.info(
 *             "Linux hardware validation reinitialized "
*/
  __pyx_t_4 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_initialize_linux, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":218
 *         self._stop_hooks = False
 *         self._initialize_linux()
 *         logger.info(             # <<<<<<<<<<<<<<
 *             "Linux hardware validation reinitialized "
 *             "(evdev=%s, xinput_monitor=%s, enabled=%s)",
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":221
 *             "Linux hardware validation reinitialized "
 *             "(evdev=%s, xinput_monitor=%s, enabled=%s)",
 *             len(self._linux_open_devices),             # <<<<<<<<<<<<<<
 *             self._linux_xinput_monitor_active,
 *             self._enabled,
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_open_devices); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 221, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyLong_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "ws_package/utils/hardware_event_validator.py":222
 *             "(evdev=%s, xinput_monitor=%s, enabled=%s)",
 *             len(self._linux_open_devices),
 *             self._linux_xinput_monitor_active,             # <<<<<<<<<<<<<<
 *             self._enabled,
 *         )
*/
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_monitor_active); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "ws_package/utils/hardware_event_validator.py":223
 *             len(self._linux_open_devices),
 *             self._linux_xinput_monitor_active,
 *             self._enabled,             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_enabled); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Linux_hardware_validation_reinit, __pyx_t_5, __pyx_t_8, __pyx_t_9};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":201
 *             self._linux_last_hw_mouse_ts = 0.0
 * 
 *     def reinitialize_linux(self):             # <<<<<<<<<<<<<<
 *         """
 *         Restart Linux monitors after a listener restart.
*/

  /* 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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.reinitialize_linux", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":226
 *         )
 * 
 *     def _initialize(self):             # <<<<<<<<<<<<<<
 *         """Initialize platform-specific hardware detection"""
 *         try:
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_13_initialize(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_12_initialize, "Initialize platform-specific hardware detection");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_13_initialize = {"_initialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_13_initialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_12_initialize};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_13_initialize(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_initialize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 226, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_initialize", 0) < (0)) __PYX_ERR(0, 226, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_initialize", 1, 1, 1, i); __PYX_ERR(0, 226, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 226, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_initialize", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 226, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_12_initialize(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_12_initialize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  char const *__pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_initialize", 0);

  /* "ws_package/utils/hardware_event_validator.py":228
 *     def _initialize(self):
 *         """Initialize platform-specific hardware detection"""
 *         try:             # <<<<<<<<<<<<<<
 *             if self._platform == "Windows":
 *                 self._initialize_windows()
*/
  /*try:*/ {
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":229
 *         """Initialize platform-specific hardware detection"""
 *         try:
 *             if self._platform == "Windows":             # <<<<<<<<<<<<<<
 *                 self._initialize_windows()
 *             elif self._platform == "Darwin":
*/
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Windows, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 229, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_5) {

          /* "ws_package/utils/hardware_event_validator.py":230
 *         try:
 *             if self._platform == "Windows":
 *                 self._initialize_windows()             # <<<<<<<<<<<<<<
 *             elif self._platform == "Darwin":
 *                 self._initialize_macos()
*/
          __pyx_t_6 = __pyx_v_self;
          __Pyx_INCREF(__pyx_t_6);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
            __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_initialize_windows, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "ws_package/utils/hardware_event_validator.py":229
 *         """Initialize platform-specific hardware detection"""
 *         try:
 *             if self._platform == "Windows":             # <<<<<<<<<<<<<<
 *                 self._initialize_windows()
 *             elif self._platform == "Darwin":
*/
          goto __pyx_L12;
        }

        /* "ws_package/utils/hardware_event_validator.py":231
 *             if self._platform == "Windows":
 *                 self._initialize_windows()
 *             elif self._platform == "Darwin":             # <<<<<<<<<<<<<<
 *                 self._initialize_macos()
 *             elif self._platform == "Linux":
*/
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Darwin, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 231, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_5) {

          /* "ws_package/utils/hardware_event_validator.py":232
 *                 self._initialize_windows()
 *             elif self._platform == "Darwin":
 *                 self._initialize_macos()             # <<<<<<<<<<<<<<
 *             elif self._platform == "Linux":
 *                 self._initialize_linux()
*/
          __pyx_t_6 = __pyx_v_self;
          __Pyx_INCREF(__pyx_t_6);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
            __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_initialize_macos, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "ws_package/utils/hardware_event_validator.py":231
 *             if self._platform == "Windows":
 *                 self._initialize_windows()
 *             elif self._platform == "Darwin":             # <<<<<<<<<<<<<<
 *                 self._initialize_macos()
 *             elif self._platform == "Linux":
*/
          goto __pyx_L12;
        }

        /* "ws_package/utils/hardware_event_validator.py":233
 *             elif self._platform == "Darwin":
 *                 self._initialize_macos()
 *             elif self._platform == "Linux":             # <<<<<<<<<<<<<<
 *                 self._initialize_linux()
 *             else:
*/
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Linux, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 233, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_5) {

          /* "ws_package/utils/hardware_event_validator.py":234
 *                 self._initialize_macos()
 *             elif self._platform == "Linux":
 *                 self._initialize_linux()             # <<<<<<<<<<<<<<
 *             else:
 *                 logger.warning("Hardware event validation not supported on %s", self._platform)
*/
          __pyx_t_6 = __pyx_v_self;
          __Pyx_INCREF(__pyx_t_6);
          __pyx_t_7 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
            __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_initialize_linux, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "ws_package/utils/hardware_event_validator.py":233
 *             elif self._platform == "Darwin":
 *                 self._initialize_macos()
 *             elif self._platform == "Linux":             # <<<<<<<<<<<<<<
 *                 self._initialize_linux()
 *             else:
*/
          goto __pyx_L12;
        }

        /* "ws_package/utils/hardware_event_validator.py":236
 *                 self._initialize_linux()
 *             else:
 *                 logger.warning("Hardware event validation not supported on %s", self._platform)             # <<<<<<<<<<<<<<
 *                 self._enabled = False
 *         except Exception as e:
*/
        /*else*/ {
          __pyx_t_6 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 236, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_7 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
            assert(__pyx_t_6);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
            __pyx_t_7 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_Hardware_event_validation_not_su, __pyx_t_8};
            __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "ws_package/utils/hardware_event_validator.py":237
 *             else:
 *                 logger.warning("Hardware event validation not supported on %s", self._platform)
 *                 self._enabled = False             # <<<<<<<<<<<<<<
 *         except Exception as e:
 *             logger.warning("Failed to initialize hardware event validation: %s", e)
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_enabled, Py_False) < (0)) __PYX_ERR(0, 237, __pyx_L6_error)
        }
        __pyx_L12:;

        /* "ws_package/utils/hardware_event_validator.py":228
 *     def _initialize(self):
 *         """Initialize platform-specific hardware detection"""
 *         try:             # <<<<<<<<<<<<<<
 *             if self._platform == "Windows":
 *                 self._initialize_windows()
*/
      }
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L11_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "ws_package/utils/hardware_event_validator.py":238
 *                 logger.warning("Hardware event validation not supported on %s", self._platform)
 *                 self._enabled = False
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.warning("Failed to initialize hardware event validation: %s", e)
 *             logger.warning("Falling back to accepting all events (backward compatible)")
*/
      __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_10) {
        __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_8) < 0) __PYX_ERR(0, 238, __pyx_L8_except_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_v_e = __pyx_t_9;
        /*try:*/ {

          /* "ws_package/utils/hardware_event_validator.py":239
 *                 self._enabled = False
 *         except Exception as e:
 *             logger.warning("Failed to initialize hardware event validation: %s", e)             # <<<<<<<<<<<<<<
 *             logger.warning("Falling back to accepting all events (backward compatible)")
 *             self._enabled = False
*/
          __pyx_t_11 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 239, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 239, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_7 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_13))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_13);
            assert(__pyx_t_11);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
            __pyx_t_7 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_Failed_to_initialize_hardware_ev, __pyx_v_e};
            __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "ws_package/utils/hardware_event_validator.py":240
 *         except Exception as e:
 *             logger.warning("Failed to initialize hardware event validation: %s", e)
 *             logger.warning("Falling back to accepting all events (backward compatible)")             # <<<<<<<<<<<<<<
 *             self._enabled = False
 *         finally:
*/
          __pyx_t_13 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 240, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 240, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_7 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
            assert(__pyx_t_13);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
            __pyx_t_7 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_mstate_global->__pyx_kp_u_Falling_back_to_accepting_all_ev};
            __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "ws_package/utils/hardware_event_validator.py":241
 *             logger.warning("Failed to initialize hardware event validation: %s", e)
 *             logger.warning("Falling back to accepting all events (backward compatible)")
 *             self._enabled = False             # <<<<<<<<<<<<<<
 *         finally:
 *             self._initialized = True
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_enabled, Py_False) < (0)) __PYX_ERR(0, 241, __pyx_L18_error)
        }

        /* "ws_package/utils/hardware_event_validator.py":238
 *                 logger.warning("Hardware event validation not supported on %s", self._platform)
 *                 self._enabled = False
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.warning("Failed to initialize hardware event validation: %s", e)
 *             logger.warning("Falling back to accepting all events (backward compatible)")
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            goto __pyx_L19;
          }
          __pyx_L18_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
            if ( unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __pyx_t_10 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
            __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
            __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
            goto __pyx_L8_except_error;
          }
          __pyx_L19:;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L7_exception_handled;
      }
      goto __pyx_L8_except_error;

      /* "ws_package/utils/hardware_event_validator.py":228
 *     def _initialize(self):
 *         """Initialize platform-specific hardware detection"""
 *         try:             # <<<<<<<<<<<<<<
 *             if self._platform == "Windows":
 *                 self._initialize_windows()
*/
      __pyx_L8_except_error:;
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
      goto __pyx_L4_error;
      __pyx_L7_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
      __pyx_L11_try_end:;
    }
  }

  /* "ws_package/utils/hardware_event_validator.py":243
 *             self._enabled = False
 *         finally:
 *             self._initialized = True             # <<<<<<<<<<<<<<
 * 
 *     def _initialize_windows(self):
*/
  /*finally:*/ {
    /*normal exit:*/{
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_initialized, Py_True) < (0)) __PYX_ERR(0, 243, __pyx_L1_error)
      goto __pyx_L5;
    }
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
      if ( unlikely(__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0)) __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_21);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_19);
      __pyx_t_14 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_22 = __pyx_filename;
      {
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_initialized, Py_True) < (0)) __PYX_ERR(0, 243, __pyx_L25_error)
      }
      __Pyx_XGIVEREF(__pyx_t_21);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_1);
      __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
      __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_22;
      goto __pyx_L1_error;
      __pyx_L25_error:;
      __Pyx_XGIVEREF(__pyx_t_21);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "ws_package/utils/hardware_event_validator.py":226
 *         )
 * 
 *     def _initialize(self):             # <<<<<<<<<<<<<<
 *         """Initialize platform-specific hardware detection"""
 *         try:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":245
 *             self._initialized = True
 * 
 *     def _initialize_windows(self):             # <<<<<<<<<<<<<<
 *         """Initialize Windows hardware event detection using low-level hooks.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_15_initialize_windows(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_14_initialize_windows, "Initialize Windows hardware event detection using low-level hooks.\n\n        Two bugs fixed vs. the original implementation:\n\n        Bug 1 \342\200\224 shared ctypes namespace poisons pynput (causes \"listeners start\n        but no events received\" on Python 3.13):\n          ctypes.windll.user32 is a SHARED module-level object. Setting\n          SetWindowsHookExW.argtypes on it with OUR HOOKPROC type causes\n          Python 3.13's stricter type-check to reject pynput's own HOOKPROC\n          (a different WINFUNCTYPE instance), silently killing pynput's hook.\n          Fix: use ctypes.WinDLL('user32') \342\200\224 a private, independent namespace.\n\n        Bug 2 \342\200\224 hooks installed on wrong thread (callbacks never fire):\n          WH_KEYBOARD_LL/WH_MOUSE_LL deliver notifications to the message queue\n          of the thread that called SetWindowsHookEx.  Installing on the init\n          thread but pumping on a daemon thread means callbacks never execute.\n          Fix: install hooks FROM INSIDE the hook+pump thread via an Event.\n        ");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_15_initialize_windows = {"_initialize_windows", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_15_initialize_windows, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_14_initialize_windows};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_15_initialize_windows(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_initialize_windows (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 245, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 245, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_initialize_windows", 0) < (0)) __PYX_ERR(0, 245, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_initialize_windows", 1, 1, 1, i); __PYX_ERR(0, 245, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 245, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_initialize_windows", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 245, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._initialize_windows", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_14_initialize_windows(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_14_initialize_windows(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v__hook_ready = NULL;
  PyObject *__pyx_v__hook_ok = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_initialize_windows", 0);

  /* "ws_package/utils/hardware_event_validator.py":265
 *         """
 *         # Thread-safe storage for latest event flags (read by is_hardware_*_event)
 *         self._windows_last_keyboard_event = {'injected': None, 'timestamp': 0}             # <<<<<<<<<<<<<<
 *         self._windows_last_mouse_event = {'injected': None, 'timestamp': 0}
 *         self._windows_last_hw_keyboard_ts = 0.0
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_injected, Py_None) < (0)) __PYX_ERR(0, 265, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_timestamp, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 265, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_keyboard_event, __pyx_t_1) < (0)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":266
 *         # Thread-safe storage for latest event flags (read by is_hardware_*_event)
 *         self._windows_last_keyboard_event = {'injected': None, 'timestamp': 0}
 *         self._windows_last_mouse_event = {'injected': None, 'timestamp': 0}             # <<<<<<<<<<<<<<
 *         self._windows_last_hw_keyboard_ts = 0.0
 *         self._windows_last_hw_mouse_ts = 0.0
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_injected, Py_None) < (0)) __PYX_ERR(0, 266, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_timestamp, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 266, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_mouse_event, __pyx_t_1) < (0)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":267
 *         self._windows_last_keyboard_event = {'injected': None, 'timestamp': 0}
 *         self._windows_last_mouse_event = {'injected': None, 'timestamp': 0}
 *         self._windows_last_hw_keyboard_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._windows_last_hw_mouse_ts = 0.0
 *         self._windows_last_syn_keyboard_ts = 0.0
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_hw_keyboard_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 267, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":268
 *         self._windows_last_mouse_event = {'injected': None, 'timestamp': 0}
 *         self._windows_last_hw_keyboard_ts = 0.0
 *         self._windows_last_hw_mouse_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._windows_last_syn_keyboard_ts = 0.0
 *         self._windows_last_syn_mouse_ts = 0.0
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_hw_mouse_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 268, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":269
 *         self._windows_last_hw_keyboard_ts = 0.0
 *         self._windows_last_hw_mouse_ts = 0.0
 *         self._windows_last_syn_keyboard_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._windows_last_syn_mouse_ts = 0.0
 *         self._windows_last_hw_scroll_ts = 0.0
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_syn_keyboard_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 269, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":270
 *         self._windows_last_hw_mouse_ts = 0.0
 *         self._windows_last_syn_keyboard_ts = 0.0
 *         self._windows_last_syn_mouse_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._windows_last_hw_scroll_ts = 0.0
 *         self._windows_last_raw_mouse_ts = 0.0
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_syn_mouse_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 270, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":271
 *         self._windows_last_syn_keyboard_ts = 0.0
 *         self._windows_last_syn_mouse_ts = 0.0
 *         self._windows_last_hw_scroll_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._windows_last_raw_mouse_ts = 0.0
 *         self._windows_raw_input_active = False
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_hw_scroll_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 271, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":272
 *         self._windows_last_syn_mouse_ts = 0.0
 *         self._windows_last_hw_scroll_ts = 0.0
 *         self._windows_last_raw_mouse_ts = 0.0             # <<<<<<<<<<<<<<
 *         self._windows_raw_input_active = False
 *         self._windows_use_mouse_ll_hook = False
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_raw_mouse_ts, __pyx_mstate_global->__pyx_float_0_0) < (0)) __PYX_ERR(0, 272, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":273
 *         self._windows_last_hw_scroll_ts = 0.0
 *         self._windows_last_raw_mouse_ts = 0.0
 *         self._windows_raw_input_active = False             # <<<<<<<<<<<<<<
 *         self._windows_use_mouse_ll_hook = False
 *         self._windows_keyboard_events.clear()
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_raw_input_active, Py_False) < (0)) __PYX_ERR(0, 273, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":274
 *         self._windows_last_raw_mouse_ts = 0.0
 *         self._windows_raw_input_active = False
 *         self._windows_use_mouse_ll_hook = False             # <<<<<<<<<<<<<<
 *         self._windows_keyboard_events.clear()
 *         self._windows_keys_down.clear()
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_use_mouse_ll_hook, Py_False) < (0)) __PYX_ERR(0, 274, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":275
 *         self._windows_raw_input_active = False
 *         self._windows_use_mouse_ll_hook = False
 *         self._windows_keyboard_events.clear()             # <<<<<<<<<<<<<<
 *         self._windows_keys_down.clear()
 *         self._windows_lock = threading.Lock()
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_keyboard_events); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":276
 *         self._windows_use_mouse_ll_hook = False
 *         self._windows_keyboard_events.clear()
 *         self._windows_keys_down.clear()             # <<<<<<<<<<<<<<
 *         self._windows_lock = threading.Lock()
 * 
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_keys_down); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":277
 *         self._windows_keyboard_events.clear()
 *         self._windows_keys_down.clear()
 *         self._windows_lock = threading.Lock()             # <<<<<<<<<<<<<<
 * 
 *         # Signal from hook thread back to init: did hook installation succeed?
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Lock); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_lock, __pyx_t_1) < (0)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":280
 * 
 *         # Signal from hook thread back to init: did hook installation succeed?
 *         _hook_ready = threading.Event()             # <<<<<<<<<<<<<<
 *         _hook_ok = [False]  # list so the closure can write to it
 * 
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Event); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v__hook_ready = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":281
 *         # Signal from hook thread back to init: did hook installation succeed?
 *         _hook_ready = threading.Event()
 *         _hook_ok = [False]  # list so the closure can write to it             # <<<<<<<<<<<<<<
 * 
 *         self._hook_thread = threading.Thread(
*/
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, Py_False) != (0)) __PYX_ERR(0, 281, __pyx_L1_error);
  __pyx_v__hook_ok = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":283
 *         _hook_ok = [False]  # list so the closure can write to it
 * 
 *         self._hook_thread = threading.Thread(             # <<<<<<<<<<<<<<
 *             target=self._windows_hook_thread,
 *             args=(_hook_ready, _hook_ok),
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_threading); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Thread); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":284
 * 
 *         self._hook_thread = threading.Thread(
 *             target=self._windows_hook_thread,             # <<<<<<<<<<<<<<
 *             args=(_hook_ready, _hook_ok),
 *             daemon=True,
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_hook_thread); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "ws_package/utils/hardware_event_validator.py":285
 *         self._hook_thread = threading.Thread(
 *             target=self._windows_hook_thread,
 *             args=(_hook_ready, _hook_ok),             # <<<<<<<<<<<<<<
 *             daemon=True,
 *             name="HardwareEventValidator",
*/
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v__hook_ready);
  __Pyx_GIVEREF(__pyx_v__hook_ready);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v__hook_ready) != (0)) __PYX_ERR(0, 285, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v__hook_ok);
  __Pyx_GIVEREF(__pyx_v__hook_ok);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v__hook_ok) != (0)) __PYX_ERR(0, 285, __pyx_L1_error);

  /* "ws_package/utils/hardware_event_validator.py":286
 *             target=self._windows_hook_thread,
 *             args=(_hook_ready, _hook_ok),
 *             daemon=True,             # <<<<<<<<<<<<<<
 *             name="HardwareEventValidator",
 *         )
*/
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_3, NULL};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_target, __pyx_t_5, __pyx_t_7, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 283, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_args, __pyx_t_6, __pyx_t_7, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 283, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_daemon, Py_True, __pyx_t_7, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 283, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator, __pyx_t_7, __pyx_callargs+1, 3) < (0)) __PYX_ERR(0, 283, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }

  /* "ws_package/utils/hardware_event_validator.py":283
 *         _hook_ok = [False]  # list so the closure can write to it
 * 
 *         self._hook_thread = threading.Thread(             # <<<<<<<<<<<<<<
 *             target=self._windows_hook_thread,
 *             args=(_hook_ready, _hook_ok),
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_hook_thread, __pyx_t_1) < (0)) __PYX_ERR(0, 283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":289
 *             name="HardwareEventValidator",
 *         )
 *         self._hook_thread.start()             # <<<<<<<<<<<<<<
 * 
 *         # Wait up to 3 s for hook installation to complete.
*/
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_hook_thread); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __pyx_t_7;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_start, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":292
 * 
 *         # Wait up to 3 s for hook installation to complete.
 *         if not _hook_ready.wait(timeout=3.0) or not _hook_ok[0]:             # <<<<<<<<<<<<<<
 *             logger.warning("Failed to install Windows hooks - accepting all events")
 *             self._enabled = False
*/
  __pyx_t_7 = __pyx_v__hook_ready;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, NULL};
    __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_timeout, __pyx_mstate_global->__pyx_float_3_0, __pyx_t_2, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 292, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_wait, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 292, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = (!__pyx_t_9);
  if (!__pyx_t_10) {
  } else {
    __pyx_t_8 = __pyx_t_10;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__Pyx_PyList_GET_ITEM(__pyx_v__hook_ok, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 292, __pyx_L1_error)
  __pyx_t_9 = (!__pyx_t_10);
  __pyx_t_8 = __pyx_t_9;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_8) {

    /* "ws_package/utils/hardware_event_validator.py":293
 *         # Wait up to 3 s for hook installation to complete.
 *         if not _hook_ready.wait(timeout=3.0) or not _hook_ok[0]:
 *             logger.warning("Failed to install Windows hooks - accepting all events")             # <<<<<<<<<<<<<<
 *             self._enabled = False
 *             return
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Failed_to_install_Windows_hooks};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ws_package/utils/hardware_event_validator.py":294
 *         if not _hook_ready.wait(timeout=3.0) or not _hook_ok[0]:
 *             logger.warning("Failed to install Windows hooks - accepting all events")
 *             self._enabled = False             # <<<<<<<<<<<<<<
 *             return
 * 
*/
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_enabled, Py_False) < (0)) __PYX_ERR(0, 294, __pyx_L1_error)

    /* "ws_package/utils/hardware_event_validator.py":295
 *             logger.warning("Failed to install Windows hooks - accepting all events")
 *             self._enabled = False
 *             return             # <<<<<<<<<<<<<<
 * 
 *         self._enabled = True
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":292
 * 
 *         # Wait up to 3 s for hook installation to complete.
 *         if not _hook_ready.wait(timeout=3.0) or not _hook_ok[0]:             # <<<<<<<<<<<<<<
 *             logger.warning("Failed to install Windows hooks - accepting all events")
 *             self._enabled = False
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":297
 *             return
 * 
 *         self._enabled = True             # <<<<<<<<<<<<<<
 *         logger.info(
 *             "Windows hardware event validation initialized "
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_enabled, Py_True) < (0)) __PYX_ERR(0, 297, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":298
 * 
 *         self._enabled = True
 *         logger.info(             # <<<<<<<<<<<<<<
 *             "Windows hardware event validation initialized "
 *             "(keyboard LL hook + optional Raw Input mouse)"
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_info); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_Windows_hardware_event_validatio};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":245
 *             self._initialized = True
 * 
 *     def _initialize_windows(self):             # <<<<<<<<<<<<<<
 *         """Initialize Windows hardware event detection using low-level hooks.
 * 
*/

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._initialize_windows", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__hook_ready);
  __Pyx_XDECREF(__pyx_v__hook_ok);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":303
 *         )
 * 
 *     def _windows_hook_thread(self, ready_event: threading.Event, ok_flag: list):             # <<<<<<<<<<<<<<
 *         """
 *         Dedicated thread that INSTALLS and PUMPS low-level Windows hooks.
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_17_windows_hook_thread(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_16_windows_hook_thread, "\n        Dedicated thread that INSTALLS and PUMPS low-level Windows hooks.\n\n        WH_KEYBOARD_LL / WH_MOUSE_LL are delivered to the thread that called\n        SetWindowsHookEx.  Both installation and the message pump must live on\n        this same thread or callbacks will never fire.\n\n        Uses a PRIVATE ctypes.WinDLL namespace (not ctypes.windll.user32) so\n        that our argtypes declarations do not pollute the shared namespace that\n        pynput also uses.\n        ");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_17_windows_hook_thread = {"_windows_hook_thread", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_17_windows_hook_thread, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_16_windows_hook_thread};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_17_windows_hook_thread(PyObject *__pyx_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_self = 0;
  PyObject *__pyx_v_ready_event = 0;
  PyObject *__pyx_v_ok_flag = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_windows_hook_thread (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_ready_event,&__pyx_mstate_global->__pyx_n_u_ok_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 303, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 303, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 303, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 303, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_windows_hook_thread", 0) < (0)) __PYX_ERR(0, 303, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_windows_hook_thread", 1, 3, 3, i); __PYX_ERR(0, 303, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 303, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 303, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 303, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_ready_event = values[1];
    __pyx_v_ok_flag = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_windows_hook_thread", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 303, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._windows_hook_thread", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ok_flag), (&PyList_Type), 0, "ok_flag", 2))) __PYX_ERR(0, 303, __pyx_L1_error)
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_16_windows_hook_thread(__pyx_self, __pyx_v_self, __pyx_v_ready_event, __pyx_v_ok_flag);

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

/* "ws_package/utils/hardware_event_validator.py":376
 *                 ]
 * 
 *             def low_level_keyboard_proc(nCode, wParam, lParam):             # <<<<<<<<<<<<<<
 *                 try:
 *                     if nCode >= HC_ACTION:
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_1low_level_keyboard_proc(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_1low_level_keyboard_proc = {"low_level_keyboard_proc", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_1low_level_keyboard_proc, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_1low_level_keyboard_proc(PyObject *__pyx_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_nCode = 0;
  PyObject *__pyx_v_wParam = 0;
  PyObject *__pyx_v_lParam = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("low_level_keyboard_proc (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nCode,&__pyx_mstate_global->__pyx_n_u_wParam,&__pyx_mstate_global->__pyx_n_u_lParam,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 376, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 376, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 376, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 376, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "low_level_keyboard_proc", 0) < (0)) __PYX_ERR(0, 376, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("low_level_keyboard_proc", 1, 3, 3, i); __PYX_ERR(0, 376, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 376, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 376, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 376, __pyx_L3_error)
    }
    __pyx_v_nCode = values[0];
    __pyx_v_wParam = values[1];
    __pyx_v_lParam = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("low_level_keyboard_proc", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 376, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._windows_hook_thread.low_level_keyboard_proc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_low_level_keyboard_proc(__pyx_self, __pyx_v_nCode, __pyx_v_wParam, __pyx_v_lParam);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_low_level_keyboard_proc(PyObject *__pyx_self, PyObject *__pyx_v_nCode, PyObject *__pyx_v_wParam, PyObject *__pyx_v_lParam) {
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *__pyx_cur_scope;
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *__pyx_outer_scope;
  PyObject *__pyx_v_kb = NULL;
  int __pyx_v_injected;
  PyObject *__pyx_v_message = NULL;
  int __pyx_v_is_down;
  int __pyx_v_is_up;
  PyObject *__pyx_v_now = NULL;
  PyObject *__pyx_v_vk_code = NULL;
  PyObject *__pyx_v_is_repeat = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("low_level_keyboard_proc", 0);
  __pyx_outer_scope = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "ws_package/utils/hardware_event_validator.py":377
 * 
 *             def low_level_keyboard_proc(nCode, wParam, lParam):
 *                 try:             # <<<<<<<<<<<<<<
 *                     if nCode >= HC_ACTION:
 *                         kb = ctypes.cast(lParam, ctypes.POINTER(KBDLLHOOKSTRUCT)).contents
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":378
 *             def low_level_keyboard_proc(nCode, wParam, lParam):
 *                 try:
 *                     if nCode >= HC_ACTION:             # <<<<<<<<<<<<<<
 *                         kb = ctypes.cast(lParam, ctypes.POINTER(KBDLLHOOKSTRUCT)).contents
 *                         injected = bool(kb.flags & LLKHF_INJECTED)
*/
      __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_cur_scope->__pyx_v_HC_ACTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_nCode, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 378, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 378, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {

        /* "ws_package/utils/hardware_event_validator.py":379
 *                 try:
 *                     if nCode >= HC_ACTION:
 *                         kb = ctypes.cast(lParam, ctypes.POINTER(KBDLLHOOKSTRUCT)).contents             # <<<<<<<<<<<<<<
 *                         injected = bool(kb.flags & LLKHF_INJECTED)
 *                         message = int(wParam)
*/
        __pyx_t_4 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 379, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_cast); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 379, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_9 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 379, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_POINTER); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 379, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_cur_scope->__pyx_v_KBDLLHOOKSTRUCT)) { __Pyx_RaiseClosureNameError("KBDLLHOOKSTRUCT"); __PYX_ERR(0, 379, __pyx_L3_error) }
        __pyx_t_12 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
          assert(__pyx_t_9);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
          __pyx_t_12 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_KBDLLHOOKSTRUCT};
          __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 379, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        __pyx_t_12 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
          assert(__pyx_t_4);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
          __pyx_t_12 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_lParam, __pyx_t_7};
          __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 379, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
        }
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_contents); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 379, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_v_kb = __pyx_t_8;
        __pyx_t_8 = 0;

        /* "ws_package/utils/hardware_event_validator.py":380
 *                     if nCode >= HC_ACTION:
 *                         kb = ctypes.cast(lParam, ctypes.POINTER(KBDLLHOOKSTRUCT)).contents
 *                         injected = bool(kb.flags & LLKHF_INJECTED)             # <<<<<<<<<<<<<<
 *                         message = int(wParam)
 *                         is_down = message in (WM_KEYDOWN, WM_SYSKEYDOWN)
*/
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_kb, __pyx_mstate_global->__pyx_n_u_flags); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 380, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_cur_scope->__pyx_v_LLKHF_INJECTED); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = PyNumber_And(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 380, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 380, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_injected = (!(!__pyx_t_6));

        /* "ws_package/utils/hardware_event_validator.py":381
 *                         kb = ctypes.cast(lParam, ctypes.POINTER(KBDLLHOOKSTRUCT)).contents
 *                         injected = bool(kb.flags & LLKHF_INJECTED)
 *                         message = int(wParam)             # <<<<<<<<<<<<<<
 *                         is_down = message in (WM_KEYDOWN, WM_SYSKEYDOWN)
 *                         is_up = message in (WM_KEYUP, WM_SYSKEYUP)
*/
        __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_v_wParam); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 381, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_v_message = ((PyObject*)__pyx_t_7);
        __pyx_t_7 = 0;

        /* "ws_package/utils/hardware_event_validator.py":382
 *                         injected = bool(kb.flags & LLKHF_INJECTED)
 *                         message = int(wParam)
 *                         is_down = message in (WM_KEYDOWN, WM_SYSKEYDOWN)             # <<<<<<<<<<<<<<
 *                         is_up = message in (WM_KEYUP, WM_SYSKEYUP)
 *                         now = time.time()
*/
        __Pyx_INCREF(__pyx_v_message);
        __pyx_t_13 = __pyx_v_message;
        __pyx_t_7 = __Pyx_PyLong_From_long(__pyx_cur_scope->__pyx_v_WM_KEYDOWN); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 382, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_13, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 382, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (!__pyx_t_14) {
        } else {
          __pyx_t_6 = __pyx_t_14;
          goto __pyx_L10_bool_binop_done;
        }
        __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_cur_scope->__pyx_v_WM_SYSKEYDOWN); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = PyObject_RichCompare(__pyx_t_13, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 382, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 382, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_6 = __pyx_t_14;
        __pyx_L10_bool_binop_done:;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_v_is_down = __pyx_t_6;

        /* "ws_package/utils/hardware_event_validator.py":383
 *                         message = int(wParam)
 *                         is_down = message in (WM_KEYDOWN, WM_SYSKEYDOWN)
 *                         is_up = message in (WM_KEYUP, WM_SYSKEYUP)             # <<<<<<<<<<<<<<
 *                         now = time.time()
 *                         with self._windows_lock:
*/
        __Pyx_INCREF(__pyx_v_message);
        __pyx_t_13 = __pyx_v_message;
        __pyx_t_7 = __Pyx_PyLong_From_long(__pyx_cur_scope->__pyx_v_WM_KEYUP); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 383, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_13, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 383, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 383, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (!__pyx_t_14) {
        } else {
          __pyx_t_6 = __pyx_t_14;
          goto __pyx_L12_bool_binop_done;
        }
        __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_cur_scope->__pyx_v_WM_SYSKEYUP); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 383, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = PyObject_RichCompare(__pyx_t_13, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 383, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 383, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_6 = __pyx_t_14;
        __pyx_L12_bool_binop_done:;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_v_is_up = __pyx_t_6;

        /* "ws_package/utils/hardware_event_validator.py":384
 *                         is_down = message in (WM_KEYDOWN, WM_SYSKEYDOWN)
 *                         is_up = message in (WM_KEYUP, WM_SYSKEYUP)
 *                         now = time.time()             # <<<<<<<<<<<<<<
 *                         with self._windows_lock:
 *                             vk_code = int(kb.vkCode)
*/
        __pyx_t_5 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 384, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_12 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_5);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_12 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
          __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_12, (1-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 384, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        __pyx_v_now = __pyx_t_7;
        __pyx_t_7 = 0;

        /* "ws_package/utils/hardware_event_validator.py":385
 *                         is_up = message in (WM_KEYUP, WM_SYSKEYUP)
 *                         now = time.time()
 *                         with self._windows_lock:             # <<<<<<<<<<<<<<
 *                             vk_code = int(kb.vkCode)
 *                             is_repeat = is_down and vk_code in self._windows_keys_down
*/
        /*with:*/ {
          if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 385, __pyx_L3_error) }
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_lock); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 385, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_15 = __Pyx_PyObject_LookupSpecial(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 385, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_5 = NULL;
          __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 385, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_12 = 1;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_8))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
            assert(__pyx_t_5);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
            __pyx_t_12 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
            __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_12, (1-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L14_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          /*try:*/ {
            {
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __Pyx_ExceptionSave(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
              __Pyx_XGOTREF(__pyx_t_16);
              __Pyx_XGOTREF(__pyx_t_17);
              __Pyx_XGOTREF(__pyx_t_18);
              /*try:*/ {

                /* "ws_package/utils/hardware_event_validator.py":386
 *                         now = time.time()
 *                         with self._windows_lock:
 *                             vk_code = int(kb.vkCode)             # <<<<<<<<<<<<<<
 *                             is_repeat = is_down and vk_code in self._windows_keys_down
 *                             if is_down:
*/
                __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_kb, __pyx_mstate_global->__pyx_n_u_vkCode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 386, __pyx_L18_error)
                __Pyx_GOTREF(__pyx_t_7);
                __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L18_error)
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                __pyx_v_vk_code = ((PyObject*)__pyx_t_4);
                __pyx_t_4 = 0;

                /* "ws_package/utils/hardware_event_validator.py":387
 *                         with self._windows_lock:
 *                             vk_code = int(kb.vkCode)
 *                             is_repeat = is_down and vk_code in self._windows_keys_down             # <<<<<<<<<<<<<<
 *                             if is_down:
 *                                 self._windows_keys_down.add(vk_code)
*/
                if (__pyx_v_is_down) {
                } else {
                  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_is_down); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __pyx_L18_error)
                  __Pyx_GOTREF(__pyx_t_7);
                  __pyx_t_4 = __pyx_t_7;
                  __pyx_t_7 = 0;
                  goto __pyx_L24_bool_binop_done;
                }
                if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 387, __pyx_L18_error) }
                __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_keys_down); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __pyx_L18_error)
                __Pyx_GOTREF(__pyx_t_7);
                __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_vk_code, __pyx_t_7, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 387, __pyx_L18_error)
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __pyx_L18_error)
                __Pyx_GOTREF(__pyx_t_7);
                __pyx_t_4 = __pyx_t_7;
                __pyx_t_7 = 0;
                __pyx_L24_bool_binop_done:;
                __pyx_v_is_repeat = __pyx_t_4;
                __pyx_t_4 = 0;

                /* "ws_package/utils/hardware_event_validator.py":388
 *                             vk_code = int(kb.vkCode)
 *                             is_repeat = is_down and vk_code in self._windows_keys_down
 *                             if is_down:             # <<<<<<<<<<<<<<
 *                                 self._windows_keys_down.add(vk_code)
 *                             elif is_up:
*/
                if (__pyx_v_is_down) {

                  /* "ws_package/utils/hardware_event_validator.py":389
 *                             is_repeat = is_down and vk_code in self._windows_keys_down
 *                             if is_down:
 *                                 self._windows_keys_down.add(vk_code)             # <<<<<<<<<<<<<<
 *                             elif is_up:
 *                                 self._windows_keys_down.discard(vk_code)
*/
                  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 389, __pyx_L18_error) }
                  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_keys_down); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 389, __pyx_L18_error)
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_7 = __pyx_t_8;
                  __Pyx_INCREF(__pyx_t_7);
                  __pyx_t_12 = 0;
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_vk_code};
                    __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_add, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 389, __pyx_L18_error)
                    __Pyx_GOTREF(__pyx_t_4);
                  }
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

                  /* "ws_package/utils/hardware_event_validator.py":388
 *                             vk_code = int(kb.vkCode)
 *                             is_repeat = is_down and vk_code in self._windows_keys_down
 *                             if is_down:             # <<<<<<<<<<<<<<
 *                                 self._windows_keys_down.add(vk_code)
 *                             elif is_up:
*/
                  goto __pyx_L26;
                }

                /* "ws_package/utils/hardware_event_validator.py":390
 *                             if is_down:
 *                                 self._windows_keys_down.add(vk_code)
 *                             elif is_up:             # <<<<<<<<<<<<<<
 *                                 self._windows_keys_down.discard(vk_code)
 *                             self._windows_last_keyboard_event = {
*/
                if (__pyx_v_is_up) {

                  /* "ws_package/utils/hardware_event_validator.py":391
 *                                 self._windows_keys_down.add(vk_code)
 *                             elif is_up:
 *                                 self._windows_keys_down.discard(vk_code)             # <<<<<<<<<<<<<<
 *                             self._windows_last_keyboard_event = {
 *                                 'injected': injected,
*/
                  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 391, __pyx_L18_error) }
                  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_keys_down); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 391, __pyx_L18_error)
                  __Pyx_GOTREF(__pyx_t_7);
                  __pyx_t_8 = __pyx_t_7;
                  __Pyx_INCREF(__pyx_t_8);
                  __pyx_t_12 = 0;
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_vk_code};
                    __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_discard, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
                    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L18_error)
                    __Pyx_GOTREF(__pyx_t_4);
                  }
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

                  /* "ws_package/utils/hardware_event_validator.py":390
 *                             if is_down:
 *                                 self._windows_keys_down.add(vk_code)
 *                             elif is_up:             # <<<<<<<<<<<<<<
 *                                 self._windows_keys_down.discard(vk_code)
 *                             self._windows_last_keyboard_event = {
*/
                }
                __pyx_L26:;

                /* "ws_package/utils/hardware_event_validator.py":393
 *                                 self._windows_keys_down.discard(vk_code)
 *                             self._windows_last_keyboard_event = {
 *                                 'injected': injected,             # <<<<<<<<<<<<<<
 *                                 'timestamp': now,
 *                             }
*/
                __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L18_error)
                __Pyx_GOTREF(__pyx_t_4);
                __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_injected); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 393, __pyx_L18_error)
                __Pyx_GOTREF(__pyx_t_7);
                if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_injected, __pyx_t_7) < (0)) __PYX_ERR(0, 393, __pyx_L18_error)
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

                /* "ws_package/utils/hardware_event_validator.py":394
 *                             self._windows_last_keyboard_event = {
 *                                 'injected': injected,
 *                                 'timestamp': now,             # <<<<<<<<<<<<<<
 *                             }
 *                             if injected:
*/
                if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_timestamp, __pyx_v_now) < (0)) __PYX_ERR(0, 393, __pyx_L18_error)

                /* "ws_package/utils/hardware_event_validator.py":392
 *                             elif is_up:
 *                                 self._windows_keys_down.discard(vk_code)
 *                             self._windows_last_keyboard_event = {             # <<<<<<<<<<<<<<
 *                                 'injected': injected,
 *                                 'timestamp': now,
*/
                if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 392, __pyx_L18_error) }
                if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_keyboard_event, __pyx_t_4) < (0)) __PYX_ERR(0, 392, __pyx_L18_error)
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

                /* "ws_package/utils/hardware_event_validator.py":396
 *                                 'timestamp': now,
 *                             }
 *                             if injected:             # <<<<<<<<<<<<<<
 *                                 self._windows_last_syn_keyboard_ts = now
 *                             else:
*/
                if (__pyx_v_injected) {

                  /* "ws_package/utils/hardware_event_validator.py":397
 *                             }
 *                             if injected:
 *                                 self._windows_last_syn_keyboard_ts = now             # <<<<<<<<<<<<<<
 *                             else:
 *                                 self._windows_last_hw_keyboard_ts = now
*/
                  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 397, __pyx_L18_error) }
                  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_syn_keyboard_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 397, __pyx_L18_error)

                  /* "ws_package/utils/hardware_event_validator.py":396
 *                                 'timestamp': now,
 *                             }
 *                             if injected:             # <<<<<<<<<<<<<<
 *                                 self._windows_last_syn_keyboard_ts = now
 *                             else:
*/
                  goto __pyx_L27;
                }

                /* "ws_package/utils/hardware_event_validator.py":399
 *                                 self._windows_last_syn_keyboard_ts = now
 *                             else:
 *                                 self._windows_last_hw_keyboard_ts = now             # <<<<<<<<<<<<<<
 *                             if is_down or is_up:
 *                                 self._windows_keyboard_events.append({
*/
                /*else*/ {
                  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 399, __pyx_L18_error) }
                  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_hw_keyboard_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 399, __pyx_L18_error)
                }
                __pyx_L27:;

                /* "ws_package/utils/hardware_event_validator.py":400
 *                             else:
 *                                 self._windows_last_hw_keyboard_ts = now
 *                             if is_down or is_up:             # <<<<<<<<<<<<<<
 *                                 self._windows_keyboard_events.append({
 *                                     'vk_code': vk_code,
*/
                if (!__pyx_v_is_down) {
                } else {
                  __pyx_t_6 = __pyx_v_is_down;
                  goto __pyx_L29_bool_binop_done;
                }
                __pyx_t_6 = __pyx_v_is_up;
                __pyx_L29_bool_binop_done:;
                if (__pyx_t_6) {

                  /* "ws_package/utils/hardware_event_validator.py":401
 *                                 self._windows_last_hw_keyboard_ts = now
 *                             if is_down or is_up:
 *                                 self._windows_keyboard_events.append({             # <<<<<<<<<<<<<<
 *                                     'vk_code': vk_code,
 *                                     'scan_code': int(kb.scanCode),
*/
                  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 401, __pyx_L18_error) }
                  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_keyboard_events); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L18_error)
                  __Pyx_GOTREF(__pyx_t_4);

                  /* "ws_package/utils/hardware_event_validator.py":402
 *                             if is_down or is_up:
 *                                 self._windows_keyboard_events.append({
 *                                     'vk_code': vk_code,             # <<<<<<<<<<<<<<
 *                                     'scan_code': int(kb.scanCode),
 *                                     'is_down': is_down,
*/
                  __pyx_t_7 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 402, __pyx_L18_error)
                  __Pyx_GOTREF(__pyx_t_7);
                  if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_vk_code, __pyx_v_vk_code) < (0)) __PYX_ERR(0, 402, __pyx_L18_error)

                  /* "ws_package/utils/hardware_event_validator.py":403
 *                                 self._windows_keyboard_events.append({
 *                                     'vk_code': vk_code,
 *                                     'scan_code': int(kb.scanCode),             # <<<<<<<<<<<<<<
 *                                     'is_down': is_down,
 *                                     'is_up': is_up,
*/
                  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_kb, __pyx_mstate_global->__pyx_n_u_scanCode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 403, __pyx_L18_error)
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 403, __pyx_L18_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_scan_code, __pyx_t_5) < (0)) __PYX_ERR(0, 402, __pyx_L18_error)
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                  /* "ws_package/utils/hardware_event_validator.py":404
 *                                     'vk_code': vk_code,
 *                                     'scan_code': int(kb.scanCode),
 *                                     'is_down': is_down,             # <<<<<<<<<<<<<<
 *                                     'is_up': is_up,
 *                                     'is_repeat': is_repeat,
*/
                  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_is_down); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 404, __pyx_L18_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_is_down, __pyx_t_5) < (0)) __PYX_ERR(0, 402, __pyx_L18_error)
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                  /* "ws_package/utils/hardware_event_validator.py":405
 *                                     'scan_code': int(kb.scanCode),
 *                                     'is_down': is_down,
 *                                     'is_up': is_up,             # <<<<<<<<<<<<<<
 *                                     'is_repeat': is_repeat,
 *                                     'injected': injected,
*/
                  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_is_up); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L18_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_is_up, __pyx_t_5) < (0)) __PYX_ERR(0, 402, __pyx_L18_error)
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                  /* "ws_package/utils/hardware_event_validator.py":406
 *                                     'is_down': is_down,
 *                                     'is_up': is_up,
 *                                     'is_repeat': is_repeat,             # <<<<<<<<<<<<<<
 *                                     'injected': injected,
 *                                     'timestamp': now,
*/
                  if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_is_repeat, __pyx_v_is_repeat) < (0)) __PYX_ERR(0, 402, __pyx_L18_error)

                  /* "ws_package/utils/hardware_event_validator.py":407
 *                                     'is_up': is_up,
 *                                     'is_repeat': is_repeat,
 *                                     'injected': injected,             # <<<<<<<<<<<<<<
 *                                     'timestamp': now,
 *                                 })
*/
                  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_injected); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L18_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_injected, __pyx_t_5) < (0)) __PYX_ERR(0, 402, __pyx_L18_error)
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                  /* "ws_package/utils/hardware_event_validator.py":408
 *                                     'is_repeat': is_repeat,
 *                                     'injected': injected,
 *                                     'timestamp': now,             # <<<<<<<<<<<<<<
 *                                 })
 *                 except Exception:
*/
                  if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_timestamp, __pyx_v_now) < (0)) __PYX_ERR(0, 402, __pyx_L18_error)

                  /* "ws_package/utils/hardware_event_validator.py":401
 *                                 self._windows_last_hw_keyboard_ts = now
 *                             if is_down or is_up:
 *                                 self._windows_keyboard_events.append({             # <<<<<<<<<<<<<<
 *                                     'vk_code': vk_code,
 *                                     'scan_code': int(kb.scanCode),
*/
                  __pyx_t_19 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_7); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(0, 401, __pyx_L18_error)
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

                  /* "ws_package/utils/hardware_event_validator.py":400
 *                             else:
 *                                 self._windows_last_hw_keyboard_ts = now
 *                             if is_down or is_up:             # <<<<<<<<<<<<<<
 *                                 self._windows_keyboard_events.append({
 *                                     'vk_code': vk_code,
*/
                }

                /* "ws_package/utils/hardware_event_validator.py":385
 *                         is_up = message in (WM_KEYUP, WM_SYSKEYUP)
 *                         now = time.time()
 *                         with self._windows_lock:             # <<<<<<<<<<<<<<
 *                             vk_code = int(kb.vkCode)
 *                             is_repeat = is_down and vk_code in self._windows_keys_down
*/
              }
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
              __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
              goto __pyx_L23_try_end;
              __pyx_L18_error:;
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
              /*except:*/ {
                __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._windows_hook_thread.low_level_keyboard_proc", __pyx_clineno, __pyx_lineno, __pyx_filename);
                if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 385, __pyx_L20_except_error)
                __Pyx_XGOTREF(__pyx_t_7);
                __Pyx_XGOTREF(__pyx_t_4);
                __Pyx_XGOTREF(__pyx_t_5);
                __pyx_t_8 = PyTuple_Pack(3, __pyx_t_7, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 385, __pyx_L20_except_error)
                __Pyx_GOTREF(__pyx_t_8);
                __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_8, NULL);
                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 385, __pyx_L20_except_error)
                __Pyx_GOTREF(__pyx_t_20);
                __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_20);
                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
                if (__pyx_t_6 < (0)) __PYX_ERR(0, 385, __pyx_L20_except_error)
                __pyx_t_14 = (!__pyx_t_6);
                if (unlikely(__pyx_t_14)) {
                  __Pyx_GIVEREF(__pyx_t_7);
                  __Pyx_GIVEREF(__pyx_t_4);
                  __Pyx_XGIVEREF(__pyx_t_5);
                  __Pyx_ErrRestoreWithState(__pyx_t_7, __pyx_t_4, __pyx_t_5);
                  __pyx_t_7 = 0;  __pyx_t_4 = 0;  __pyx_t_5 = 0; 
                  __PYX_ERR(0, 385, __pyx_L20_except_error)
                }
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                goto __pyx_L19_exception_handled;
              }
              __pyx_L20_except_error:;
              __Pyx_XGIVEREF(__pyx_t_16);
              __Pyx_XGIVEREF(__pyx_t_17);
              __Pyx_XGIVEREF(__pyx_t_18);
              __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
              goto __pyx_L3_error;
              __pyx_L19_exception_handled:;
              __Pyx_XGIVEREF(__pyx_t_16);
              __Pyx_XGIVEREF(__pyx_t_17);
              __Pyx_XGIVEREF(__pyx_t_18);
              __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
              __pyx_L23_try_end:;
            }
          }
          /*finally:*/ {
            /*normal exit:*/{
              if (__pyx_t_15) {
                __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_mstate_global->__pyx_tuple[2], NULL);
                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 385, __pyx_L3_error)
                __Pyx_GOTREF(__pyx_t_18);
                __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
              }
              goto __pyx_L17;
            }
            __pyx_L17:;
          }
          goto __pyx_L34;
          __pyx_L14_error:;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          goto __pyx_L3_error;
          __pyx_L34:;
        }

        /* "ws_package/utils/hardware_event_validator.py":378
 *             def low_level_keyboard_proc(nCode, wParam, lParam):
 *                 try:
 *                     if nCode >= HC_ACTION:             # <<<<<<<<<<<<<<
 *                         kb = ctypes.cast(lParam, ctypes.POINTER(KBDLLHOOKSTRUCT)).contents
 *                         injected = bool(kb.flags & LLKHF_INJECTED)
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":377
 * 
 *             def low_level_keyboard_proc(nCode, wParam, lParam):
 *                 try:             # <<<<<<<<<<<<<<
 *                     if nCode >= HC_ACTION:
 *                         kb = ctypes.cast(lParam, ctypes.POINTER(KBDLLHOOKSTRUCT)).contents
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "ws_package/utils/hardware_event_validator.py":410
 *                                     'timestamp': now,
 *                                 })
 *                 except Exception:             # <<<<<<<<<<<<<<
 *                     pass
 *                 return user32.CallNextHookEx(None, nCode, wParam, lParam)
*/
    __pyx_t_21 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_21) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "ws_package/utils/hardware_event_validator.py":377
 * 
 *             def low_level_keyboard_proc(nCode, wParam, lParam):
 *                 try:             # <<<<<<<<<<<<<<
 *                     if nCode >= HC_ACTION:
 *                         kb = ctypes.cast(lParam, ctypes.POINTER(KBDLLHOOKSTRUCT)).contents
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ws_package/utils/hardware_event_validator.py":412
 *                 except Exception:
 *                     pass
 *                 return user32.CallNextHookEx(None, nCode, wParam, lParam)             # <<<<<<<<<<<<<<
 * 
 *             def low_level_mouse_proc(nCode, wParam, lParam):
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_user32)) { __Pyx_RaiseClosureNameError("user32"); __PYX_ERR(0, 412, __pyx_L1_error) }
  __pyx_t_4 = __pyx_cur_scope->__pyx_v_user32;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_12 = 0;
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_4, Py_None, __pyx_v_nCode, __pyx_v_wParam, __pyx_v_lParam};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_CallNextHookEx, __pyx_callargs+__pyx_t_12, (5-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":376
 *                 ]
 * 
 *             def low_level_keyboard_proc(nCode, wParam, lParam):             # <<<<<<<<<<<<<<
 *                 try:
 *                     if nCode >= HC_ACTION:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._windows_hook_thread.low_level_keyboard_proc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_kb);
  __Pyx_XDECREF(__pyx_v_message);
  __Pyx_XDECREF(__pyx_v_now);
  __Pyx_XDECREF(__pyx_v_vk_code);
  __Pyx_XDECREF(__pyx_v_is_repeat);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":414
 *                 return user32.CallNextHookEx(None, nCode, wParam, lParam)
 * 
 *             def low_level_mouse_proc(nCode, wParam, lParam):             # <<<<<<<<<<<<<<
 *                 try:
 *                     if nCode >= HC_ACTION:
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_3low_level_mouse_proc(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_3low_level_mouse_proc = {"low_level_mouse_proc", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_3low_level_mouse_proc, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_3low_level_mouse_proc(PyObject *__pyx_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_nCode = 0;
  PyObject *__pyx_v_wParam = 0;
  PyObject *__pyx_v_lParam = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("low_level_mouse_proc (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nCode,&__pyx_mstate_global->__pyx_n_u_wParam,&__pyx_mstate_global->__pyx_n_u_lParam,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 414, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 414, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 414, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 414, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "low_level_mouse_proc", 0) < (0)) __PYX_ERR(0, 414, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("low_level_mouse_proc", 1, 3, 3, i); __PYX_ERR(0, 414, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 414, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 414, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 414, __pyx_L3_error)
    }
    __pyx_v_nCode = values[0];
    __pyx_v_wParam = values[1];
    __pyx_v_lParam = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("low_level_mouse_proc", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 414, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._windows_hook_thread.low_level_mouse_proc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_2low_level_mouse_proc(__pyx_self, __pyx_v_nCode, __pyx_v_wParam, __pyx_v_lParam);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_2low_level_mouse_proc(PyObject *__pyx_self, PyObject *__pyx_v_nCode, PyObject *__pyx_v_wParam, PyObject *__pyx_v_lParam) {
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *__pyx_cur_scope;
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *__pyx_outer_scope;
  PyObject *__pyx_v_wparam = NULL;
  PyObject *__pyx_v_ms = NULL;
  int __pyx_v_injected;
  PyObject *__pyx_v_now = NULL;
  int __pyx_v_is_scroll;
  PyObject *__pyx_v_is_move = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("low_level_mouse_proc", 0);
  __pyx_outer_scope = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "ws_package/utils/hardware_event_validator.py":415
 * 
 *             def low_level_mouse_proc(nCode, wParam, lParam):
 *                 try:             # <<<<<<<<<<<<<<
 *                     if nCode >= HC_ACTION:
 *                         wparam = int(wParam)
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":416
 *             def low_level_mouse_proc(nCode, wParam, lParam):
 *                 try:
 *                     if nCode >= HC_ACTION:             # <<<<<<<<<<<<<<
 *                         wparam = int(wParam)
 *                         if wparam == WM_MOUSEMOVE:
*/
      __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_cur_scope->__pyx_v_HC_ACTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_nCode, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 416, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 416, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {

        /* "ws_package/utils/hardware_event_validator.py":417
 *                 try:
 *                     if nCode >= HC_ACTION:
 *                         wparam = int(wParam)             # <<<<<<<<<<<<<<
 *                         if wparam == WM_MOUSEMOVE:
 *                             ms = ctypes.cast(lParam, ctypes.POINTER(MSLLHOOKSTRUCT)).contents
*/
        __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_v_wParam); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 417, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_v_wparam = ((PyObject*)__pyx_t_5);
        __pyx_t_5 = 0;

        /* "ws_package/utils/hardware_event_validator.py":418
 *                     if nCode >= HC_ACTION:
 *                         wparam = int(wParam)
 *                         if wparam == WM_MOUSEMOVE:             # <<<<<<<<<<<<<<
 *                             ms = ctypes.cast(lParam, ctypes.POINTER(MSLLHOOKSTRUCT)).contents
 *                             if not (ms.flags & LLMHF_INJECTED):
*/
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_WM_MOUSEMOVE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 418, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = PyObject_RichCompare(__pyx_v_wparam, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 418, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 418, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_6) {

          /* "ws_package/utils/hardware_event_validator.py":419
 *                         wparam = int(wParam)
 *                         if wparam == WM_MOUSEMOVE:
 *                             ms = ctypes.cast(lParam, ctypes.POINTER(MSLLHOOKSTRUCT)).contents             # <<<<<<<<<<<<<<
 *                             if not (ms.flags & LLMHF_INJECTED):
 *                                 return user32.CallNextHookEx(None, nCode, wParam, lParam)
*/
          __pyx_t_5 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 419, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_cast); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 419, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_9 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 419, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_POINTER); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 419, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_cur_scope->__pyx_v_MSLLHOOKSTRUCT)) { __Pyx_RaiseClosureNameError("MSLLHOOKSTRUCT"); __PYX_ERR(0, 419, __pyx_L3_error) }
          __pyx_t_12 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_11))) {
            __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
            assert(__pyx_t_9);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
            __pyx_t_12 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_MSLLHOOKSTRUCT};
            __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 419, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_7);
          }
          __pyx_t_12 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_8))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
            assert(__pyx_t_5);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
            __pyx_t_12 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_lParam, __pyx_t_7};
            __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 419, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_contents); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 419, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_ms = __pyx_t_8;
          __pyx_t_8 = 0;

          /* "ws_package/utils/hardware_event_validator.py":420
 *                         if wparam == WM_MOUSEMOVE:
 *                             ms = ctypes.cast(lParam, ctypes.POINTER(MSLLHOOKSTRUCT)).contents
 *                             if not (ms.flags & LLMHF_INJECTED):             # <<<<<<<<<<<<<<
 *                                 return user32.CallNextHookEx(None, nCode, wParam, lParam)
 *                         ms = ctypes.cast(lParam, ctypes.POINTER(MSLLHOOKSTRUCT)).contents
*/
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_ms, __pyx_mstate_global->__pyx_n_u_flags); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 420, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_cur_scope->__pyx_v_LLMHF_INJECTED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_7 = PyNumber_And(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 420, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_13 = (!__pyx_t_6);
          if (__pyx_t_13) {

            /* "ws_package/utils/hardware_event_validator.py":421
 *                             ms = ctypes.cast(lParam, ctypes.POINTER(MSLLHOOKSTRUCT)).contents
 *                             if not (ms.flags & LLMHF_INJECTED):
 *                                 return user32.CallNextHookEx(None, nCode, wParam, lParam)             # <<<<<<<<<<<<<<
 *                         ms = ctypes.cast(lParam, ctypes.POINTER(MSLLHOOKSTRUCT)).contents
 *                         injected = bool(ms.flags & LLMHF_INJECTED)
*/
            __Pyx_XDECREF(__pyx_r);
            if (unlikely(!__pyx_cur_scope->__pyx_v_user32)) { __Pyx_RaiseClosureNameError("user32"); __PYX_ERR(0, 421, __pyx_L3_error) }
            __pyx_t_4 = __pyx_cur_scope->__pyx_v_user32;
            __Pyx_INCREF(__pyx_t_4);
            __pyx_t_12 = 0;
            {
              PyObject *__pyx_callargs[5] = {__pyx_t_4, Py_None, __pyx_v_nCode, __pyx_v_wParam, __pyx_v_lParam};
              __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_CallNextHookEx, __pyx_callargs+__pyx_t_12, (5-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 421, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_7);
            }
            __pyx_r = __pyx_t_7;
            __pyx_t_7 = 0;
            goto __pyx_L7_try_return;

            /* "ws_package/utils/hardware_event_validator.py":420
 *                         if wparam == WM_MOUSEMOVE:
 *                             ms = ctypes.cast(lParam, ctypes.POINTER(MSLLHOOKSTRUCT)).contents
 *                             if not (ms.flags & LLMHF_INJECTED):             # <<<<<<<<<<<<<<
 *                                 return user32.CallNextHookEx(None, nCode, wParam, lParam)
 *                         ms = ctypes.cast(lParam, ctypes.POINTER(MSLLHOOKSTRUCT)).contents
*/
          }

          /* "ws_package/utils/hardware_event_validator.py":418
 *                     if nCode >= HC_ACTION:
 *                         wparam = int(wParam)
 *                         if wparam == WM_MOUSEMOVE:             # <<<<<<<<<<<<<<
 *                             ms = ctypes.cast(lParam, ctypes.POINTER(MSLLHOOKSTRUCT)).contents
 *                             if not (ms.flags & LLMHF_INJECTED):
*/
        }

        /* "ws_package/utils/hardware_event_validator.py":422
 *                             if not (ms.flags & LLMHF_INJECTED):
 *                                 return user32.CallNextHookEx(None, nCode, wParam, lParam)
 *                         ms = ctypes.cast(lParam, ctypes.POINTER(MSLLHOOKSTRUCT)).contents             # <<<<<<<<<<<<<<
 *                         injected = bool(ms.flags & LLMHF_INJECTED)
 *                         now = time.time()
*/
        __pyx_t_4 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 422, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_cast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 422, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_11 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 422, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_POINTER); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 422, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_cur_scope->__pyx_v_MSLLHOOKSTRUCT)) { __Pyx_RaiseClosureNameError("MSLLHOOKSTRUCT"); __PYX_ERR(0, 422, __pyx_L3_error) }
        __pyx_t_12 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
          assert(__pyx_t_11);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
          __pyx_t_12 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_cur_scope->__pyx_v_MSLLHOOKSTRUCT};
          __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 422, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_8);
        }
        __pyx_t_12 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
          assert(__pyx_t_4);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
          __pyx_t_12 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_lParam, __pyx_t_8};
          __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_contents); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 422, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_ms, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "ws_package/utils/hardware_event_validator.py":423
 *                                 return user32.CallNextHookEx(None, nCode, wParam, lParam)
 *                         ms = ctypes.cast(lParam, ctypes.POINTER(MSLLHOOKSTRUCT)).contents
 *                         injected = bool(ms.flags & LLMHF_INJECTED)             # <<<<<<<<<<<<<<
 *                         now = time.time()
 *                         is_scroll = wparam in (WM_MOUSEWHEEL, WM_MOUSEHWHEEL)
*/
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ms, __pyx_mstate_global->__pyx_n_u_flags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 423, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = __Pyx_PyLong_From_long(__pyx_cur_scope->__pyx_v_LLMHF_INJECTED); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PyNumber_And(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 423, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 423, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_v_injected = (!(!__pyx_t_13));

        /* "ws_package/utils/hardware_event_validator.py":424
 *                         ms = ctypes.cast(lParam, ctypes.POINTER(MSLLHOOKSTRUCT)).contents
 *                         injected = bool(ms.flags & LLMHF_INJECTED)
 *                         now = time.time()             # <<<<<<<<<<<<<<
 *                         is_scroll = wparam in (WM_MOUSEWHEEL, WM_MOUSEHWHEEL)
 *                         is_move = wparam == WM_MOUSEMOVE
*/
        __pyx_t_7 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 424, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_12 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_7);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_12 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
          __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_12, (1-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 424, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_8);
        }
        __pyx_v_now = __pyx_t_8;
        __pyx_t_8 = 0;

        /* "ws_package/utils/hardware_event_validator.py":425
 *                         injected = bool(ms.flags & LLMHF_INJECTED)
 *                         now = time.time()
 *                         is_scroll = wparam in (WM_MOUSEWHEEL, WM_MOUSEHWHEEL)             # <<<<<<<<<<<<<<
 *                         is_move = wparam == WM_MOUSEMOVE
 *                         if is_scroll:
*/
        __Pyx_INCREF(__pyx_v_wparam);
        __pyx_t_14 = __pyx_v_wparam;
        __pyx_t_8 = __Pyx_PyLong_From_long(__pyx_cur_scope->__pyx_v_WM_MOUSEWHEEL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 425, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_4 = PyObject_RichCompare(__pyx_t_14, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 425, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (!__pyx_t_6) {
        } else {
          __pyx_t_13 = __pyx_t_6;
          goto __pyx_L12_bool_binop_done;
        }
        __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_cur_scope->__pyx_v_WM_MOUSEHWHEEL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = PyObject_RichCompare(__pyx_t_14, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 425, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 425, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_13 = __pyx_t_6;
        __pyx_L12_bool_binop_done:;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_v_is_scroll = __pyx_t_13;

        /* "ws_package/utils/hardware_event_validator.py":426
 *                         now = time.time()
 *                         is_scroll = wparam in (WM_MOUSEWHEEL, WM_MOUSEHWHEEL)
 *                         is_move = wparam == WM_MOUSEMOVE             # <<<<<<<<<<<<<<
 *                         if is_scroll:
 *                             injected = False
*/
        __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_WM_MOUSEMOVE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 426, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_4 = PyObject_RichCompare(__pyx_v_wparam, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 426, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_v_is_move = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "ws_package/utils/hardware_event_validator.py":427
 *                         is_scroll = wparam in (WM_MOUSEWHEEL, WM_MOUSEHWHEEL)
 *                         is_move = wparam == WM_MOUSEMOVE
 *                         if is_scroll:             # <<<<<<<<<<<<<<
 *                             injected = False
 *                         with self._windows_lock:
*/
        if (__pyx_v_is_scroll) {

          /* "ws_package/utils/hardware_event_validator.py":428
 *                         is_move = wparam == WM_MOUSEMOVE
 *                         if is_scroll:
 *                             injected = False             # <<<<<<<<<<<<<<
 *                         with self._windows_lock:
 *                             self._windows_last_mouse_event = {
*/
          __pyx_v_injected = 0;

          /* "ws_package/utils/hardware_event_validator.py":427
 *                         is_scroll = wparam in (WM_MOUSEWHEEL, WM_MOUSEHWHEEL)
 *                         is_move = wparam == WM_MOUSEMOVE
 *                         if is_scroll:             # <<<<<<<<<<<<<<
 *                             injected = False
 *                         with self._windows_lock:
*/
        }

        /* "ws_package/utils/hardware_event_validator.py":429
 *                         if is_scroll:
 *                             injected = False
 *                         with self._windows_lock:             # <<<<<<<<<<<<<<
 *                             self._windows_last_mouse_event = {
 *                                 'injected': injected,
*/
        /*with:*/ {
          if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 429, __pyx_L3_error) }
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_lock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_15 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 429, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_7 = NULL;
          __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_12 = 1;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_5))) {
            __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
            assert(__pyx_t_7);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
            __pyx_t_12 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
            __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_12, (1-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 429, __pyx_L15_error)
            __Pyx_GOTREF(__pyx_t_8);
          }
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          /*try:*/ {
            {
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __Pyx_ExceptionSave(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
              __Pyx_XGOTREF(__pyx_t_16);
              __Pyx_XGOTREF(__pyx_t_17);
              __Pyx_XGOTREF(__pyx_t_18);
              /*try:*/ {

                /* "ws_package/utils/hardware_event_validator.py":431
 *                         with self._windows_lock:
 *                             self._windows_last_mouse_event = {
 *                                 'injected': injected,             # <<<<<<<<<<<<<<
 *                                 'timestamp': now,
 *                             }
*/
                __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 431, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_4);
                __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_injected); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 431, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_8);
                if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_injected, __pyx_t_8) < (0)) __PYX_ERR(0, 431, __pyx_L19_error)
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

                /* "ws_package/utils/hardware_event_validator.py":432
 *                             self._windows_last_mouse_event = {
 *                                 'injected': injected,
 *                                 'timestamp': now,             # <<<<<<<<<<<<<<
 *                             }
 *                             if is_scroll:
*/
                if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_timestamp, __pyx_v_now) < (0)) __PYX_ERR(0, 431, __pyx_L19_error)

                /* "ws_package/utils/hardware_event_validator.py":430
 *                             injected = False
 *                         with self._windows_lock:
 *                             self._windows_last_mouse_event = {             # <<<<<<<<<<<<<<
 *                                 'injected': injected,
 *                                 'timestamp': now,
*/
                if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 430, __pyx_L19_error) }
                if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_mouse_event, __pyx_t_4) < (0)) __PYX_ERR(0, 430, __pyx_L19_error)
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

                /* "ws_package/utils/hardware_event_validator.py":434
 *                                 'timestamp': now,
 *                             }
 *                             if is_scroll:             # <<<<<<<<<<<<<<
 *                                 self._windows_last_hw_scroll_ts = now
 *                                 if not injected:
*/
                if (__pyx_v_is_scroll) {

                  /* "ws_package/utils/hardware_event_validator.py":435
 *                             }
 *                             if is_scroll:
 *                                 self._windows_last_hw_scroll_ts = now             # <<<<<<<<<<<<<<
 *                                 if not injected:
 *                                     self._windows_last_hw_mouse_ts = now
*/
                  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 435, __pyx_L19_error) }
                  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_hw_scroll_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 435, __pyx_L19_error)

                  /* "ws_package/utils/hardware_event_validator.py":436
 *                             if is_scroll:
 *                                 self._windows_last_hw_scroll_ts = now
 *                                 if not injected:             # <<<<<<<<<<<<<<
 *                                     self._windows_last_hw_mouse_ts = now
 *                             elif injected:
*/
                  __pyx_t_13 = (!__pyx_v_injected);
                  if (__pyx_t_13) {

                    /* "ws_package/utils/hardware_event_validator.py":437
 *                                 self._windows_last_hw_scroll_ts = now
 *                                 if not injected:
 *                                     self._windows_last_hw_mouse_ts = now             # <<<<<<<<<<<<<<
 *                             elif injected:
 *                                 self._windows_last_syn_mouse_ts = now
*/
                    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 437, __pyx_L19_error) }
                    if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_hw_mouse_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 437, __pyx_L19_error)

                    /* "ws_package/utils/hardware_event_validator.py":436
 *                             if is_scroll:
 *                                 self._windows_last_hw_scroll_ts = now
 *                                 if not injected:             # <<<<<<<<<<<<<<
 *                                     self._windows_last_hw_mouse_ts = now
 *                             elif injected:
*/
                  }

                  /* "ws_package/utils/hardware_event_validator.py":434
 *                                 'timestamp': now,
 *                             }
 *                             if is_scroll:             # <<<<<<<<<<<<<<
 *                                 self._windows_last_hw_scroll_ts = now
 *                                 if not injected:
*/
                  goto __pyx_L25;
                }

                /* "ws_package/utils/hardware_event_validator.py":438
 *                                 if not injected:
 *                                     self._windows_last_hw_mouse_ts = now
 *                             elif injected:             # <<<<<<<<<<<<<<
 *                                 self._windows_last_syn_mouse_ts = now
 *                             elif is_move:
*/
                if (__pyx_v_injected) {

                  /* "ws_package/utils/hardware_event_validator.py":439
 *                                     self._windows_last_hw_mouse_ts = now
 *                             elif injected:
 *                                 self._windows_last_syn_mouse_ts = now             # <<<<<<<<<<<<<<
 *                             elif is_move:
 *                                 pass
*/
                  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 439, __pyx_L19_error) }
                  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_syn_mouse_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 439, __pyx_L19_error)

                  /* "ws_package/utils/hardware_event_validator.py":438
 *                                 if not injected:
 *                                     self._windows_last_hw_mouse_ts = now
 *                             elif injected:             # <<<<<<<<<<<<<<
 *                                 self._windows_last_syn_mouse_ts = now
 *                             elif is_move:
*/
                  goto __pyx_L25;
                }

                /* "ws_package/utils/hardware_event_validator.py":440
 *                             elif injected:
 *                                 self._windows_last_syn_mouse_ts = now
 *                             elif is_move:             # <<<<<<<<<<<<<<
 *                                 pass
 *                             else:
*/
                __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_is_move); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 440, __pyx_L19_error)
                if (__pyx_t_13) {
                  goto __pyx_L25;
                }

                /* "ws_package/utils/hardware_event_validator.py":443
 *                                 pass
 *                             else:
 *                                 self._windows_last_hw_mouse_ts = now             # <<<<<<<<<<<<<<
 *                 except Exception:
 *                     pass
*/
                /*else*/ {
                  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 443, __pyx_L19_error) }
                  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_hw_mouse_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 443, __pyx_L19_error)
                }
                __pyx_L25:;

                /* "ws_package/utils/hardware_event_validator.py":429
 *                         if is_scroll:
 *                             injected = False
 *                         with self._windows_lock:             # <<<<<<<<<<<<<<
 *                             self._windows_last_mouse_event = {
 *                                 'injected': injected,
*/
              }
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
              __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
              goto __pyx_L24_try_end;
              __pyx_L19_error:;
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
              /*except:*/ {
                __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._windows_hook_thread.low_level_mouse_proc", __pyx_clineno, __pyx_lineno, __pyx_filename);
                if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_5) < 0) __PYX_ERR(0, 429, __pyx_L21_except_error)
                __Pyx_XGOTREF(__pyx_t_4);
                __Pyx_XGOTREF(__pyx_t_8);
                __Pyx_XGOTREF(__pyx_t_5);
                __pyx_t_7 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 429, __pyx_L21_except_error)
                __Pyx_GOTREF(__pyx_t_7);
                __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_7, NULL);
                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 429, __pyx_L21_except_error)
                __Pyx_GOTREF(__pyx_t_19);
                __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_19);
                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                if (__pyx_t_13 < (0)) __PYX_ERR(0, 429, __pyx_L21_except_error)
                __pyx_t_6 = (!__pyx_t_13);
                if (unlikely(__pyx_t_6)) {
                  __Pyx_GIVEREF(__pyx_t_4);
                  __Pyx_GIVEREF(__pyx_t_8);
                  __Pyx_XGIVEREF(__pyx_t_5);
                  __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_8, __pyx_t_5);
                  __pyx_t_4 = 0;  __pyx_t_8 = 0;  __pyx_t_5 = 0; 
                  __PYX_ERR(0, 429, __pyx_L21_except_error)
                }
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
                __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                goto __pyx_L20_exception_handled;
              }
              __pyx_L21_except_error:;
              __Pyx_XGIVEREF(__pyx_t_16);
              __Pyx_XGIVEREF(__pyx_t_17);
              __Pyx_XGIVEREF(__pyx_t_18);
              __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
              goto __pyx_L3_error;
              __pyx_L20_exception_handled:;
              __Pyx_XGIVEREF(__pyx_t_16);
              __Pyx_XGIVEREF(__pyx_t_17);
              __Pyx_XGIVEREF(__pyx_t_18);
              __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
              __pyx_L24_try_end:;
            }
          }
          /*finally:*/ {
            /*normal exit:*/{
              if (__pyx_t_15) {
                __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_mstate_global->__pyx_tuple[2], NULL);
                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 429, __pyx_L3_error)
                __Pyx_GOTREF(__pyx_t_18);
                __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
              }
              goto __pyx_L18;
            }
            __pyx_L18:;
          }
          goto __pyx_L30;
          __pyx_L15_error:;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          goto __pyx_L3_error;
          __pyx_L30:;
        }

        /* "ws_package/utils/hardware_event_validator.py":416
 *             def low_level_mouse_proc(nCode, wParam, lParam):
 *                 try:
 *                     if nCode >= HC_ACTION:             # <<<<<<<<<<<<<<
 *                         wparam = int(wParam)
 *                         if wparam == WM_MOUSEMOVE:
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":415
 * 
 *             def low_level_mouse_proc(nCode, wParam, lParam):
 *                 try:             # <<<<<<<<<<<<<<
 *                     if nCode >= HC_ACTION:
 *                         wparam = int(wParam)
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "ws_package/utils/hardware_event_validator.py":444
 *                             else:
 *                                 self._windows_last_hw_mouse_ts = now
 *                 except Exception:             # <<<<<<<<<<<<<<
 *                     pass
 *                 return user32.CallNextHookEx(None, nCode, wParam, lParam)
*/
    __pyx_t_20 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_20) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "ws_package/utils/hardware_event_validator.py":415
 * 
 *             def low_level_mouse_proc(nCode, wParam, lParam):
 *                 try:             # <<<<<<<<<<<<<<
 *                     if nCode >= HC_ACTION:
 *                         wparam = int(wParam)
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ws_package/utils/hardware_event_validator.py":446
 *                 except Exception:
 *                     pass
 *                 return user32.CallNextHookEx(None, nCode, wParam, lParam)             # <<<<<<<<<<<<<<
 * 
 *             # Keep callbacks alive for the lifetime of the hook.
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_user32)) { __Pyx_RaiseClosureNameError("user32"); __PYX_ERR(0, 446, __pyx_L1_error) }
  __pyx_t_8 = __pyx_cur_scope->__pyx_v_user32;
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_12 = 0;
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_8, Py_None, __pyx_v_nCode, __pyx_v_wParam, __pyx_v_lParam};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_CallNextHookEx, __pyx_callargs+__pyx_t_12, (5-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":414
 *                 return user32.CallNextHookEx(None, nCode, wParam, lParam)
 * 
 *             def low_level_mouse_proc(nCode, wParam, lParam):             # <<<<<<<<<<<<<<
 *                 try:
 *                     if nCode >= HC_ACTION:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._windows_hook_thread.low_level_mouse_proc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_wparam);
  __Pyx_XDECREF(__pyx_v_ms);
  __Pyx_XDECREF(__pyx_v_now);
  __Pyx_XDECREF(__pyx_v_is_move);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":511
 *             _raw_input_header_size = ctypes.sizeof(RAWINPUTHEADER)
 * 
 *             def record_raw_mouse_input(lParam):             # <<<<<<<<<<<<<<
 *                 try:
 *                     size = ctypes.wintypes.UINT(0)
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_5record_raw_mouse_input(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_5record_raw_mouse_input = {"record_raw_mouse_input", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_5record_raw_mouse_input, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_5record_raw_mouse_input(PyObject *__pyx_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_lParam = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("record_raw_mouse_input (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_lParam,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 511, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 511, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "record_raw_mouse_input", 0) < (0)) __PYX_ERR(0, 511, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("record_raw_mouse_input", 1, 1, 1, i); __PYX_ERR(0, 511, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 511, __pyx_L3_error)
    }
    __pyx_v_lParam = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("record_raw_mouse_input", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 511, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._windows_hook_thread.record_raw_mouse_input", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_4record_raw_mouse_input(__pyx_self, __pyx_v_lParam);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_4record_raw_mouse_input(PyObject *__pyx_self, PyObject *__pyx_v_lParam) {
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *__pyx_cur_scope;
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *__pyx_outer_scope;
  PyObject *__pyx_v_size = NULL;
  PyObject *__pyx_v_buf = NULL;
  PyObject *__pyx_v_got = NULL;
  PyObject *__pyx_v_header = NULL;
  PyObject *__pyx_v_mouse = NULL;
  PyObject *__pyx_v_now = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("record_raw_mouse_input", 0);
  __pyx_outer_scope = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "ws_package/utils/hardware_event_validator.py":512
 * 
 *             def record_raw_mouse_input(lParam):
 *                 try:             # <<<<<<<<<<<<<<
 *                     size = ctypes.wintypes.UINT(0)
 *                     user32.GetRawInputData(
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":513
 *             def record_raw_mouse_input(lParam):
 *                 try:
 *                     size = ctypes.wintypes.UINT(0)             # <<<<<<<<<<<<<<
 *                     user32.GetRawInputData(
 *                         lParam, RID_INPUT, None, ctypes.byref(size), _raw_input_header_size,
*/
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 513, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_5 = __pyx_t_7;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_int_0};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_UINT, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_v_size = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":514
 *                 try:
 *                     size = ctypes.wintypes.UINT(0)
 *                     user32.GetRawInputData(             # <<<<<<<<<<<<<<
 *                         lParam, RID_INPUT, None, ctypes.byref(size), _raw_input_header_size,
 *                     )
*/
      if (unlikely(!__pyx_cur_scope->__pyx_v_user32)) { __Pyx_RaiseClosureNameError("user32"); __PYX_ERR(0, 514, __pyx_L3_error) }
      __pyx_t_7 = __pyx_cur_scope->__pyx_v_user32;
      __Pyx_INCREF(__pyx_t_7);

      /* "ws_package/utils/hardware_event_validator.py":515
 *                     size = ctypes.wintypes.UINT(0)
 *                     user32.GetRawInputData(
 *                         lParam, RID_INPUT, None, ctypes.byref(size), _raw_input_header_size,             # <<<<<<<<<<<<<<
 *                     )
 *                     if size.value < _raw_input_header_size + ctypes.sizeof(RAWMOUSE):
*/
      __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_cur_scope->__pyx_v_RID_INPUT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 515, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 515, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_byref); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 515, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
        assert(__pyx_t_9);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_size};
        __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 515, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      if (unlikely(!__pyx_cur_scope->__pyx_v__raw_input_header_size)) { __Pyx_RaiseClosureNameError("_raw_input_header_size"); __PYX_ERR(0, 515, __pyx_L3_error) }
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[6] = {__pyx_t_7, __pyx_v_lParam, __pyx_t_5, Py_None, __pyx_t_6, __pyx_cur_scope->__pyx_v__raw_input_header_size};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_GetRawInputData, __pyx_callargs+__pyx_t_8, (6-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 514, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":517
 *                         lParam, RID_INPUT, None, ctypes.byref(size), _raw_input_header_size,
 *                     )
 *                     if size.value < _raw_input_header_size + ctypes.sizeof(RAWMOUSE):             # <<<<<<<<<<<<<<
 *                         return
 *                     buf = ctypes.create_string_buffer(size.value)
*/
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_size, __pyx_mstate_global->__pyx_n_u_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 517, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(!__pyx_cur_scope->__pyx_v__raw_input_header_size)) { __Pyx_RaiseClosureNameError("_raw_input_header_size"); __PYX_ERR(0, 517, __pyx_L3_error) }
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 517, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_sizeof); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 517, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_cur_scope->__pyx_v_RAWMOUSE)) { __Pyx_RaiseClosureNameError("RAWMOUSE"); __PYX_ERR(0, 517, __pyx_L3_error) }
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_RAWMOUSE};
        __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 517, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_t_11 = PyNumber_Add(__pyx_cur_scope->__pyx_v__raw_input_header_size, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 517, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_11, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 517, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 517, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_12) {

        /* "ws_package/utils/hardware_event_validator.py":518
 *                     )
 *                     if size.value < _raw_input_header_size + ctypes.sizeof(RAWMOUSE):
 *                         return             # <<<<<<<<<<<<<<
 *                     buf = ctypes.create_string_buffer(size.value)
 *                     got = user32.GetRawInputData(
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L7_try_return;

        /* "ws_package/utils/hardware_event_validator.py":517
 *                         lParam, RID_INPUT, None, ctypes.byref(size), _raw_input_header_size,
 *                     )
 *                     if size.value < _raw_input_header_size + ctypes.sizeof(RAWMOUSE):             # <<<<<<<<<<<<<<
 *                         return
 *                     buf = ctypes.create_string_buffer(size.value)
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":519
 *                     if size.value < _raw_input_header_size + ctypes.sizeof(RAWMOUSE):
 *                         return
 *                     buf = ctypes.create_string_buffer(size.value)             # <<<<<<<<<<<<<<
 *                     got = user32.GetRawInputData(
 *                         lParam, RID_INPUT, buf, ctypes.byref(size), _raw_input_header_size,
*/
      __pyx_t_11 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_create_string_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 519, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_size, __pyx_mstate_global->__pyx_n_u_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
        assert(__pyx_t_11);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_4};
        __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 519, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_v_buf = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "ws_package/utils/hardware_event_validator.py":520
 *                         return
 *                     buf = ctypes.create_string_buffer(size.value)
 *                     got = user32.GetRawInputData(             # <<<<<<<<<<<<<<
 *                         lParam, RID_INPUT, buf, ctypes.byref(size), _raw_input_header_size,
 *                     )
*/
      if (unlikely(!__pyx_cur_scope->__pyx_v_user32)) { __Pyx_RaiseClosureNameError("user32"); __PYX_ERR(0, 520, __pyx_L3_error) }
      __pyx_t_5 = __pyx_cur_scope->__pyx_v_user32;
      __Pyx_INCREF(__pyx_t_5);

      /* "ws_package/utils/hardware_event_validator.py":521
 *                     buf = ctypes.create_string_buffer(size.value)
 *                     got = user32.GetRawInputData(
 *                         lParam, RID_INPUT, buf, ctypes.byref(size), _raw_input_header_size,             # <<<<<<<<<<<<<<
 *                     )
 *                     if got == ctypes.wintypes.UINT(-1).value:
*/
      __pyx_t_4 = __Pyx_PyLong_From_long(__pyx_cur_scope->__pyx_v_RID_INPUT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 521, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 521, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_byref); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 521, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
        assert(__pyx_t_7);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_size};
        __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 521, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      if (unlikely(!__pyx_cur_scope->__pyx_v__raw_input_header_size)) { __Pyx_RaiseClosureNameError("_raw_input_header_size"); __PYX_ERR(0, 521, __pyx_L3_error) }
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[6] = {__pyx_t_5, __pyx_v_lParam, __pyx_t_4, __pyx_v_buf, __pyx_t_11, __pyx_cur_scope->__pyx_v__raw_input_header_size};
        __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_GetRawInputData, __pyx_callargs+__pyx_t_8, (6-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_v_got = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "ws_package/utils/hardware_event_validator.py":523
 *                         lParam, RID_INPUT, buf, ctypes.byref(size), _raw_input_header_size,
 *                     )
 *                     if got == ctypes.wintypes.UINT(-1).value:             # <<<<<<<<<<<<<<
 *                         return
 *                     header = RAWINPUTHEADER.from_buffer_copy(buf)
*/
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_11 = __pyx_t_5;
      __Pyx_INCREF(__pyx_t_11);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_int_neg_1};
        __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_UINT, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_RichCompare(__pyx_v_got, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 523, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_12) {

        /* "ws_package/utils/hardware_event_validator.py":524
 *                     )
 *                     if got == ctypes.wintypes.UINT(-1).value:
 *                         return             # <<<<<<<<<<<<<<
 *                     header = RAWINPUTHEADER.from_buffer_copy(buf)
 *                     if header.dwType != RIM_TYPEMOUSE:
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L7_try_return;

        /* "ws_package/utils/hardware_event_validator.py":523
 *                         lParam, RID_INPUT, buf, ctypes.byref(size), _raw_input_header_size,
 *                     )
 *                     if got == ctypes.wintypes.UINT(-1).value:             # <<<<<<<<<<<<<<
 *                         return
 *                     header = RAWINPUTHEADER.from_buffer_copy(buf)
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":525
 *                     if got == ctypes.wintypes.UINT(-1).value:
 *                         return
 *                     header = RAWINPUTHEADER.from_buffer_copy(buf)             # <<<<<<<<<<<<<<
 *                     if header.dwType != RIM_TYPEMOUSE:
 *                         return
*/
      if (unlikely(!__pyx_cur_scope->__pyx_v_RAWINPUTHEADER)) { __Pyx_RaiseClosureNameError("RAWINPUTHEADER"); __PYX_ERR(0, 525, __pyx_L3_error) }
      __pyx_t_5 = __pyx_cur_scope->__pyx_v_RAWINPUTHEADER;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_buf};
        __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_from_buffer_copy, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 525, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_v_header = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "ws_package/utils/hardware_event_validator.py":526
 *                         return
 *                     header = RAWINPUTHEADER.from_buffer_copy(buf)
 *                     if header.dwType != RIM_TYPEMOUSE:             # <<<<<<<<<<<<<<
 *                         return
 *                     mouse = RAWMOUSE.from_buffer_copy(buf, _raw_input_header_size)
*/
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_header, __pyx_mstate_global->__pyx_n_u_dwType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 526, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyLong_From_long(__pyx_cur_scope->__pyx_v_RIM_TYPEMOUSE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 526, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 526, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 526, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (__pyx_t_12) {

        /* "ws_package/utils/hardware_event_validator.py":527
 *                     header = RAWINPUTHEADER.from_buffer_copy(buf)
 *                     if header.dwType != RIM_TYPEMOUSE:
 *                         return             # <<<<<<<<<<<<<<
 *                     mouse = RAWMOUSE.from_buffer_copy(buf, _raw_input_header_size)
 *                     now = time.time()
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L7_try_return;

        /* "ws_package/utils/hardware_event_validator.py":526
 *                         return
 *                     header = RAWINPUTHEADER.from_buffer_copy(buf)
 *                     if header.dwType != RIM_TYPEMOUSE:             # <<<<<<<<<<<<<<
 *                         return
 *                     mouse = RAWMOUSE.from_buffer_copy(buf, _raw_input_header_size)
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":528
 *                     if header.dwType != RIM_TYPEMOUSE:
 *                         return
 *                     mouse = RAWMOUSE.from_buffer_copy(buf, _raw_input_header_size)             # <<<<<<<<<<<<<<
 *                     now = time.time()
 *                     with self._windows_lock:
*/
      if (unlikely(!__pyx_cur_scope->__pyx_v_RAWMOUSE)) { __Pyx_RaiseClosureNameError("RAWMOUSE"); __PYX_ERR(0, 528, __pyx_L3_error) }
      __pyx_t_5 = __pyx_cur_scope->__pyx_v_RAWMOUSE;
      __Pyx_INCREF(__pyx_t_5);
      if (unlikely(!__pyx_cur_scope->__pyx_v__raw_input_header_size)) { __Pyx_RaiseClosureNameError("_raw_input_header_size"); __PYX_ERR(0, 528, __pyx_L3_error) }
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_buf, __pyx_cur_scope->__pyx_v__raw_input_header_size};
        __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_from_buffer_copy, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 528, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __pyx_v_mouse = __pyx_t_11;
      __pyx_t_11 = 0;

      /* "ws_package/utils/hardware_event_validator.py":529
 *                         return
 *                     mouse = RAWMOUSE.from_buffer_copy(buf, _raw_input_header_size)
 *                     now = time.time()             # <<<<<<<<<<<<<<
 *                     with self._windows_lock:
 *                         self._windows_last_raw_mouse_ts = now
*/
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 529, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 529, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __pyx_v_now = __pyx_t_11;
      __pyx_t_11 = 0;

      /* "ws_package/utils/hardware_event_validator.py":530
 *                     mouse = RAWMOUSE.from_buffer_copy(buf, _raw_input_header_size)
 *                     now = time.time()
 *                     with self._windows_lock:             # <<<<<<<<<<<<<<
 *                         self._windows_last_raw_mouse_ts = now
 *                         if mouse.usButtonFlags & (RI_MOUSE_WHEEL | RI_MOUSE_HWHEEL):
*/
      /*with:*/ {
        if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 530, __pyx_L3_error) }
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_lock); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 530, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_13 = __Pyx_PyObject_LookupSpecial(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 530, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_5 = NULL;
        __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 530, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = 1;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          assert(__pyx_t_5);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
          __pyx_t_8 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        /*try:*/ {
          {
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_14);
            __Pyx_XGOTREF(__pyx_t_15);
            __Pyx_XGOTREF(__pyx_t_16);
            /*try:*/ {

              /* "ws_package/utils/hardware_event_validator.py":531
 *                     now = time.time()
 *                     with self._windows_lock:
 *                         self._windows_last_raw_mouse_ts = now             # <<<<<<<<<<<<<<
 *                         if mouse.usButtonFlags & (RI_MOUSE_WHEEL | RI_MOUSE_HWHEEL):
 *                             self._windows_last_hw_scroll_ts = now
*/
              if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 531, __pyx_L16_error) }
              if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_raw_mouse_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 531, __pyx_L16_error)

              /* "ws_package/utils/hardware_event_validator.py":532
 *                     with self._windows_lock:
 *                         self._windows_last_raw_mouse_ts = now
 *                         if mouse.usButtonFlags & (RI_MOUSE_WHEEL | RI_MOUSE_HWHEEL):             # <<<<<<<<<<<<<<
 *                             self._windows_last_hw_scroll_ts = now
 *                         if mouse.usButtonFlags & RI_MOUSE_BUTTONS:
*/
              __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_mouse, __pyx_mstate_global->__pyx_n_u_usButtonFlags); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 532, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_RI_MOUSE_WHEEL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 532, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_RI_MOUSE_HWHEEL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 532, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_6);
              __pyx_t_5 = PyNumber_Or(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 532, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __pyx_t_6 = PyNumber_And(__pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 532, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 532, __pyx_L16_error)
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              if (__pyx_t_12) {

                /* "ws_package/utils/hardware_event_validator.py":533
 *                         self._windows_last_raw_mouse_ts = now
 *                         if mouse.usButtonFlags & (RI_MOUSE_WHEEL | RI_MOUSE_HWHEEL):
 *                             self._windows_last_hw_scroll_ts = now             # <<<<<<<<<<<<<<
 *                         if mouse.usButtonFlags & RI_MOUSE_BUTTONS:
 *                             self._windows_last_hw_mouse_ts = now
*/
                if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 533, __pyx_L16_error) }
                if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_hw_scroll_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 533, __pyx_L16_error)

                /* "ws_package/utils/hardware_event_validator.py":532
 *                     with self._windows_lock:
 *                         self._windows_last_raw_mouse_ts = now
 *                         if mouse.usButtonFlags & (RI_MOUSE_WHEEL | RI_MOUSE_HWHEEL):             # <<<<<<<<<<<<<<
 *                             self._windows_last_hw_scroll_ts = now
 *                         if mouse.usButtonFlags & RI_MOUSE_BUTTONS:
*/
              }

              /* "ws_package/utils/hardware_event_validator.py":534
 *                         if mouse.usButtonFlags & (RI_MOUSE_WHEEL | RI_MOUSE_HWHEEL):
 *                             self._windows_last_hw_scroll_ts = now
 *                         if mouse.usButtonFlags & RI_MOUSE_BUTTONS:             # <<<<<<<<<<<<<<
 *                             self._windows_last_hw_mouse_ts = now
 *                         if mouse.lLastX or mouse.lLastY:
*/
              __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_mouse, __pyx_mstate_global->__pyx_n_u_usButtonFlags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 534, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_RI_MOUSE_BUTTONS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_11 = PyNumber_And(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 534, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 534, __pyx_L16_error)
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              if (__pyx_t_12) {

                /* "ws_package/utils/hardware_event_validator.py":535
 *                             self._windows_last_hw_scroll_ts = now
 *                         if mouse.usButtonFlags & RI_MOUSE_BUTTONS:
 *                             self._windows_last_hw_mouse_ts = now             # <<<<<<<<<<<<<<
 *                         if mouse.lLastX or mouse.lLastY:
 *                             self._windows_last_hw_mouse_ts = now
*/
                if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 535, __pyx_L16_error) }
                if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_hw_mouse_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 535, __pyx_L16_error)

                /* "ws_package/utils/hardware_event_validator.py":534
 *                         if mouse.usButtonFlags & (RI_MOUSE_WHEEL | RI_MOUSE_HWHEEL):
 *                             self._windows_last_hw_scroll_ts = now
 *                         if mouse.usButtonFlags & RI_MOUSE_BUTTONS:             # <<<<<<<<<<<<<<
 *                             self._windows_last_hw_mouse_ts = now
 *                         if mouse.lLastX or mouse.lLastY:
*/
              }

              /* "ws_package/utils/hardware_event_validator.py":536
 *                         if mouse.usButtonFlags & RI_MOUSE_BUTTONS:
 *                             self._windows_last_hw_mouse_ts = now
 *                         if mouse.lLastX or mouse.lLastY:             # <<<<<<<<<<<<<<
 *                             self._windows_last_hw_mouse_ts = now
 *                 except Exception:
*/
              __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_mouse, __pyx_mstate_global->__pyx_n_u_lLastX); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 536, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 536, __pyx_L16_error)
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              if (!__pyx_t_17) {
              } else {
                __pyx_t_12 = __pyx_t_17;
                goto __pyx_L25_bool_binop_done;
              }
              __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_mouse, __pyx_mstate_global->__pyx_n_u_lLastY); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 536, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 536, __pyx_L16_error)
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              __pyx_t_12 = __pyx_t_17;
              __pyx_L25_bool_binop_done:;
              if (__pyx_t_12) {

                /* "ws_package/utils/hardware_event_validator.py":537
 *                             self._windows_last_hw_mouse_ts = now
 *                         if mouse.lLastX or mouse.lLastY:
 *                             self._windows_last_hw_mouse_ts = now             # <<<<<<<<<<<<<<
 *                 except Exception:
 *                     pass
*/
                if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 537, __pyx_L16_error) }
                if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_hw_mouse_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 537, __pyx_L16_error)

                /* "ws_package/utils/hardware_event_validator.py":536
 *                         if mouse.usButtonFlags & RI_MOUSE_BUTTONS:
 *                             self._windows_last_hw_mouse_ts = now
 *                         if mouse.lLastX or mouse.lLastY:             # <<<<<<<<<<<<<<
 *                             self._windows_last_hw_mouse_ts = now
 *                 except Exception:
*/
              }

              /* "ws_package/utils/hardware_event_validator.py":530
 *                     mouse = RAWMOUSE.from_buffer_copy(buf, _raw_input_header_size)
 *                     now = time.time()
 *                     with self._windows_lock:             # <<<<<<<<<<<<<<
 *                         self._windows_last_raw_mouse_ts = now
 *                         if mouse.usButtonFlags & (RI_MOUSE_WHEEL | RI_MOUSE_HWHEEL):
*/
            }
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
            goto __pyx_L21_try_end;
            __pyx_L16_error:;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            /*except:*/ {
              __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._windows_hook_thread.record_raw_mouse_input", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 530, __pyx_L18_except_error)
              __Pyx_XGOTREF(__pyx_t_11);
              __Pyx_XGOTREF(__pyx_t_5);
              __Pyx_XGOTREF(__pyx_t_6);
              __pyx_t_4 = PyTuple_Pack(3, __pyx_t_11, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L18_except_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_4, NULL);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 530, __pyx_L18_except_error)
              __Pyx_GOTREF(__pyx_t_18);
              __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_18);
              __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
              if (__pyx_t_12 < (0)) __PYX_ERR(0, 530, __pyx_L18_except_error)
              __pyx_t_17 = (!__pyx_t_12);
              if (unlikely(__pyx_t_17)) {
                __Pyx_GIVEREF(__pyx_t_11);
                __Pyx_GIVEREF(__pyx_t_5);
                __Pyx_XGIVEREF(__pyx_t_6);
                __Pyx_ErrRestoreWithState(__pyx_t_11, __pyx_t_5, __pyx_t_6);
                __pyx_t_11 = 0;  __pyx_t_5 = 0;  __pyx_t_6 = 0; 
                __PYX_ERR(0, 530, __pyx_L18_except_error)
              }
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              goto __pyx_L17_exception_handled;
            }
            __pyx_L18_except_error:;
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
            goto __pyx_L3_error;
            __pyx_L17_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
            __pyx_L21_try_end:;
          }
        }
        /*finally:*/ {
          /*normal exit:*/{
            if (__pyx_t_13) {
              __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[2], NULL);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 530, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_16);
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            }
            goto __pyx_L15;
          }
          __pyx_L15:;
        }
        goto __pyx_L30;
        __pyx_L12_error:;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L3_error;
        __pyx_L30:;
      }

      /* "ws_package/utils/hardware_event_validator.py":512
 * 
 *             def record_raw_mouse_input(lParam):
 *                 try:             # <<<<<<<<<<<<<<
 *                     size = ctypes.wintypes.UINT(0)
 *                     user32.GetRawInputData(
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "ws_package/utils/hardware_event_validator.py":538
 *                         if mouse.lLastX or mouse.lLastY:
 *                             self._windows_last_hw_mouse_ts = now
 *                 except Exception:             # <<<<<<<<<<<<<<
 *                     pass
 * 
*/
    __pyx_t_19 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_19) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "ws_package/utils/hardware_event_validator.py":512
 * 
 *             def record_raw_mouse_input(lParam):
 *                 try:             # <<<<<<<<<<<<<<
 *                     size = ctypes.wintypes.UINT(0)
 *                     user32.GetRawInputData(
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ws_package/utils/hardware_event_validator.py":511
 *             _raw_input_header_size = ctypes.sizeof(RAWINPUTHEADER)
 * 
 *             def record_raw_mouse_input(lParam):             # <<<<<<<<<<<<<<
 *                 try:
 *                     size = ctypes.wintypes.UINT(0)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._windows_hook_thread.record_raw_mouse_input", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_size);
  __Pyx_XDECREF(__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_got);
  __Pyx_XDECREF(__pyx_v_header);
  __Pyx_XDECREF(__pyx_v_mouse);
  __Pyx_XDECREF(__pyx_v_now);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":303
 *         )
 * 
 *     def _windows_hook_thread(self, ready_event: threading.Event, ok_flag: list):             # <<<<<<<<<<<<<<
 *         """
 *         Dedicated thread that INSTALLS and PUMPS low-level Windows hooks.
*/

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_16_windows_hook_thread(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ready_event, PyObject *__pyx_v_ok_flag) {
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *__pyx_cur_scope;
  PyObject *__pyx_v_kernel32 = NULL;
  long __pyx_v_WH_KEYBOARD_LL;
  CYTHON_UNUSED long __pyx_v_WH_MOUSE_LL;
  PyObject *__pyx_v_HOOKPROC = NULL;
  PyObject *__pyx_v_low_level_keyboard_proc = 0;
  PyObject *__pyx_v_low_level_mouse_proc = 0;
  PyObject *__pyx_v_keyboard_proc = NULL;
  PyObject *__pyx_v_mouse_proc = NULL;
  PyObject *__pyx_v_hmod = NULL;
  PyObject *__pyx_v_keyboard_hook = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_mouse_hook = NULL;
  long __pyx_v_RIDEV_INPUTSINK;
  PyObject *__pyx_v_RAWINPUTDEVICE = NULL;
  PyObject *__pyx_v_record_raw_mouse_input = 0;
  PyObject *__pyx_v_rdi = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  int __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  int __pyx_t_22;
  int __pyx_t_23;
  char const *__pyx_t_24;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  PyObject *__pyx_t_28 = NULL;
  PyObject *__pyx_t_29 = NULL;
  PyObject *__pyx_t_30 = NULL;
  char const *__pyx_t_31;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_windows_hook_thread", 0);
  __pyx_cur_scope = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *)__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread(__pyx_mstate_global->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 303, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);

  /* "ws_package/utils/hardware_event_validator.py":315
 *         pynput also uses.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             #  Private DLL handles (not shared with pynput)
 *             user32   = ctypes.WinDLL('user32',   use_last_error=True)
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":317
 *         try:
 *             #  Private DLL handles (not shared with pynput)
 *             user32   = ctypes.WinDLL('user32',   use_last_error=True)             # <<<<<<<<<<<<<<
 *             kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
 * 
*/
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 317, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_WinDLL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_user32};
        __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 317, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_use_last_error, Py_True, __pyx_t_6, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 317, __pyx_L3_error)
        __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_cur_scope->__pyx_v_user32 = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":318
 *             #  Private DLL handles (not shared with pynput)
 *             user32   = ctypes.WinDLL('user32',   use_last_error=True)
 *             kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)             # <<<<<<<<<<<<<<
 * 
 *             WH_KEYBOARD_LL = 13
*/
      __pyx_t_7 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_WinDLL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        assert(__pyx_t_7);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, __pyx_mstate_global->__pyx_n_u_kernel32};
        __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_use_last_error, Py_True, __pyx_t_6, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 318, __pyx_L3_error)
        __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_v_kernel32 = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":320
 *             kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
 * 
 *             WH_KEYBOARD_LL = 13             # <<<<<<<<<<<<<<
 *             WH_MOUSE_LL    = 14
 *             WM_MOUSEWHEEL  = 0x020A
*/
      __pyx_v_WH_KEYBOARD_LL = 13;

      /* "ws_package/utils/hardware_event_validator.py":321
 * 
 *             WH_KEYBOARD_LL = 13
 *             WH_MOUSE_LL    = 14             # <<<<<<<<<<<<<<
 *             WM_MOUSEWHEEL  = 0x020A
 *             WM_MOUSEHWHEEL = 0x020E
*/
      __pyx_v_WH_MOUSE_LL = 14;

      /* "ws_package/utils/hardware_event_validator.py":322
 *             WH_KEYBOARD_LL = 13
 *             WH_MOUSE_LL    = 14
 *             WM_MOUSEWHEEL  = 0x020A             # <<<<<<<<<<<<<<
 *             WM_MOUSEHWHEEL = 0x020E
 *             WM_KEYDOWN     = 0x0100
*/
      __pyx_cur_scope->__pyx_v_WM_MOUSEWHEEL = 0x020A;

      /* "ws_package/utils/hardware_event_validator.py":323
 *             WH_MOUSE_LL    = 14
 *             WM_MOUSEWHEEL  = 0x020A
 *             WM_MOUSEHWHEEL = 0x020E             # <<<<<<<<<<<<<<
 *             WM_KEYDOWN     = 0x0100
 *             WM_KEYUP       = 0x0101
*/
      __pyx_cur_scope->__pyx_v_WM_MOUSEHWHEEL = 0x020E;

      /* "ws_package/utils/hardware_event_validator.py":324
 *             WM_MOUSEWHEEL  = 0x020A
 *             WM_MOUSEHWHEEL = 0x020E
 *             WM_KEYDOWN     = 0x0100             # <<<<<<<<<<<<<<
 *             WM_KEYUP       = 0x0101
 *             WM_SYSKEYDOWN  = 0x0104
*/
      __pyx_cur_scope->__pyx_v_WM_KEYDOWN = 0x0100;

      /* "ws_package/utils/hardware_event_validator.py":325
 *             WM_MOUSEHWHEEL = 0x020E
 *             WM_KEYDOWN     = 0x0100
 *             WM_KEYUP       = 0x0101             # <<<<<<<<<<<<<<
 *             WM_SYSKEYDOWN  = 0x0104
 *             WM_SYSKEYUP    = 0x0105
*/
      __pyx_cur_scope->__pyx_v_WM_KEYUP = 0x0101;

      /* "ws_package/utils/hardware_event_validator.py":326
 *             WM_KEYDOWN     = 0x0100
 *             WM_KEYUP       = 0x0101
 *             WM_SYSKEYDOWN  = 0x0104             # <<<<<<<<<<<<<<
 *             WM_SYSKEYUP    = 0x0105
 *             LLKHF_INJECTED = 0x00000010
*/
      __pyx_cur_scope->__pyx_v_WM_SYSKEYDOWN = 0x0104;

      /* "ws_package/utils/hardware_event_validator.py":327
 *             WM_KEYUP       = 0x0101
 *             WM_SYSKEYDOWN  = 0x0104
 *             WM_SYSKEYUP    = 0x0105             # <<<<<<<<<<<<<<
 *             LLKHF_INJECTED = 0x00000010
 *             LLMHF_INJECTED = 0x00000001
*/
      __pyx_cur_scope->__pyx_v_WM_SYSKEYUP = 0x0105;

      /* "ws_package/utils/hardware_event_validator.py":328
 *             WM_SYSKEYDOWN  = 0x0104
 *             WM_SYSKEYUP    = 0x0105
 *             LLKHF_INJECTED = 0x00000010             # <<<<<<<<<<<<<<
 *             LLMHF_INJECTED = 0x00000001
 *             HC_ACTION      = 0
*/
      __pyx_cur_scope->__pyx_v_LLKHF_INJECTED = 0x00000010;

      /* "ws_package/utils/hardware_event_validator.py":329
 *             WM_SYSKEYUP    = 0x0105
 *             LLKHF_INJECTED = 0x00000010
 *             LLMHF_INJECTED = 0x00000001             # <<<<<<<<<<<<<<
 *             HC_ACTION      = 0
 * 
*/
      __pyx_cur_scope->__pyx_v_LLMHF_INJECTED = 0x00000001;

      /* "ws_package/utils/hardware_event_validator.py":330
 *             LLKHF_INJECTED = 0x00000010
 *             LLMHF_INJECTED = 0x00000001
 *             HC_ACTION      = 0             # <<<<<<<<<<<<<<
 * 
 *             HOOKPROC = ctypes.WINFUNCTYPE(
*/
      __pyx_cur_scope->__pyx_v_HC_ACTION = 0;

      /* "ws_package/utils/hardware_event_validator.py":332
 *             HC_ACTION      = 0
 * 
 *             HOOKPROC = ctypes.WINFUNCTYPE(             # <<<<<<<<<<<<<<
 *                 ctypes.c_int,
 *                 ctypes.c_int,
*/
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_WINFUNCTYPE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "ws_package/utils/hardware_event_validator.py":333
 * 
 *             HOOKPROC = ctypes.WINFUNCTYPE(
 *                 ctypes.c_int,             # <<<<<<<<<<<<<<
 *                 ctypes.c_int,
 *                 ctypes.wintypes.WPARAM,
*/
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_c_int); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 333, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "ws_package/utils/hardware_event_validator.py":334
 *             HOOKPROC = ctypes.WINFUNCTYPE(
 *                 ctypes.c_int,
 *                 ctypes.c_int,             # <<<<<<<<<<<<<<
 *                 ctypes.wintypes.WPARAM,
 *                 ctypes.wintypes.LPARAM,
*/
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_c_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 334, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "ws_package/utils/hardware_event_validator.py":335
 *                 ctypes.c_int,
 *                 ctypes.c_int,
 *                 ctypes.wintypes.WPARAM,             # <<<<<<<<<<<<<<
 *                 ctypes.wintypes.LPARAM,
 *             )
*/
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 335, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 335, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_WPARAM); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 335, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "ws_package/utils/hardware_event_validator.py":336
 *                 ctypes.c_int,
 *                 ctypes.wintypes.WPARAM,
 *                 ctypes.wintypes.LPARAM,             # <<<<<<<<<<<<<<
 *             )
 * 
*/
      __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 336, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 336, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_LPARAM); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 336, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_t_9, __pyx_t_10, __pyx_t_6, __pyx_t_11};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (5-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_v_HOOKPROC = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":341
 *             # Declare argtypes on OUR private handle  pynput is unaffected.
 *             user32.SetWindowsHookExW.argtypes = [
 *                 ctypes.c_int, HOOKPROC,             # <<<<<<<<<<<<<<
 *                 ctypes.wintypes.HINSTANCE, ctypes.wintypes.DWORD,
 *             ]
*/
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_c_int); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 341, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":342
 *             user32.SetWindowsHookExW.argtypes = [
 *                 ctypes.c_int, HOOKPROC,
 *                 ctypes.wintypes.HINSTANCE, ctypes.wintypes.DWORD,             # <<<<<<<<<<<<<<
 *             ]
 *             user32.SetWindowsHookExW.restype = ctypes.wintypes.HHOOK
*/
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 342, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_HINSTANCE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 342, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_DWORD); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 342, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "ws_package/utils/hardware_event_validator.py":340
 * 
 *             # Declare argtypes on OUR private handle  pynput is unaffected.
 *             user32.SetWindowsHookExW.argtypes = [             # <<<<<<<<<<<<<<
 *                 ctypes.c_int, HOOKPROC,
 *                 ctypes.wintypes.HINSTANCE, ctypes.wintypes.DWORD,
*/
      __pyx_t_6 = PyList_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 340, __pyx_L3_error);
      __Pyx_INCREF(__pyx_v_HOOKPROC);
      __Pyx_GIVEREF(__pyx_v_HOOKPROC);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_v_HOOKPROC) != (0)) __PYX_ERR(0, 340, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_4) != (0)) __PYX_ERR(0, 340, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_11);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 3, __pyx_t_11) != (0)) __PYX_ERR(0, 340, __pyx_L3_error);
      __pyx_t_7 = 0;
      __pyx_t_4 = 0;
      __pyx_t_11 = 0;
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_user32, __pyx_mstate_global->__pyx_n_u_SetWindowsHookExW); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 340, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_argtypes, __pyx_t_6) < (0)) __PYX_ERR(0, 340, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "ws_package/utils/hardware_event_validator.py":344
 *                 ctypes.wintypes.HINSTANCE, ctypes.wintypes.DWORD,
 *             ]
 *             user32.SetWindowsHookExW.restype = ctypes.wintypes.HHOOK             # <<<<<<<<<<<<<<
 * 
 *             user32.CallNextHookEx.argtypes = [
*/
      __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 344, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 344, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_HHOOK); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 344, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_user32, __pyx_mstate_global->__pyx_n_u_SetWindowsHookExW); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 344, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_restype, __pyx_t_11) < (0)) __PYX_ERR(0, 344, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "ws_package/utils/hardware_event_validator.py":347
 * 
 *             user32.CallNextHookEx.argtypes = [
 *                 ctypes.wintypes.HHOOK, ctypes.c_int,             # <<<<<<<<<<<<<<
 *                 ctypes.wintypes.WPARAM, ctypes.wintypes.LPARAM,
 *             ]
*/
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 347, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_HHOOK); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 347, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_c_int); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "ws_package/utils/hardware_event_validator.py":348
 *             user32.CallNextHookEx.argtypes = [
 *                 ctypes.wintypes.HHOOK, ctypes.c_int,
 *                 ctypes.wintypes.WPARAM, ctypes.wintypes.LPARAM,             # <<<<<<<<<<<<<<
 *             ]
 *             user32.CallNextHookEx.restype = ctypes.wintypes.LPARAM
*/
      __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 348, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_WPARAM); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 348, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 348, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_LPARAM); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "ws_package/utils/hardware_event_validator.py":346
 *             user32.SetWindowsHookExW.restype = ctypes.wintypes.HHOOK
 * 
 *             user32.CallNextHookEx.argtypes = [             # <<<<<<<<<<<<<<
 *                 ctypes.wintypes.HHOOK, ctypes.c_int,
 *                 ctypes.wintypes.WPARAM, ctypes.wintypes.LPARAM,
*/
      __pyx_t_10 = PyList_New(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 346, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_6);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 346, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 346, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_11);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 2, __pyx_t_11) != (0)) __PYX_ERR(0, 346, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 3, __pyx_t_7) != (0)) __PYX_ERR(0, 346, __pyx_L3_error);
      __pyx_t_6 = 0;
      __pyx_t_4 = 0;
      __pyx_t_11 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_user32, __pyx_mstate_global->__pyx_n_u_CallNextHookEx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_argtypes, __pyx_t_10) < (0)) __PYX_ERR(0, 346, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":350
 *                 ctypes.wintypes.WPARAM, ctypes.wintypes.LPARAM,
 *             ]
 *             user32.CallNextHookEx.restype = ctypes.wintypes.LPARAM             # <<<<<<<<<<<<<<
 * 
 *             user32.UnhookWindowsHookEx.argtypes = [ctypes.wintypes.HHOOK]
*/
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 350, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 350, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_LPARAM); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 350, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_user32, __pyx_mstate_global->__pyx_n_u_CallNextHookEx); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 350, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_restype, __pyx_t_7) < (0)) __PYX_ERR(0, 350, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "ws_package/utils/hardware_event_validator.py":352
 *             user32.CallNextHookEx.restype = ctypes.wintypes.LPARAM
 * 
 *             user32.UnhookWindowsHookEx.argtypes = [ctypes.wintypes.HHOOK]             # <<<<<<<<<<<<<<
 *             user32.UnhookWindowsHookEx.restype  = ctypes.wintypes.BOOL
 * 
*/
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 352, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_HHOOK); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 352, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_10);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_10) != (0)) __PYX_ERR(0, 352, __pyx_L3_error);
      __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_user32, __pyx_mstate_global->__pyx_n_u_UnhookWindowsHookEx); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 352, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_argtypes, __pyx_t_7) < (0)) __PYX_ERR(0, 352, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "ws_package/utils/hardware_event_validator.py":353
 * 
 *             user32.UnhookWindowsHookEx.argtypes = [ctypes.wintypes.HHOOK]
 *             user32.UnhookWindowsHookEx.restype  = ctypes.wintypes.BOOL             # <<<<<<<<<<<<<<
 * 
 *             kernel32.GetModuleHandleW.argtypes = [ctypes.wintypes.LPCWSTR]
*/
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 353, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_BOOL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 353, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_user32, __pyx_mstate_global->__pyx_n_u_UnhookWindowsHookEx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_restype, __pyx_t_10) < (0)) __PYX_ERR(0, 353, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":355
 *             user32.UnhookWindowsHookEx.restype  = ctypes.wintypes.BOOL
 * 
 *             kernel32.GetModuleHandleW.argtypes = [ctypes.wintypes.LPCWSTR]             # <<<<<<<<<<<<<<
 *             kernel32.GetModuleHandleW.restype  = ctypes.wintypes.HINSTANCE
 * 
*/
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 355, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 355, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_LPCWSTR); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 355, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyList_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 355, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 355, __pyx_L3_error);
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_kernel32, __pyx_mstate_global->__pyx_n_u_GetModuleHandleW); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 355, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_argtypes, __pyx_t_10) < (0)) __PYX_ERR(0, 355, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":356
 * 
 *             kernel32.GetModuleHandleW.argtypes = [ctypes.wintypes.LPCWSTR]
 *             kernel32.GetModuleHandleW.restype  = ctypes.wintypes.HINSTANCE             # <<<<<<<<<<<<<<
 * 
 *             class KBDLLHOOKSTRUCT(ctypes.Structure):
*/
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 356, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 356, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_HINSTANCE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 356, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_kernel32, __pyx_mstate_global->__pyx_n_u_GetModuleHandleW); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 356, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_restype, __pyx_t_7) < (0)) __PYX_ERR(0, 356, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "ws_package/utils/hardware_event_validator.py":358
 *             kernel32.GetModuleHandleW.restype  = ctypes.wintypes.HINSTANCE
 * 
 *             class KBDLLHOOKSTRUCT(ctypes.Structure):             # <<<<<<<<<<<<<<
 *                 _fields_ = [
 *                     ("vkCode",      ctypes.wintypes.DWORD),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 358, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_Structure); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 358, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 358, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 358, __pyx_L3_error);
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PEP560_update_bases(__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 358, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 358, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_7, __pyx_mstate_global->__pyx_n_u_KBDLLHOOKSTRUCT, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__windows, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 358, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__pyx_t_7 != __pyx_t_10) {
        if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_10) < 0))) __PYX_ERR(0, 358, __pyx_L3_error)
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "ws_package/utils/hardware_event_validator.py":360
 *             class KBDLLHOOKSTRUCT(ctypes.Structure):
 *                 _fields_ = [
 *                     ("vkCode",      ctypes.wintypes.DWORD),             # <<<<<<<<<<<<<<
 *                     ("scanCode",    ctypes.wintypes.DWORD),
 *                     ("flags",       ctypes.wintypes.DWORD),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 360, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_DWORD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 360, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_vkCode);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_vkCode);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_mstate_global->__pyx_n_u_vkCode) != (0)) __PYX_ERR(0, 360, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_10);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 360, __pyx_L3_error);
      __pyx_t_10 = 0;

      /* "ws_package/utils/hardware_event_validator.py":361
 *                 _fields_ = [
 *                     ("vkCode",      ctypes.wintypes.DWORD),
 *                     ("scanCode",    ctypes.wintypes.DWORD),             # <<<<<<<<<<<<<<
 *                     ("flags",       ctypes.wintypes.DWORD),
 *                     ("time",        ctypes.wintypes.DWORD),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 361, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_DWORD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 361, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_scanCode);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_scanCode);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_mstate_global->__pyx_n_u_scanCode) != (0)) __PYX_ERR(0, 361, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_10);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 361, __pyx_L3_error);
      __pyx_t_10 = 0;

      /* "ws_package/utils/hardware_event_validator.py":362
 *                     ("vkCode",      ctypes.wintypes.DWORD),
 *                     ("scanCode",    ctypes.wintypes.DWORD),
 *                     ("flags",       ctypes.wintypes.DWORD),             # <<<<<<<<<<<<<<
 *                     ("time",        ctypes.wintypes.DWORD),
 *                     ("dwExtraInfo", ctypes.POINTER(ctypes.wintypes.ULONG)),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 362, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 362, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DWORD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 362, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 362, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_flags);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_flags);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_n_u_flags) != (0)) __PYX_ERR(0, 362, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_10);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 362, __pyx_L3_error);
      __pyx_t_10 = 0;

      /* "ws_package/utils/hardware_event_validator.py":363
 *                     ("scanCode",    ctypes.wintypes.DWORD),
 *                     ("flags",       ctypes.wintypes.DWORD),
 *                     ("time",        ctypes.wintypes.DWORD),             # <<<<<<<<<<<<<<
 *                     ("dwExtraInfo", ctypes.POINTER(ctypes.wintypes.ULONG)),
 *                 ]
*/
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 363, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 363, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DWORD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 363, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 363, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_time);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_time);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_mstate_global->__pyx_n_u_time) != (0)) __PYX_ERR(0, 363, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_10);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 363, __pyx_L3_error);
      __pyx_t_10 = 0;

      /* "ws_package/utils/hardware_event_validator.py":364
 *                     ("flags",       ctypes.wintypes.DWORD),
 *                     ("time",        ctypes.wintypes.DWORD),
 *                     ("dwExtraInfo", ctypes.POINTER(ctypes.wintypes.ULONG)),             # <<<<<<<<<<<<<<
 *                 ]
 * 
*/
      __pyx_t_13 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 364, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_POINTER); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 364, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 364, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 364, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_ULONG); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 364, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_15))) {
        __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_15);
        assert(__pyx_t_13);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_15, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_14};
        __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 364, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_10);
      }
      __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 364, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_dwExtraInfo);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_dwExtraInfo);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_mstate_global->__pyx_n_u_dwExtraInfo) != (0)) __PYX_ERR(0, 364, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_10);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 364, __pyx_L3_error);
      __pyx_t_10 = 0;

      /* "ws_package/utils/hardware_event_validator.py":359
 * 
 *             class KBDLLHOOKSTRUCT(ctypes.Structure):
 *                 _fields_ = [             # <<<<<<<<<<<<<<
 *                     ("vkCode",      ctypes.wintypes.DWORD),
 *                     ("scanCode",    ctypes.wintypes.DWORD),
*/
      __pyx_t_10 = PyList_New(5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 359, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_6);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 359, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_9);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 359, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 2, __pyx_t_5) != (0)) __PYX_ERR(0, 359, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_12);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 3, __pyx_t_12) != (0)) __PYX_ERR(0, 359, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_15);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 4, __pyx_t_15) != (0)) __PYX_ERR(0, 359, __pyx_L3_error);
      __pyx_t_6 = 0;
      __pyx_t_9 = 0;
      __pyx_t_5 = 0;
      __pyx_t_12 = 0;
      __pyx_t_15 = 0;
      if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fields, __pyx_t_10) < (0)) __PYX_ERR(0, 359, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "ws_package/utils/hardware_event_validator.py":358
 *             kernel32.GetModuleHandleW.restype  = ctypes.wintypes.HINSTANCE
 * 
 *             class KBDLLHOOKSTRUCT(ctypes.Structure):             # <<<<<<<<<<<<<<
 *                 _fields_ = [
 *                     ("vkCode",      ctypes.wintypes.DWORD),
*/
      __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_KBDLLHOOKSTRUCT, __pyx_t_7, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 358, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      __pyx_cur_scope->__pyx_v_KBDLLHOOKSTRUCT = __pyx_t_10;
      __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":367
 *                 ]
 * 
 *             class MSLLHOOKSTRUCT(ctypes.Structure):             # <<<<<<<<<<<<<<
 *                 _fields_ = [
 *                     ("pt",          ctypes.wintypes.POINT),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 367, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Structure); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 367, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 367, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_11);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_11) != (0)) __PYX_ERR(0, 367, __pyx_L3_error);
      __pyx_t_11 = 0;
      __pyx_t_11 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 367, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 367, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_11, __pyx_mstate_global->__pyx_n_u_MSLLHOOKSTRUCT, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__windows_2, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, (PyObject *) NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 367, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_11 != __pyx_t_7) {
        if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 367, __pyx_L3_error)
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":369
 *             class MSLLHOOKSTRUCT(ctypes.Structure):
 *                 _fields_ = [
 *                     ("pt",          ctypes.wintypes.POINT),             # <<<<<<<<<<<<<<
 *                     ("mouseData",   ctypes.wintypes.DWORD),
 *                     ("flags",       ctypes.wintypes.DWORD),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 369, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 369, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_POINT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 369, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 369, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_pt);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_pt);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_mstate_global->__pyx_n_u_pt) != (0)) __PYX_ERR(0, 369, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 369, __pyx_L3_error);
      __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":370
 *                 _fields_ = [
 *                     ("pt",          ctypes.wintypes.POINT),
 *                     ("mouseData",   ctypes.wintypes.DWORD),             # <<<<<<<<<<<<<<
 *                     ("flags",       ctypes.wintypes.DWORD),
 *                     ("time",        ctypes.wintypes.DWORD),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 370, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 370, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DWORD); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 370, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 370, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_mouseData);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_mouseData);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_mstate_global->__pyx_n_u_mouseData) != (0)) __PYX_ERR(0, 370, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 370, __pyx_L3_error);
      __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":371
 *                     ("pt",          ctypes.wintypes.POINT),
 *                     ("mouseData",   ctypes.wintypes.DWORD),
 *                     ("flags",       ctypes.wintypes.DWORD),             # <<<<<<<<<<<<<<
 *                     ("time",        ctypes.wintypes.DWORD),
 *                     ("dwExtraInfo", ctypes.POINTER(ctypes.wintypes.ULONG)),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 371, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 371, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DWORD); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 371, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 371, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_flags);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_flags);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_n_u_flags) != (0)) __PYX_ERR(0, 371, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 371, __pyx_L3_error);
      __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":372
 *                     ("mouseData",   ctypes.wintypes.DWORD),
 *                     ("flags",       ctypes.wintypes.DWORD),
 *                     ("time",        ctypes.wintypes.DWORD),             # <<<<<<<<<<<<<<
 *                     ("dwExtraInfo", ctypes.POINTER(ctypes.wintypes.ULONG)),
 *                 ]
*/
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 372, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_DWORD); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 372, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_time);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_time);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_mstate_global->__pyx_n_u_time) != (0)) __PYX_ERR(0, 372, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 372, __pyx_L3_error);
      __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":373
 *                     ("flags",       ctypes.wintypes.DWORD),
 *                     ("time",        ctypes.wintypes.DWORD),
 *                     ("dwExtraInfo", ctypes.POINTER(ctypes.wintypes.ULONG)),             # <<<<<<<<<<<<<<
 *                 ]
 * 
*/
      __pyx_t_6 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 373, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_POINTER); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 373, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 373, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 373, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_ULONG); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 373, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_13);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_14};
        __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 373, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 373, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_dwExtraInfo);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_dwExtraInfo);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_mstate_global->__pyx_n_u_dwExtraInfo) != (0)) __PYX_ERR(0, 373, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 373, __pyx_L3_error);
      __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":368
 * 
 *             class MSLLHOOKSTRUCT(ctypes.Structure):
 *                 _fields_ = [             # <<<<<<<<<<<<<<
 *                     ("pt",          ctypes.wintypes.POINT),
 *                     ("mouseData",   ctypes.wintypes.DWORD),
*/
      __pyx_t_7 = PyList_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 368, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_15);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_15) != (0)) __PYX_ERR(0, 368, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_12);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_12) != (0)) __PYX_ERR(0, 368, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_5) != (0)) __PYX_ERR(0, 368, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_9);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 3, __pyx_t_9) != (0)) __PYX_ERR(0, 368, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_13);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 4, __pyx_t_13) != (0)) __PYX_ERR(0, 368, __pyx_L3_error);
      __pyx_t_15 = 0;
      __pyx_t_12 = 0;
      __pyx_t_5 = 0;
      __pyx_t_9 = 0;
      __pyx_t_13 = 0;
      if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_fields, __pyx_t_7) < (0)) __PYX_ERR(0, 368, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":367
 *                 ]
 * 
 *             class MSLLHOOKSTRUCT(ctypes.Structure):             # <<<<<<<<<<<<<<
 *                 _fields_ = [
 *                     ("pt",          ctypes.wintypes.POINT),
*/
      __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MSLLHOOKSTRUCT, __pyx_t_11, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 367, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_cur_scope->__pyx_v_MSLLHOOKSTRUCT = __pyx_t_7;
      __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "ws_package/utils/hardware_event_validator.py":376
 *                 ]
 * 
 *             def low_level_keyboard_proc(nCode, wParam, lParam):             # <<<<<<<<<<<<<<
 *                 try:
 *                     if nCode >= HC_ACTION:
*/
      __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_1low_level_keyboard_proc, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__windows_3, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 376, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_v_low_level_keyboard_proc = __pyx_t_11;
      __pyx_t_11 = 0;

      /* "ws_package/utils/hardware_event_validator.py":414
 *                 return user32.CallNextHookEx(None, nCode, wParam, lParam)
 * 
 *             def low_level_mouse_proc(nCode, wParam, lParam):             # <<<<<<<<<<<<<<
 *                 try:
 *                     if nCode >= HC_ACTION:
*/
      __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_3low_level_mouse_proc, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__windows_4, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 414, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_v_low_level_mouse_proc = __pyx_t_11;
      __pyx_t_11 = 0;

      /* "ws_package/utils/hardware_event_validator.py":449
 * 
 *             # Keep callbacks alive for the lifetime of the hook.
 *             keyboard_proc = HOOKPROC(low_level_keyboard_proc)             # <<<<<<<<<<<<<<
 *             mouse_proc    = HOOKPROC(low_level_mouse_proc)
 * 
*/
      __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_HOOKPROC);
      __pyx_t_10 = __pyx_v_HOOKPROC; 
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_low_level_keyboard_proc};
        __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 449, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __pyx_v_keyboard_proc = __pyx_t_11;
      __pyx_t_11 = 0;

      /* "ws_package/utils/hardware_event_validator.py":450
 *             # Keep callbacks alive for the lifetime of the hook.
 *             keyboard_proc = HOOKPROC(low_level_keyboard_proc)
 *             mouse_proc    = HOOKPROC(low_level_mouse_proc)             # <<<<<<<<<<<<<<
 * 
 *             hmod = kernel32.GetModuleHandleW(None)
*/
      __pyx_t_10 = NULL;
      __Pyx_INCREF(__pyx_v_HOOKPROC);
      __pyx_t_4 = __pyx_v_HOOKPROC; 
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
        assert(__pyx_t_10);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_low_level_mouse_proc};
        __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 450, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __pyx_v_mouse_proc = __pyx_t_11;
      __pyx_t_11 = 0;

      /* "ws_package/utils/hardware_event_validator.py":452
 *             mouse_proc    = HOOKPROC(low_level_mouse_proc)
 * 
 *             hmod = kernel32.GetModuleHandleW(None)             # <<<<<<<<<<<<<<
 *             # Keyboard-only hook: required to distinguish hardware input from
 *             # SendInput/AutoHotkey and to expose key down/up edges. Mouse remains
*/
      __pyx_t_4 = __pyx_v_kernel32;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, Py_None};
        __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_GetModuleHandleW, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 452, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __pyx_v_hmod = __pyx_t_11;
      __pyx_t_11 = 0;

      /* "ws_package/utils/hardware_event_validator.py":456
 *             # SendInput/AutoHotkey and to expose key down/up edges. Mouse remains
 *             # poll/Raw-Input based and is not part of keyboard fudging detection.
 *             keyboard_hook = user32.SetWindowsHookExW(             # <<<<<<<<<<<<<<
 *                 WH_KEYBOARD_LL, keyboard_proc, hmod, 0,
 *             )
*/
      __pyx_t_4 = __pyx_cur_scope->__pyx_v_user32;
      __Pyx_INCREF(__pyx_t_4);

      /* "ws_package/utils/hardware_event_validator.py":457
 *             # poll/Raw-Input based and is not part of keyboard fudging detection.
 *             keyboard_hook = user32.SetWindowsHookExW(
 *                 WH_KEYBOARD_LL, keyboard_proc, hmod, 0,             # <<<<<<<<<<<<<<
 *             )
 *             mouse_hook = None
*/
      __pyx_t_10 = __Pyx_PyLong_From_long(__pyx_v_WH_KEYBOARD_LL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 457, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[5] = {__pyx_t_4, __pyx_t_10, __pyx_v_keyboard_proc, __pyx_v_hmod, __pyx_mstate_global->__pyx_int_0};
        __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_SetWindowsHookExW, __pyx_callargs+__pyx_t_8, (5-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 456, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __pyx_v_keyboard_hook = __pyx_t_11;
      __pyx_t_11 = 0;

      /* "ws_package/utils/hardware_event_validator.py":459
 *                 WH_KEYBOARD_LL, keyboard_proc, hmod, 0,
 *             )
 *             mouse_hook = None             # <<<<<<<<<<<<<<
 *             if not keyboard_hook:
 *                 logger.warning(
*/
      __Pyx_INCREF(Py_None);
      __pyx_v_mouse_hook = Py_None;

      /* "ws_package/utils/hardware_event_validator.py":460
 *             )
 *             mouse_hook = None
 *             if not keyboard_hook:             # <<<<<<<<<<<<<<
 *                 logger.warning(
 *                     "SetWindowsHookExW(WH_KEYBOARD_LL) failed (error %d)",
*/
      __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_keyboard_hook); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 460, __pyx_L3_error)
      __pyx_t_18 = (!__pyx_t_17);
      if (__pyx_t_18) {

        /* "ws_package/utils/hardware_event_validator.py":461
 *             mouse_hook = None
 *             if not keyboard_hook:
 *                 logger.warning(             # <<<<<<<<<<<<<<
 *                     "SetWindowsHookExW(WH_KEYBOARD_LL) failed (error %d)",
 *                     ctypes.get_last_error(),
*/
        __pyx_t_10 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 461, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 461, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "ws_package/utils/hardware_event_validator.py":463
 *                 logger.warning(
 *                     "SetWindowsHookExW(WH_KEYBOARD_LL) failed (error %d)",
 *                     ctypes.get_last_error(),             # <<<<<<<<<<<<<<
 *                 )
 *                 ok_flag[0] = False
*/
        __pyx_t_13 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 463, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_get_last_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_8 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_5);
          assert(__pyx_t_13);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
          __pyx_t_8 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __pyx_t_8 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
          assert(__pyx_t_10);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
          __pyx_t_8 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_SetWindowsHookExW_WH_KEYBOARD_LL, __pyx_t_4};
          __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 461, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "ws_package/utils/hardware_event_validator.py":465
 *                     ctypes.get_last_error(),
 *                 )
 *                 ok_flag[0] = False             # <<<<<<<<<<<<<<
 *                 ready_event.set()
 *                 return
*/
        if (unlikely((__Pyx_SetItemInt(__pyx_v_ok_flag, 0, Py_False, long, 1, __Pyx_PyLong_From_long, 1, 0, 0, 1, __Pyx_ReferenceSharing_FunctionArgument) < 0))) __PYX_ERR(0, 465, __pyx_L3_error)

        /* "ws_package/utils/hardware_event_validator.py":466
 *                 )
 *                 ok_flag[0] = False
 *                 ready_event.set()             # <<<<<<<<<<<<<<
 *                 return
 *             self._windows_hook_handles['keyboard'] = keyboard_hook
*/
        __pyx_t_7 = __pyx_v_ready_event;
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_8 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
          __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 466, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "ws_package/utils/hardware_event_validator.py":467
 *                 ok_flag[0] = False
 *                 ready_event.set()
 *                 return             # <<<<<<<<<<<<<<
 *             self._windows_hook_handles['keyboard'] = keyboard_hook
 * 
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L7_try_return;

        /* "ws_package/utils/hardware_event_validator.py":460
 *             )
 *             mouse_hook = None
 *             if not keyboard_hook:             # <<<<<<<<<<<<<<
 *                 logger.warning(
 *                     "SetWindowsHookExW(WH_KEYBOARD_LL) failed (error %d)",
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":468
 *                 ready_event.set()
 *                 return
 *             self._windows_hook_handles['keyboard'] = keyboard_hook             # <<<<<<<<<<<<<<
 * 
 *             # Raw Input: physical mice emit WM_INPUT; SetCursorPos / pyautogui.moveTo does not.
*/
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_hook_handles); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 468, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (unlikely((PyObject_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_keyboard, __pyx_v_keyboard_hook) < 0))) __PYX_ERR(0, 468, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "ws_package/utils/hardware_event_validator.py":471
 * 
 *             # Raw Input: physical mice emit WM_INPUT; SetCursorPos / pyautogui.moveTo does not.
 *             RIM_TYPEMOUSE = 0             # <<<<<<<<<<<<<<
 *             RID_INPUT = 0x10000003
 *             RIDEV_INPUTSINK = 0x00000100
*/
      __pyx_cur_scope->__pyx_v_RIM_TYPEMOUSE = 0;

      /* "ws_package/utils/hardware_event_validator.py":472
 *             # Raw Input: physical mice emit WM_INPUT; SetCursorPos / pyautogui.moveTo does not.
 *             RIM_TYPEMOUSE = 0
 *             RID_INPUT = 0x10000003             # <<<<<<<<<<<<<<
 *             RIDEV_INPUTSINK = 0x00000100
 * 
*/
      __pyx_cur_scope->__pyx_v_RID_INPUT = 0x10000003;

      /* "ws_package/utils/hardware_event_validator.py":473
 *             RIM_TYPEMOUSE = 0
 *             RID_INPUT = 0x10000003
 *             RIDEV_INPUTSINK = 0x00000100             # <<<<<<<<<<<<<<
 * 
 *             class RAWINPUTDEVICE(ctypes.Structure):
*/
      __pyx_v_RIDEV_INPUTSINK = 0x00000100;

      /* "ws_package/utils/hardware_event_validator.py":475
 *             RIDEV_INPUTSINK = 0x00000100
 * 
 *             class RAWINPUTDEVICE(ctypes.Structure):             # <<<<<<<<<<<<<<
 *                 _fields_ = [
 *                     ("usUsagePage", ctypes.c_ushort),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 475, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_Structure); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 475, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 475, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 475, __pyx_L3_error);
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PEP560_update_bases(__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 475, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_7, __pyx_mstate_global->__pyx_n_u_RAWINPUTDEVICE, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__windows_5, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, (PyObject *) NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 475, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_7 != __pyx_t_11) {
        if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_t_11) < 0))) __PYX_ERR(0, 475, __pyx_L3_error)
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "ws_package/utils/hardware_event_validator.py":477
 *             class RAWINPUTDEVICE(ctypes.Structure):
 *                 _fields_ = [
 *                     ("usUsagePage", ctypes.c_ushort),             # <<<<<<<<<<<<<<
 *                     ("usUsage", ctypes.c_ushort),
 *                     ("dwFlags", ctypes.wintypes.DWORD),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 477, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_c_ushort); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 477, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 477, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_usUsagePage);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_usUsagePage);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_mstate_global->__pyx_n_u_usUsagePage) != (0)) __PYX_ERR(0, 477, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 477, __pyx_L3_error);
      __pyx_t_5 = 0;

      /* "ws_package/utils/hardware_event_validator.py":478
 *                 _fields_ = [
 *                     ("usUsagePage", ctypes.c_ushort),
 *                     ("usUsage", ctypes.c_ushort),             # <<<<<<<<<<<<<<
 *                     ("dwFlags", ctypes.wintypes.DWORD),
 *                     ("hwndTarget", ctypes.wintypes.HWND),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_c_ushort); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 478, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_usUsage);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_usUsage);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_n_u_usUsage) != (0)) __PYX_ERR(0, 478, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_13);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_13) != (0)) __PYX_ERR(0, 478, __pyx_L3_error);
      __pyx_t_13 = 0;

      /* "ws_package/utils/hardware_event_validator.py":479
 *                     ("usUsagePage", ctypes.c_ushort),
 *                     ("usUsage", ctypes.c_ushort),
 *                     ("dwFlags", ctypes.wintypes.DWORD),             # <<<<<<<<<<<<<<
 *                     ("hwndTarget", ctypes.wintypes.HWND),
 *                 ]
*/
      __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 479, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 479, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_DWORD); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 479, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 479, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_dwFlags);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_dwFlags);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_mstate_global->__pyx_n_u_dwFlags) != (0)) __PYX_ERR(0, 479, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_13);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_13) != (0)) __PYX_ERR(0, 479, __pyx_L3_error);
      __pyx_t_13 = 0;

      /* "ws_package/utils/hardware_event_validator.py":480
 *                     ("usUsage", ctypes.c_ushort),
 *                     ("dwFlags", ctypes.wintypes.DWORD),
 *                     ("hwndTarget", ctypes.wintypes.HWND),             # <<<<<<<<<<<<<<
 *                 ]
 * 
*/
      __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 480, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 480, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_HWND); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 480, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 480, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_hwndTarget);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_hwndTarget);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_mstate_global->__pyx_n_u_hwndTarget) != (0)) __PYX_ERR(0, 480, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_13);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13) != (0)) __PYX_ERR(0, 480, __pyx_L3_error);
      __pyx_t_13 = 0;

      /* "ws_package/utils/hardware_event_validator.py":476
 * 
 *             class RAWINPUTDEVICE(ctypes.Structure):
 *                 _fields_ = [             # <<<<<<<<<<<<<<
 *                     ("usUsagePage", ctypes.c_ushort),
 *                     ("usUsage", ctypes.c_ushort),
*/
      __pyx_t_13 = PyList_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 476, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_11);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_13, 0, __pyx_t_11) != (0)) __PYX_ERR(0, 476, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_13, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 476, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_9);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_13, 2, __pyx_t_9) != (0)) __PYX_ERR(0, 476, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_12);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_13, 3, __pyx_t_12) != (0)) __PYX_ERR(0, 476, __pyx_L3_error);
      __pyx_t_11 = 0;
      __pyx_t_5 = 0;
      __pyx_t_9 = 0;
      __pyx_t_12 = 0;
      if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_fields, __pyx_t_13) < (0)) __PYX_ERR(0, 476, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

      /* "ws_package/utils/hardware_event_validator.py":475
 *             RIDEV_INPUTSINK = 0x00000100
 * 
 *             class RAWINPUTDEVICE(ctypes.Structure):             # <<<<<<<<<<<<<<
 *                 _fields_ = [
 *                     ("usUsagePage", ctypes.c_ushort),
*/
      __pyx_t_13 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_RAWINPUTDEVICE, __pyx_t_7, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 475, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_v_RAWINPUTDEVICE = __pyx_t_13;
      __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":483
 *                 ]
 * 
 *             class RAWINPUTHEADER(ctypes.Structure):             # <<<<<<<<<<<<<<
 *                 _fields_ = [
 *                     ("dwType", ctypes.wintypes.DWORD),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 483, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Structure); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 483, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 483, __pyx_L3_error);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 483, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_13 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_RAWINPUTHEADER, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__windows_6, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, (PyObject *) NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 483, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_13);
      if (__pyx_t_4 != __pyx_t_7) {
        if (unlikely((PyDict_SetItemString(__pyx_t_13, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 483, __pyx_L3_error)
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":485
 *             class RAWINPUTHEADER(ctypes.Structure):
 *                 _fields_ = [
 *                     ("dwType", ctypes.wintypes.DWORD),             # <<<<<<<<<<<<<<
 *                     ("dwSize", ctypes.wintypes.DWORD),
 *                     ("hDevice", ctypes.wintypes.HANDLE),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 485, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 485, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DWORD); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 485, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 485, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_dwType);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_dwType);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_mstate_global->__pyx_n_u_dwType) != (0)) __PYX_ERR(0, 485, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 485, __pyx_L3_error);
      __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":486
 *                 _fields_ = [
 *                     ("dwType", ctypes.wintypes.DWORD),
 *                     ("dwSize", ctypes.wintypes.DWORD),             # <<<<<<<<<<<<<<
 *                     ("hDevice", ctypes.wintypes.HANDLE),
 *                     ("wParam", ctypes.wintypes.WPARAM),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 486, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 486, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_DWORD); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 486, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 486, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_dwSize);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_dwSize);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_mstate_global->__pyx_n_u_dwSize) != (0)) __PYX_ERR(0, 486, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 486, __pyx_L3_error);
      __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":487
 *                     ("dwType", ctypes.wintypes.DWORD),
 *                     ("dwSize", ctypes.wintypes.DWORD),
 *                     ("hDevice", ctypes.wintypes.HANDLE),             # <<<<<<<<<<<<<<
 *                     ("wParam", ctypes.wintypes.WPARAM),
 *                 ]
*/
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 487, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 487, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HANDLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 487, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 487, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_hDevice);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_hDevice);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_n_u_hDevice) != (0)) __PYX_ERR(0, 487, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 487, __pyx_L3_error);
      __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":488
 *                     ("dwSize", ctypes.wintypes.DWORD),
 *                     ("hDevice", ctypes.wintypes.HANDLE),
 *                     ("wParam", ctypes.wintypes.WPARAM),             # <<<<<<<<<<<<<<
 *                 ]
 * 
*/
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 488, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 488, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_WPARAM); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 488, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 488, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_wParam);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_wParam);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_mstate_global->__pyx_n_u_wParam) != (0)) __PYX_ERR(0, 488, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 488, __pyx_L3_error);
      __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":484
 * 
 *             class RAWINPUTHEADER(ctypes.Structure):
 *                 _fields_ = [             # <<<<<<<<<<<<<<
 *                     ("dwType", ctypes.wintypes.DWORD),
 *                     ("dwSize", ctypes.wintypes.DWORD),
*/
      __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 484, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_12);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_12) != (0)) __PYX_ERR(0, 484, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_9);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 484, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_5) != (0)) __PYX_ERR(0, 484, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_11);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 3, __pyx_t_11) != (0)) __PYX_ERR(0, 484, __pyx_L3_error);
      __pyx_t_12 = 0;
      __pyx_t_9 = 0;
      __pyx_t_5 = 0;
      __pyx_t_11 = 0;
      if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_fields, __pyx_t_7) < (0)) __PYX_ERR(0, 484, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":483
 *                 ]
 * 
 *             class RAWINPUTHEADER(ctypes.Structure):             # <<<<<<<<<<<<<<
 *                 _fields_ = [
 *                     ("dwType", ctypes.wintypes.DWORD),
*/
      __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RAWINPUTHEADER, __pyx_t_4, __pyx_t_13, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 483, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_cur_scope->__pyx_v_RAWINPUTHEADER = __pyx_t_7;
      __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":491
 *                 ]
 * 
 *             class RAWMOUSE(ctypes.Structure):             # <<<<<<<<<<<<<<
 *                 _fields_ = [
 *                     ("usFlags", ctypes.c_ushort),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 491, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Structure); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 491, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 491, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_10);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10) != (0)) __PYX_ERR(0, 491, __pyx_L3_error);
      __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 491, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_13 = __Pyx_CalculateMetaclass(NULL, __pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 491, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_13, __pyx_t_10, __pyx_mstate_global->__pyx_n_u_RAWMOUSE, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__windows_7, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 491, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_10 != __pyx_t_4) {
        if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 491, __pyx_L3_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":493
 *             class RAWMOUSE(ctypes.Structure):
 *                 _fields_ = [
 *                     ("usFlags", ctypes.c_ushort),             # <<<<<<<<<<<<<<
 *                     ("usButtonFlags", ctypes.c_ushort),
 *                     ("usButtonData", ctypes.c_ushort),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_c_ushort); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 493, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_usFlags);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_usFlags);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_n_u_usFlags) != (0)) __PYX_ERR(0, 493, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_11);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 493, __pyx_L3_error);
      __pyx_t_11 = 0;

      /* "ws_package/utils/hardware_event_validator.py":494
 *                 _fields_ = [
 *                     ("usFlags", ctypes.c_ushort),
 *                     ("usButtonFlags", ctypes.c_ushort),             # <<<<<<<<<<<<<<
 *                     ("usButtonData", ctypes.c_ushort),
 *                     ("usReserved", ctypes.c_ushort),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 494, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_c_ushort); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 494, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_usButtonFlags);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_usButtonFlags);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_mstate_global->__pyx_n_u_usButtonFlags) != (0)) __PYX_ERR(0, 494, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 494, __pyx_L3_error);
      __pyx_t_5 = 0;

      /* "ws_package/utils/hardware_event_validator.py":495
 *                     ("usFlags", ctypes.c_ushort),
 *                     ("usButtonFlags", ctypes.c_ushort),
 *                     ("usButtonData", ctypes.c_ushort),             # <<<<<<<<<<<<<<
 *                     ("usReserved", ctypes.c_ushort),
 *                     ("ulRawButtons", ctypes.c_ulong),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 495, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_c_ushort); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 495, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 495, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_usButtonData);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_usButtonData);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_n_u_usButtonData) != (0)) __PYX_ERR(0, 495, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_9);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 495, __pyx_L3_error);
      __pyx_t_9 = 0;

      /* "ws_package/utils/hardware_event_validator.py":496
 *                     ("usButtonFlags", ctypes.c_ushort),
 *                     ("usButtonData", ctypes.c_ushort),
 *                     ("usReserved", ctypes.c_ushort),             # <<<<<<<<<<<<<<
 *                     ("ulRawButtons", ctypes.c_ulong),
 *                     ("lLastX", ctypes.c_long),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 496, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_c_ushort); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 496, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 496, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_usReserved);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_usReserved);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_mstate_global->__pyx_n_u_usReserved) != (0)) __PYX_ERR(0, 496, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_12);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_12) != (0)) __PYX_ERR(0, 496, __pyx_L3_error);
      __pyx_t_12 = 0;

      /* "ws_package/utils/hardware_event_validator.py":497
 *                     ("usButtonData", ctypes.c_ushort),
 *                     ("usReserved", ctypes.c_ushort),
 *                     ("ulRawButtons", ctypes.c_ulong),             # <<<<<<<<<<<<<<
 *                     ("lLastX", ctypes.c_long),
 *                     ("lLastY", ctypes.c_long),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 497, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_c_ulong); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 497, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 497, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_ulRawButtons);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_ulRawButtons);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_mstate_global->__pyx_n_u_ulRawButtons) != (0)) __PYX_ERR(0, 497, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_15);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_15) != (0)) __PYX_ERR(0, 497, __pyx_L3_error);
      __pyx_t_15 = 0;

      /* "ws_package/utils/hardware_event_validator.py":498
 *                     ("usReserved", ctypes.c_ushort),
 *                     ("ulRawButtons", ctypes.c_ulong),
 *                     ("lLastX", ctypes.c_long),             # <<<<<<<<<<<<<<
 *                     ("lLastY", ctypes.c_long),
 *                     ("ulExtraInformation", ctypes.c_ulong),
*/
      __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 498, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_c_long); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 498, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 498, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_lLastX);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_lLastX);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_mstate_global->__pyx_n_u_lLastX) != (0)) __PYX_ERR(0, 498, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_14);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_14) != (0)) __PYX_ERR(0, 498, __pyx_L3_error);
      __pyx_t_14 = 0;

      /* "ws_package/utils/hardware_event_validator.py":499
 *                     ("ulRawButtons", ctypes.c_ulong),
 *                     ("lLastX", ctypes.c_long),
 *                     ("lLastY", ctypes.c_long),             # <<<<<<<<<<<<<<
 *                     ("ulExtraInformation", ctypes.c_ulong),
 *                 ]
*/
      __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 499, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_c_long); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 499, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 499, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_lLastY);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_lLastY);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_mstate_global->__pyx_n_u_lLastY) != (0)) __PYX_ERR(0, 499, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_6);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 499, __pyx_L3_error);
      __pyx_t_6 = 0;

      /* "ws_package/utils/hardware_event_validator.py":500
 *                     ("lLastX", ctypes.c_long),
 *                     ("lLastY", ctypes.c_long),
 *                     ("ulExtraInformation", ctypes.c_ulong),             # <<<<<<<<<<<<<<
 *                 ]
 * 
*/
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 500, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_c_ulong); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 500, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 500, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_ulExtraInformation);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_ulExtraInformation);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_mstate_global->__pyx_n_u_ulExtraInformation) != (0)) __PYX_ERR(0, 500, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_16);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_16) != (0)) __PYX_ERR(0, 500, __pyx_L3_error);
      __pyx_t_16 = 0;

      /* "ws_package/utils/hardware_event_validator.py":492
 * 
 *             class RAWMOUSE(ctypes.Structure):
 *                 _fields_ = [             # <<<<<<<<<<<<<<
 *                     ("usFlags", ctypes.c_ushort),
 *                     ("usButtonFlags", ctypes.c_ushort),
*/
      __pyx_t_16 = PyList_New(8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 492, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 492, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_11);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 492, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 2, __pyx_t_5) != (0)) __PYX_ERR(0, 492, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_9);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 3, __pyx_t_9) != (0)) __PYX_ERR(0, 492, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_12);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 4, __pyx_t_12) != (0)) __PYX_ERR(0, 492, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_15);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 5, __pyx_t_15) != (0)) __PYX_ERR(0, 492, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_14);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 6, __pyx_t_14) != (0)) __PYX_ERR(0, 492, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_6);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 7, __pyx_t_6) != (0)) __PYX_ERR(0, 492, __pyx_L3_error);
      __pyx_t_4 = 0;
      __pyx_t_11 = 0;
      __pyx_t_5 = 0;
      __pyx_t_9 = 0;
      __pyx_t_12 = 0;
      __pyx_t_15 = 0;
      __pyx_t_14 = 0;
      __pyx_t_6 = 0;
      if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_fields, __pyx_t_16) < (0)) __PYX_ERR(0, 492, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

      /* "ws_package/utils/hardware_event_validator.py":491
 *                 ]
 * 
 *             class RAWMOUSE(ctypes.Structure):             # <<<<<<<<<<<<<<
 *                 _fields_ = [
 *                     ("usFlags", ctypes.c_ushort),
*/
      __pyx_t_16 = __Pyx_Py3ClassCreate(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_RAWMOUSE, __pyx_t_10, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 491, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      __pyx_cur_scope->__pyx_v_RAWMOUSE = __pyx_t_16;
      __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "ws_package/utils/hardware_event_validator.py":504
 * 
 *             user32.GetRawInputData.argtypes = [
 *                 ctypes.wintypes.LPARAM, ctypes.wintypes.UINT,             # <<<<<<<<<<<<<<
 *                 ctypes.c_void_p, ctypes.POINTER(ctypes.wintypes.UINT),
 *                 ctypes.wintypes.UINT,
*/
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 504, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 504, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_LPARAM); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 504, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 504, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 504, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_UINT); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 504, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":505
 *             user32.GetRawInputData.argtypes = [
 *                 ctypes.wintypes.LPARAM, ctypes.wintypes.UINT,
 *                 ctypes.c_void_p, ctypes.POINTER(ctypes.wintypes.UINT),             # <<<<<<<<<<<<<<
 *                 ctypes.wintypes.UINT,
 *             ]
*/
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_c_void_p); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 505, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_6 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 505, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_POINTER); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 505, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 505, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 505, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_UINT); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 505, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_15))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_15);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_15, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_14};
        __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
      }

      /* "ws_package/utils/hardware_event_validator.py":506
 *                 ctypes.wintypes.LPARAM, ctypes.wintypes.UINT,
 *                 ctypes.c_void_p, ctypes.POINTER(ctypes.wintypes.UINT),
 *                 ctypes.wintypes.UINT,             # <<<<<<<<<<<<<<
 *             ]
 *             user32.GetRawInputData.restype = ctypes.wintypes.UINT
*/
      __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 506, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 506, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_UINT); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 506, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "ws_package/utils/hardware_event_validator.py":503
 *                 ]
 * 
 *             user32.GetRawInputData.argtypes = [             # <<<<<<<<<<<<<<
 *                 ctypes.wintypes.LPARAM, ctypes.wintypes.UINT,
 *                 ctypes.c_void_p, ctypes.POINTER(ctypes.wintypes.UINT),
*/
      __pyx_t_14 = PyList_New(5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 503, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_10);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 0, __pyx_t_10) != (0)) __PYX_ERR(0, 503, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_13);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 1, __pyx_t_13) != (0)) __PYX_ERR(0, 503, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_16);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 2, __pyx_t_16) != (0)) __PYX_ERR(0, 503, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 3, __pyx_t_7) != (0)) __PYX_ERR(0, 503, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_15);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 4, __pyx_t_15) != (0)) __PYX_ERR(0, 503, __pyx_L3_error);
      __pyx_t_10 = 0;
      __pyx_t_13 = 0;
      __pyx_t_16 = 0;
      __pyx_t_7 = 0;
      __pyx_t_15 = 0;
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_user32, __pyx_mstate_global->__pyx_n_u_GetRawInputData); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 503, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_15);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_argtypes, __pyx_t_14) < (0)) __PYX_ERR(0, 503, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

      /* "ws_package/utils/hardware_event_validator.py":508
 *                 ctypes.wintypes.UINT,
 *             ]
 *             user32.GetRawInputData.restype = ctypes.wintypes.UINT             # <<<<<<<<<<<<<<
 *             _raw_input_header_size = ctypes.sizeof(RAWINPUTHEADER)
 * 
*/
      __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 508, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 508, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_UINT); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 508, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_user32, __pyx_mstate_global->__pyx_n_u_GetRawInputData); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 508, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_14);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_restype, __pyx_t_15) < (0)) __PYX_ERR(0, 508, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "ws_package/utils/hardware_event_validator.py":509
 *             ]
 *             user32.GetRawInputData.restype = ctypes.wintypes.UINT
 *             _raw_input_header_size = ctypes.sizeof(RAWINPUTHEADER)             # <<<<<<<<<<<<<<
 * 
 *             def record_raw_mouse_input(lParam):
*/
      __pyx_t_15 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 509, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_sizeof); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 509, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_16))) {
        __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_16);
        assert(__pyx_t_15);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
        __Pyx_INCREF(__pyx_t_15);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_cur_scope->__pyx_v_RAWINPUTHEADER};
        __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 509, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_14);
      }
      __Pyx_GIVEREF(__pyx_t_14);
      __pyx_cur_scope->__pyx_v__raw_input_header_size = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "ws_package/utils/hardware_event_validator.py":511
 *             _raw_input_header_size = ctypes.sizeof(RAWINPUTHEADER)
 * 
 *             def record_raw_mouse_input(lParam):             # <<<<<<<<<<<<<<
 *                 try:
 *                     size = ctypes.wintypes.UINT(0)
*/
      __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_5record_raw_mouse_input, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__windows_8, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 511, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_v_record_raw_mouse_input = __pyx_t_14;
      __pyx_t_14 = 0;

      /* "ws_package/utils/hardware_event_validator.py":541
 *                     pass
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 user32.RegisterRawInputDevices.argtypes = [
 *                     ctypes.POINTER(RAWINPUTDEVICE), ctypes.wintypes.UINT, ctypes.wintypes.UINT,
*/
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
        __Pyx_XGOTREF(__pyx_t_19);
        __Pyx_XGOTREF(__pyx_t_20);
        __Pyx_XGOTREF(__pyx_t_21);
        /*try:*/ {

          /* "ws_package/utils/hardware_event_validator.py":543
 *             try:
 *                 user32.RegisterRawInputDevices.argtypes = [
 *                     ctypes.POINTER(RAWINPUTDEVICE), ctypes.wintypes.UINT, ctypes.wintypes.UINT,             # <<<<<<<<<<<<<<
 *                 ]
 *                 user32.RegisterRawInputDevices.restype = ctypes.wintypes.BOOL
*/
          __pyx_t_16 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 543, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_POINTER); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 543, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __pyx_t_8 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_7);
            assert(__pyx_t_16);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_16);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
            __pyx_t_8 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_v_RAWINPUTDEVICE};
            __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 543, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_14);
          }
          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 543, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 543, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_UINT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 543, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 543, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 543, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_UINT); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 543, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

          /* "ws_package/utils/hardware_event_validator.py":542
 * 
 *             try:
 *                 user32.RegisterRawInputDevices.argtypes = [             # <<<<<<<<<<<<<<
 *                     ctypes.POINTER(RAWINPUTDEVICE), ctypes.wintypes.UINT, ctypes.wintypes.UINT,
 *                 ]
*/
          __pyx_t_15 = PyList_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 542, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_GIVEREF(__pyx_t_14);
          if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 0, __pyx_t_14) != (0)) __PYX_ERR(0, 542, __pyx_L10_error);
          __Pyx_GIVEREF(__pyx_t_7);
          if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 542, __pyx_L10_error);
          __Pyx_GIVEREF(__pyx_t_16);
          if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 2, __pyx_t_16) != (0)) __PYX_ERR(0, 542, __pyx_L10_error);
          __pyx_t_14 = 0;
          __pyx_t_7 = 0;
          __pyx_t_16 = 0;
          __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_user32, __pyx_mstate_global->__pyx_n_u_RegisterRawInputDevices); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 542, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_16);
          if (__Pyx_PyObject_SetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_argtypes, __pyx_t_15) < (0)) __PYX_ERR(0, 542, __pyx_L10_error)
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

          /* "ws_package/utils/hardware_event_validator.py":545
 *                     ctypes.POINTER(RAWINPUTDEVICE), ctypes.wintypes.UINT, ctypes.wintypes.UINT,
 *                 ]
 *                 user32.RegisterRawInputDevices.restype = ctypes.wintypes.BOOL             # <<<<<<<<<<<<<<
 *                 rdi = RAWINPUTDEVICE(0x01, 0x02, RIDEV_INPUTSINK, None)
 *                 if user32.RegisterRawInputDevices(
*/
          __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 545, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 545, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_BOOL); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 545, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_user32, __pyx_mstate_global->__pyx_n_u_RegisterRawInputDevices); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 545, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_15);
          if (__Pyx_PyObject_SetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_restype, __pyx_t_16) < (0)) __PYX_ERR(0, 545, __pyx_L10_error)
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

          /* "ws_package/utils/hardware_event_validator.py":546
 *                 ]
 *                 user32.RegisterRawInputDevices.restype = ctypes.wintypes.BOOL
 *                 rdi = RAWINPUTDEVICE(0x01, 0x02, RIDEV_INPUTSINK, None)             # <<<<<<<<<<<<<<
 *                 if user32.RegisterRawInputDevices(
 *                     ctypes.byref(rdi), 1, ctypes.sizeof(RAWINPUTDEVICE),
*/
          __pyx_t_15 = __Pyx_PyLong_From_long(__pyx_v_RIDEV_INPUTSINK); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 546, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_16 = PyTuple_New(4); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 546, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 546, __pyx_L10_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_mstate_global->__pyx_int_2) != (0)) __PYX_ERR(0, 546, __pyx_L10_error);
          __Pyx_GIVEREF(__pyx_t_15);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_15) != (0)) __PYX_ERR(0, 546, __pyx_L10_error);
          __Pyx_INCREF(Py_None);
          __Pyx_GIVEREF(Py_None);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 3, Py_None) != (0)) __PYX_ERR(0, 546, __pyx_L10_error);
          __pyx_t_15 = 0;
          __pyx_t_15 = __Pyx_PyObject_Call(__pyx_v_RAWINPUTDEVICE, __pyx_t_16, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 546, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __pyx_v_rdi = __pyx_t_15;
          __pyx_t_15 = 0;

          /* "ws_package/utils/hardware_event_validator.py":547
 *                 user32.RegisterRawInputDevices.restype = ctypes.wintypes.BOOL
 *                 rdi = RAWINPUTDEVICE(0x01, 0x02, RIDEV_INPUTSINK, None)
 *                 if user32.RegisterRawInputDevices(             # <<<<<<<<<<<<<<
 *                     ctypes.byref(rdi), 1, ctypes.sizeof(RAWINPUTDEVICE),
 *                 ):
*/
          __pyx_t_16 = __pyx_cur_scope->__pyx_v_user32;
          __Pyx_INCREF(__pyx_t_16);

          /* "ws_package/utils/hardware_event_validator.py":548
 *                 rdi = RAWINPUTDEVICE(0x01, 0x02, RIDEV_INPUTSINK, None)
 *                 if user32.RegisterRawInputDevices(
 *                     ctypes.byref(rdi), 1, ctypes.sizeof(RAWINPUTDEVICE),             # <<<<<<<<<<<<<<
 *                 ):
 *                     self._windows_raw_input_active = True
*/
          __pyx_t_14 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 548, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_byref); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 548, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_8 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_10))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_10);
            assert(__pyx_t_14);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
            __pyx_t_8 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_rdi};
            __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 548, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_7);
          }
          __pyx_t_14 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 548, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_sizeof); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 548, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_8 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_6);
            assert(__pyx_t_14);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
            __pyx_t_8 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_RAWINPUTDEVICE};
            __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 548, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_10);
          }
          __pyx_t_8 = 0;
          {
            PyObject *__pyx_callargs[4] = {__pyx_t_16, __pyx_t_7, __pyx_mstate_global->__pyx_int_1, __pyx_t_10};
            __pyx_t_15 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_RegisterRawInputDevices, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 547, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_15);
          }

          /* "ws_package/utils/hardware_event_validator.py":547
 *                 user32.RegisterRawInputDevices.restype = ctypes.wintypes.BOOL
 *                 rdi = RAWINPUTDEVICE(0x01, 0x02, RIDEV_INPUTSINK, None)
 *                 if user32.RegisterRawInputDevices(             # <<<<<<<<<<<<<<
 *                     ctypes.byref(rdi), 1, ctypes.sizeof(RAWINPUTDEVICE),
 *                 ):
*/
          __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 547, __pyx_L10_error)
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (__pyx_t_18) {

            /* "ws_package/utils/hardware_event_validator.py":550
 *                     ctypes.byref(rdi), 1, ctypes.sizeof(RAWINPUTDEVICE),
 *                 ):
 *                     self._windows_raw_input_active = True             # <<<<<<<<<<<<<<
 *                     logger.debug("Windows Raw Input mouse sink registered")
 *                 else:
*/
            if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_raw_input_active, Py_True) < (0)) __PYX_ERR(0, 550, __pyx_L10_error)

            /* "ws_package/utils/hardware_event_validator.py":551
 *                 ):
 *                     self._windows_raw_input_active = True
 *                     logger.debug("Windows Raw Input mouse sink registered")             # <<<<<<<<<<<<<<
 *                 else:
 *                     logger.debug(
*/
            __pyx_t_10 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 551, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 551, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_8 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_16))) {
              __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_16);
              assert(__pyx_t_10);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
              __pyx_t_8 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_Windows_Raw_Input_mouse_sink_reg};
              __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
              if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 551, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_15);
            }
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

            /* "ws_package/utils/hardware_event_validator.py":547
 *                 user32.RegisterRawInputDevices.restype = ctypes.wintypes.BOOL
 *                 rdi = RAWINPUTDEVICE(0x01, 0x02, RIDEV_INPUTSINK, None)
 *                 if user32.RegisterRawInputDevices(             # <<<<<<<<<<<<<<
 *                     ctypes.byref(rdi), 1, ctypes.sizeof(RAWINPUTDEVICE),
 *                 ):
*/
            goto __pyx_L16;
          }

          /* "ws_package/utils/hardware_event_validator.py":553
 *                     logger.debug("Windows Raw Input mouse sink registered")
 *                 else:
 *                     logger.debug(             # <<<<<<<<<<<<<<
 *                         "RegisterRawInputDevices failed (error %d)",
 *                         ctypes.get_last_error(),
*/
          /*else*/ {
            __pyx_t_16 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 553, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 553, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

            /* "ws_package/utils/hardware_event_validator.py":555
 *                     logger.debug(
 *                         "RegisterRawInputDevices failed (error %d)",
 *                         ctypes.get_last_error(),             # <<<<<<<<<<<<<<
 *                     )
 *             except Exception as e:
*/
            __pyx_t_6 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 555, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_get_last_error); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 555, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_t_8 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_13))) {
              __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_13);
              assert(__pyx_t_6);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
              __Pyx_INCREF(__pyx_t_6);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
              __pyx_t_8 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
              __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 555, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_10);
            }
            __pyx_t_8 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_7))) {
              __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_7);
              assert(__pyx_t_16);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
              __Pyx_INCREF(__pyx_t_16);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
              __pyx_t_8 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_mstate_global->__pyx_kp_u_RegisterRawInputDevices_failed_e, __pyx_t_10};
              __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 553, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_15);
            }
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          }
          __pyx_L16:;

          /* "ws_package/utils/hardware_event_validator.py":541
 *                     pass
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 user32.RegisterRawInputDevices.argtypes = [
 *                     ctypes.POINTER(RAWINPUTDEVICE), ctypes.wintypes.UINT, ctypes.wintypes.UINT,
*/
        }
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
        goto __pyx_L15_try_end;
        __pyx_L10_error:;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "ws_package/utils/hardware_event_validator.py":557
 *                         ctypes.get_last_error(),
 *                     )
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 logger.debug("Windows Raw Input setup failed: %s", e)
 * 
*/
        __pyx_t_22 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
        if (__pyx_t_22) {
          __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._windows_hook_thread", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_15, &__pyx_t_7, &__pyx_t_10) < 0) __PYX_ERR(0, 557, __pyx_L12_except_error)
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_7);
          __pyx_v_e = __pyx_t_7;
          /*try:*/ {

            /* "ws_package/utils/hardware_event_validator.py":558
 *                     )
 *             except Exception as e:
 *                 logger.debug("Windows Raw Input setup failed: %s", e)             # <<<<<<<<<<<<<<
 * 
 *             if not self._windows_raw_input_active:
*/
            __pyx_t_13 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 558, __pyx_L22_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 558, __pyx_L22_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_8 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_14))) {
              __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
              assert(__pyx_t_13);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
              __pyx_t_8 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_mstate_global->__pyx_kp_u_Windows_Raw_Input_setup_failed_s, __pyx_v_e};
              __pyx_t_16 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 558, __pyx_L22_error)
              __Pyx_GOTREF(__pyx_t_16);
            }
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          }

          /* "ws_package/utils/hardware_event_validator.py":557
 *                         ctypes.get_last_error(),
 *                     )
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 logger.debug("Windows Raw Input setup failed: %s", e)
 * 
*/
          /*finally:*/ {
            /*normal exit:*/{
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              goto __pyx_L23;
            }
            __pyx_L22_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0; __pyx_t_30 = 0;
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
               __Pyx_ExceptionSwap(&__pyx_t_28, &__pyx_t_29, &__pyx_t_30);
              if ( unlikely(__Pyx_GetException(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27) < 0)) __Pyx_ErrFetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
              __Pyx_XGOTREF(__pyx_t_25);
              __Pyx_XGOTREF(__pyx_t_26);
              __Pyx_XGOTREF(__pyx_t_27);
              __Pyx_XGOTREF(__pyx_t_28);
              __Pyx_XGOTREF(__pyx_t_29);
              __Pyx_XGOTREF(__pyx_t_30);
              __pyx_t_22 = __pyx_lineno; __pyx_t_23 = __pyx_clineno; __pyx_t_24 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              }
              __Pyx_XGIVEREF(__pyx_t_28);
              __Pyx_XGIVEREF(__pyx_t_29);
              __Pyx_XGIVEREF(__pyx_t_30);
              __Pyx_ExceptionReset(__pyx_t_28, __pyx_t_29, __pyx_t_30);
              __Pyx_XGIVEREF(__pyx_t_25);
              __Pyx_XGIVEREF(__pyx_t_26);
              __Pyx_XGIVEREF(__pyx_t_27);
              __Pyx_ErrRestore(__pyx_t_25, __pyx_t_26, __pyx_t_27);
              __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0; __pyx_t_30 = 0;
              __pyx_lineno = __pyx_t_22; __pyx_clineno = __pyx_t_23; __pyx_filename = __pyx_t_24;
              goto __pyx_L12_except_error;
            }
            __pyx_L23:;
          }
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          goto __pyx_L11_exception_handled;
        }
        goto __pyx_L12_except_error;

        /* "ws_package/utils/hardware_event_validator.py":541
 *                     pass
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 user32.RegisterRawInputDevices.argtypes = [
 *                     ctypes.POINTER(RAWINPUTDEVICE), ctypes.wintypes.UINT, ctypes.wintypes.UINT,
*/
        __pyx_L12_except_error:;
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_XGIVEREF(__pyx_t_21);
        __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
        goto __pyx_L3_error;
        __pyx_L11_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_XGIVEREF(__pyx_t_21);
        __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
        __pyx_L15_try_end:;
      }

      /* "ws_package/utils/hardware_event_validator.py":560
 *                 logger.debug("Windows Raw Input setup failed: %s", e)
 * 
 *             if not self._windows_raw_input_active:             # <<<<<<<<<<<<<<
 *                 logger.warning(
 *                     "Windows Raw Input mouse sink unavailable (error %d); "
*/
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_raw_input_active); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 560, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 560, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_17 = (!__pyx_t_18);
      if (__pyx_t_17) {

        /* "ws_package/utils/hardware_event_validator.py":561
 * 
 *             if not self._windows_raw_input_active:
 *                 logger.warning(             # <<<<<<<<<<<<<<
 *                     "Windows Raw Input mouse sink unavailable (error %d); "
 *                     "keyboard validation remains active",
*/
        __pyx_t_7 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 561, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 561, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

        /* "ws_package/utils/hardware_event_validator.py":564
 *                     "Windows Raw Input mouse sink unavailable (error %d); "
 *                     "keyboard validation remains active",
 *                     ctypes.get_last_error(),             # <<<<<<<<<<<<<<
 *                 )
 * 
*/
        __pyx_t_14 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 564, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_get_last_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 564, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_8 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_6);
          assert(__pyx_t_14);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
          __pyx_t_8 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL};
          __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 564, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_15);
        }
        __pyx_t_8 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_16))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_16);
          assert(__pyx_t_7);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
          __pyx_t_8 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_Windows_Raw_Input_mouse_sink_una, __pyx_t_15};
          __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 561, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
        }
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "ws_package/utils/hardware_event_validator.py":560
 *                 logger.debug("Windows Raw Input setup failed: %s", e)
 * 
 *             if not self._windows_raw_input_active:             # <<<<<<<<<<<<<<
 *                 logger.warning(
 *                     "Windows Raw Input mouse sink unavailable (error %d); "
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":568
 * 
 *             self._windows_hooks = {
 *                 'user32': user32,             # <<<<<<<<<<<<<<
 *                 'kernel32': kernel32,
 *                 'keyboard_proc': keyboard_proc,
*/
      __pyx_t_10 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 568, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_user32, __pyx_cur_scope->__pyx_v_user32) < (0)) __PYX_ERR(0, 568, __pyx_L3_error)

      /* "ws_package/utils/hardware_event_validator.py":569
 *             self._windows_hooks = {
 *                 'user32': user32,
 *                 'kernel32': kernel32,             # <<<<<<<<<<<<<<
 *                 'keyboard_proc': keyboard_proc,
 *                 'mouse_proc': mouse_proc,
*/
      if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_kernel32, __pyx_v_kernel32) < (0)) __PYX_ERR(0, 568, __pyx_L3_error)

      /* "ws_package/utils/hardware_event_validator.py":570
 *                 'user32': user32,
 *                 'kernel32': kernel32,
 *                 'keyboard_proc': keyboard_proc,             # <<<<<<<<<<<<<<
 *                 'mouse_proc': mouse_proc,
 *             }
*/
      if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_keyboard_proc, __pyx_v_keyboard_proc) < (0)) __PYX_ERR(0, 568, __pyx_L3_error)

      /* "ws_package/utils/hardware_event_validator.py":571
 *                 'kernel32': kernel32,
 *                 'keyboard_proc': keyboard_proc,
 *                 'mouse_proc': mouse_proc,             # <<<<<<<<<<<<<<
 *             }
 *             ok_flag[0] = True
*/
      if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_mouse_proc, __pyx_v_mouse_proc) < (0)) __PYX_ERR(0, 568, __pyx_L3_error)

      /* "ws_package/utils/hardware_event_validator.py":567
 *                 )
 * 
 *             self._windows_hooks = {             # <<<<<<<<<<<<<<
 *                 'user32': user32,
 *                 'kernel32': kernel32,
*/
      if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_hooks, __pyx_t_10) < (0)) __PYX_ERR(0, 567, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "ws_package/utils/hardware_event_validator.py":573
 *                 'mouse_proc': mouse_proc,
 *             }
 *             ok_flag[0] = True             # <<<<<<<<<<<<<<
 *             ready_event.set()
 *             logger.info(
*/
      if (unlikely((__Pyx_SetItemInt(__pyx_v_ok_flag, 0, Py_True, long, 1, __Pyx_PyLong_From_long, 1, 0, 0, 1, __Pyx_ReferenceSharing_FunctionArgument) < 0))) __PYX_ERR(0, 573, __pyx_L3_error)

      /* "ws_package/utils/hardware_event_validator.py":574
 *             }
 *             ok_flag[0] = True
 *             ready_event.set()             # <<<<<<<<<<<<<<
 *             logger.info(
 *                 "Windows keyboard hardware validation active "
*/
      __pyx_t_16 = __pyx_v_ready_event;
      __Pyx_INCREF(__pyx_t_16);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_16, NULL};
        __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 574, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "ws_package/utils/hardware_event_validator.py":575
 *             ok_flag[0] = True
 *             ready_event.set()
 *             logger.info(             # <<<<<<<<<<<<<<
 *                 "Windows keyboard hardware validation active "
 *                 "(WH_KEYBOARD_LL; injected keys excluded)"
*/
      __pyx_t_16 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 575, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_info); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 575, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_7);
        assert(__pyx_t_16);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_16);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_mstate_global->__pyx_kp_u_Windows_keyboard_hardware_valida};
        __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 575, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "ws_package/utils/hardware_event_validator.py":581
 * 
 *             user32.GetMessageW.argtypes = [
 *                 ctypes.POINTER(ctypes.wintypes.MSG),             # <<<<<<<<<<<<<<
 *                 ctypes.wintypes.HWND,
 *                 ctypes.wintypes.UINT,
*/
      __pyx_t_7 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 581, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_POINTER); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 581, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 581, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 581, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_MSG); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 581, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_15))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_15);
        assert(__pyx_t_7);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_15, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_16};
        __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 581, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_10);
      }

      /* "ws_package/utils/hardware_event_validator.py":582
 *             user32.GetMessageW.argtypes = [
 *                 ctypes.POINTER(ctypes.wintypes.MSG),
 *                 ctypes.wintypes.HWND,             # <<<<<<<<<<<<<<
 *                 ctypes.wintypes.UINT,
 *                 ctypes.wintypes.UINT,
*/
      __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 582, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 582, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_HWND); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 582, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

      /* "ws_package/utils/hardware_event_validator.py":583
 *                 ctypes.POINTER(ctypes.wintypes.MSG),
 *                 ctypes.wintypes.HWND,
 *                 ctypes.wintypes.UINT,             # <<<<<<<<<<<<<<
 *                 ctypes.wintypes.UINT,
 *             ]
*/
      __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 583, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 583, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_UINT); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 583, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":584
 *                 ctypes.wintypes.HWND,
 *                 ctypes.wintypes.UINT,
 *                 ctypes.wintypes.UINT,             # <<<<<<<<<<<<<<
 *             ]
 *             user32.GetMessageW.restype = ctypes.c_int
*/
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 584, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_UINT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 584, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "ws_package/utils/hardware_event_validator.py":580
 *             )
 * 
 *             user32.GetMessageW.argtypes = [             # <<<<<<<<<<<<<<
 *                 ctypes.POINTER(ctypes.wintypes.MSG),
 *                 ctypes.wintypes.HWND,
*/
      __pyx_t_6 = PyList_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_10);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_10) != (0)) __PYX_ERR(0, 580, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_15);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_15) != (0)) __PYX_ERR(0, 580, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_16);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_16) != (0)) __PYX_ERR(0, 580, __pyx_L3_error);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 3, __pyx_t_7) != (0)) __PYX_ERR(0, 580, __pyx_L3_error);
      __pyx_t_10 = 0;
      __pyx_t_15 = 0;
      __pyx_t_16 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_user32, __pyx_mstate_global->__pyx_n_u_GetMessageW); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 580, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_argtypes, __pyx_t_6) < (0)) __PYX_ERR(0, 580, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":586
 *                 ctypes.wintypes.UINT,
 *             ]
 *             user32.GetMessageW.restype = ctypes.c_int             # <<<<<<<<<<<<<<
 * 
 *             #  Message pump (runs on THIS thread  same as hook installation)
*/
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 586, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_c_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 586, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_user32, __pyx_mstate_global->__pyx_n_u_GetMessageW); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 586, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_restype, __pyx_t_6) < (0)) __PYX_ERR(0, 586, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":590
 *             #  Message pump (runs on THIS thread  same as hook installation)
 *             # Blocking GetMessageW avoids the old PeekMessage + 510 ms spin loop.
 *             msg = ctypes.wintypes.MSG()             # <<<<<<<<<<<<<<
 *             while not self._stop_hooks:
 *                 try:
*/
      __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 590, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_wintypes); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 590, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_6 = __pyx_t_15;
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_MSG, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 590, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_v_msg = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":591
 *             # Blocking GetMessageW avoids the old PeekMessage + 510 ms spin loop.
 *             msg = ctypes.wintypes.MSG()
 *             while not self._stop_hooks:             # <<<<<<<<<<<<<<
 *                 try:
 *                     ret = user32.GetMessageW(ctypes.byref(msg), None, 0, 0)
*/
      while (1) {
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_stop_hooks); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 591, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 591, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_18 = (!__pyx_t_17);
        if (!__pyx_t_18) break;

        /* "ws_package/utils/hardware_event_validator.py":592
 *             msg = ctypes.wintypes.MSG()
 *             while not self._stop_hooks:
 *                 try:             # <<<<<<<<<<<<<<
 *                     ret = user32.GetMessageW(ctypes.byref(msg), None, 0, 0)
 *                     if ret in (0, -1):
*/
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_19);
          /*try:*/ {

            /* "ws_package/utils/hardware_event_validator.py":593
 *             while not self._stop_hooks:
 *                 try:
 *                     ret = user32.GetMessageW(ctypes.byref(msg), None, 0, 0)             # <<<<<<<<<<<<<<
 *                     if ret in (0, -1):
 *                         break
*/
            __pyx_t_15 = __pyx_cur_scope->__pyx_v_user32;
            __Pyx_INCREF(__pyx_t_15);
            __pyx_t_16 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 593, __pyx_L31_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_byref); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 593, __pyx_L31_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __pyx_t_8 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_14))) {
              __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_14);
              assert(__pyx_t_16);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_16);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
              __pyx_t_8 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_v_msg};
              __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 593, __pyx_L31_error)
              __Pyx_GOTREF(__pyx_t_6);
            }
            __pyx_t_8 = 0;
            {
              PyObject *__pyx_callargs[5] = {__pyx_t_15, __pyx_t_6, Py_None, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0};
              __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_GetMessageW, __pyx_callargs+__pyx_t_8, (5-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 593, __pyx_L31_error)
              __Pyx_GOTREF(__pyx_t_7);
            }
            __Pyx_XDECREF_SET(__pyx_v_ret, __pyx_t_7);
            __pyx_t_7 = 0;

            /* "ws_package/utils/hardware_event_validator.py":594
 *                 try:
 *                     ret = user32.GetMessageW(ctypes.byref(msg), None, 0, 0)
 *                     if ret in (0, -1):             # <<<<<<<<<<<<<<
 *                         break
 *                     if msg.message == WM_INPUT:
*/
            __Pyx_INCREF(__pyx_v_ret);
            __pyx_t_7 = __pyx_v_ret;
            __pyx_t_17 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_7, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 594, __pyx_L31_error)
            if (!__pyx_t_17) {
            } else {
              __pyx_t_18 = __pyx_t_17;
              goto __pyx_L40_bool_binop_done;
            }
            __pyx_t_17 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_7, __pyx_mstate_global->__pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 594, __pyx_L31_error)
            __pyx_t_18 = __pyx_t_17;
            __pyx_L40_bool_binop_done:;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_17 = __pyx_t_18;
            if (__pyx_t_17) {

              /* "ws_package/utils/hardware_event_validator.py":595
 *                     ret = user32.GetMessageW(ctypes.byref(msg), None, 0, 0)
 *                     if ret in (0, -1):
 *                         break             # <<<<<<<<<<<<<<
 *                     if msg.message == WM_INPUT:
 *                         record_raw_mouse_input(msg.lParam)
*/
              goto __pyx_L36_try_break;

              /* "ws_package/utils/hardware_event_validator.py":594
 *                 try:
 *                     ret = user32.GetMessageW(ctypes.byref(msg), None, 0, 0)
 *                     if ret in (0, -1):             # <<<<<<<<<<<<<<
 *                         break
 *                     if msg.message == WM_INPUT:
*/
            }

            /* "ws_package/utils/hardware_event_validator.py":596
 *                     if ret in (0, -1):
 *                         break
 *                     if msg.message == WM_INPUT:             # <<<<<<<<<<<<<<
 *                         record_raw_mouse_input(msg.lParam)
 *                     user32.TranslateMessage(ctypes.byref(msg))
*/
            __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_msg, __pyx_mstate_global->__pyx_n_u_message); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 596, __pyx_L31_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_WM_INPUT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 596, __pyx_L31_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_15 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 596, __pyx_L31_error)
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 596, __pyx_L31_error)
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (__pyx_t_17) {

              /* "ws_package/utils/hardware_event_validator.py":597
 *                         break
 *                     if msg.message == WM_INPUT:
 *                         record_raw_mouse_input(msg.lParam)             # <<<<<<<<<<<<<<
 *                     user32.TranslateMessage(ctypes.byref(msg))
 *                     user32.DispatchMessageW(ctypes.byref(msg))
*/
              __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_msg, __pyx_mstate_global->__pyx_n_u_lParam); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 597, __pyx_L31_error)
              __Pyx_GOTREF(__pyx_t_15);
              __pyx_t_6 = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_windows_hook_thread_4record_raw_mouse_input(__pyx_v_record_raw_mouse_input, __pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __pyx_L31_error)
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

              /* "ws_package/utils/hardware_event_validator.py":596
 *                     if ret in (0, -1):
 *                         break
 *                     if msg.message == WM_INPUT:             # <<<<<<<<<<<<<<
 *                         record_raw_mouse_input(msg.lParam)
 *                     user32.TranslateMessage(ctypes.byref(msg))
*/
            }

            /* "ws_package/utils/hardware_event_validator.py":598
 *                     if msg.message == WM_INPUT:
 *                         record_raw_mouse_input(msg.lParam)
 *                     user32.TranslateMessage(ctypes.byref(msg))             # <<<<<<<<<<<<<<
 *                     user32.DispatchMessageW(ctypes.byref(msg))
 *                 except Exception:
*/
            __pyx_t_15 = __pyx_cur_scope->__pyx_v_user32;
            __Pyx_INCREF(__pyx_t_15);
            __pyx_t_14 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 598, __pyx_L31_error)
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_byref); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 598, __pyx_L31_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __pyx_t_8 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_10))) {
              __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_10);
              assert(__pyx_t_14);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
              __pyx_t_8 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_msg};
              __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L31_error)
              __Pyx_GOTREF(__pyx_t_7);
            }
            __pyx_t_8 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_7};
              __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_TranslateMessage, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 598, __pyx_L31_error)
              __Pyx_GOTREF(__pyx_t_6);
            }
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

            /* "ws_package/utils/hardware_event_validator.py":599
 *                         record_raw_mouse_input(msg.lParam)
 *                     user32.TranslateMessage(ctypes.byref(msg))
 *                     user32.DispatchMessageW(ctypes.byref(msg))             # <<<<<<<<<<<<<<
 *                 except Exception:
 *                     time.sleep(0.05)
*/
            __pyx_t_7 = __pyx_cur_scope->__pyx_v_user32;
            __Pyx_INCREF(__pyx_t_7);
            __pyx_t_10 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 599, __pyx_L31_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_byref); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 599, __pyx_L31_error)
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_t_8 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_16))) {
              __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_16);
              assert(__pyx_t_10);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
              __pyx_t_8 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_msg};
              __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
              if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 599, __pyx_L31_error)
              __Pyx_GOTREF(__pyx_t_15);
            }
            __pyx_t_8 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_15};
              __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_DispatchMessageW, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
              if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L31_error)
              __Pyx_GOTREF(__pyx_t_6);
            }
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

            /* "ws_package/utils/hardware_event_validator.py":592
 *             msg = ctypes.wintypes.MSG()
 *             while not self._stop_hooks:
 *                 try:             # <<<<<<<<<<<<<<
 *                     ret = user32.GetMessageW(ctypes.byref(msg), None, 0, 0)
 *                     if ret in (0, -1):
*/
          }
          __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          goto __pyx_L38_try_end;
          __pyx_L31_error:;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "ws_package/utils/hardware_event_validator.py":600
 *                     user32.TranslateMessage(ctypes.byref(msg))
 *                     user32.DispatchMessageW(ctypes.byref(msg))
 *                 except Exception:             # <<<<<<<<<<<<<<
 *                     time.sleep(0.05)
 * 
*/
          __pyx_t_23 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
          if (__pyx_t_23) {
            __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._windows_hook_thread", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_15, &__pyx_t_7) < 0) __PYX_ERR(0, 600, __pyx_L33_except_error)
            __Pyx_XGOTREF(__pyx_t_6);
            __Pyx_XGOTREF(__pyx_t_15);
            __Pyx_XGOTREF(__pyx_t_7);

            /* "ws_package/utils/hardware_event_validator.py":601
 *                     user32.DispatchMessageW(ctypes.byref(msg))
 *                 except Exception:
 *                     time.sleep(0.05)             # <<<<<<<<<<<<<<
 * 
 *         except Exception as e:
*/
            __pyx_t_10 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 601, __pyx_L33_except_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_sleep); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 601, __pyx_L33_except_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_t_8 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_13))) {
              __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_13);
              assert(__pyx_t_10);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
              __pyx_t_8 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_float_0_05};
              __pyx_t_16 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 601, __pyx_L33_except_error)
              __Pyx_GOTREF(__pyx_t_16);
            }
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            goto __pyx_L32_exception_handled;
          }
          goto __pyx_L33_except_error;

          /* "ws_package/utils/hardware_event_validator.py":592
 *             msg = ctypes.wintypes.MSG()
 *             while not self._stop_hooks:
 *                 try:             # <<<<<<<<<<<<<<
 *                     ret = user32.GetMessageW(ctypes.byref(msg), None, 0, 0)
 *                     if ret in (0, -1):
*/
          __pyx_L33_except_error:;
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19);
          goto __pyx_L3_error;
          __pyx_L36_try_break:;
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19);
          goto __pyx_L30_break;
          __pyx_L32_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19);
          __pyx_L38_try_end:;
        }
      }
      __pyx_L30_break:;

      /* "ws_package/utils/hardware_event_validator.py":315
 *         pynput also uses.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             #  Private DLL handles (not shared with pynput)
 *             user32   = ctypes.WinDLL('user32',   use_last_error=True)
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "ws_package/utils/hardware_event_validator.py":603
 *                     time.sleep(0.05)
 * 
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.warning("Hardware hook thread error: %s", e)
 *             ok_flag[0] = False
*/
    __pyx_t_23 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_23) {
      __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._windows_hook_thread", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_15, &__pyx_t_6) < 0) __PYX_ERR(0, 603, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_15);
      __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_15);
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":604
 * 
 *         except Exception as e:
 *             logger.warning("Hardware hook thread error: %s", e)             # <<<<<<<<<<<<<<
 *             ok_flag[0] = False
 *             ready_event.set()
*/
        __pyx_t_13 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 604, __pyx_L50_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 604, __pyx_L50_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_8 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
          assert(__pyx_t_13);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
          __pyx_t_8 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_mstate_global->__pyx_kp_u_Hardware_hook_thread_error_s, __pyx_v_e};
          __pyx_t_16 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 604, __pyx_L50_error)
          __Pyx_GOTREF(__pyx_t_16);
        }
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

        /* "ws_package/utils/hardware_event_validator.py":605
 *         except Exception as e:
 *             logger.warning("Hardware hook thread error: %s", e)
 *             ok_flag[0] = False             # <<<<<<<<<<<<<<
 *             ready_event.set()
 * 
*/
        if (unlikely((__Pyx_SetItemInt(__pyx_v_ok_flag, 0, Py_False, long, 1, __Pyx_PyLong_From_long, 1, 0, 0, 1, __Pyx_ReferenceSharing_FunctionArgument) < 0))) __PYX_ERR(0, 605, __pyx_L50_error)

        /* "ws_package/utils/hardware_event_validator.py":606
 *             logger.warning("Hardware hook thread error: %s", e)
 *             ok_flag[0] = False
 *             ready_event.set()             # <<<<<<<<<<<<<<
 * 
 *     def _initialize_macos(self):
*/
        __pyx_t_14 = __pyx_v_ready_event;
        __Pyx_INCREF(__pyx_t_14);
        __pyx_t_8 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL};
          __pyx_t_16 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 606, __pyx_L50_error)
          __Pyx_GOTREF(__pyx_t_16);
        }
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      }

      /* "ws_package/utils/hardware_event_validator.py":603
 *                     time.sleep(0.05)
 * 
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.warning("Hardware hook thread error: %s", e)
 *             ok_flag[0] = False
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          goto __pyx_L51;
        }
        __pyx_L50_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_30 = 0; __pyx_t_29 = 0; __pyx_t_28 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_30, &__pyx_t_29, &__pyx_t_28);
          if ( unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_30);
          __Pyx_XGOTREF(__pyx_t_29);
          __Pyx_XGOTREF(__pyx_t_28);
          __pyx_t_23 = __pyx_lineno; __pyx_t_22 = __pyx_clineno; __pyx_t_31 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_30);
          __Pyx_XGIVEREF(__pyx_t_29);
          __Pyx_XGIVEREF(__pyx_t_28);
          __Pyx_ExceptionReset(__pyx_t_30, __pyx_t_29, __pyx_t_28);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_30 = 0; __pyx_t_29 = 0; __pyx_t_28 = 0;
          __pyx_lineno = __pyx_t_23; __pyx_clineno = __pyx_t_22; __pyx_filename = __pyx_t_31;
          goto __pyx_L5_except_error;
        }
        __pyx_L51:;
      }
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "ws_package/utils/hardware_event_validator.py":315
 *         pynput also uses.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             #  Private DLL handles (not shared with pynput)
 *             user32   = ctypes.WinDLL('user32',   use_last_error=True)
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ws_package/utils/hardware_event_validator.py":303
 *         )
 * 
 *     def _windows_hook_thread(self, ready_event: threading.Event, ok_flag: list):             # <<<<<<<<<<<<<<
 *         """
 *         Dedicated thread that INSTALLS and PUMPS low-level Windows hooks.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._windows_hook_thread", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_kernel32);
  __Pyx_XDECREF(__pyx_v_HOOKPROC);
  __Pyx_XDECREF(__pyx_v_low_level_keyboard_proc);
  __Pyx_XDECREF(__pyx_v_low_level_mouse_proc);
  __Pyx_XDECREF(__pyx_v_keyboard_proc);
  __Pyx_XDECREF(__pyx_v_mouse_proc);
  __Pyx_XDECREF(__pyx_v_hmod);
  __Pyx_XDECREF(__pyx_v_keyboard_hook);
  __Pyx_XDECREF(__pyx_v_mouse_hook);
  __Pyx_XDECREF(__pyx_v_RAWINPUTDEVICE);
  __Pyx_XDECREF(__pyx_v_record_raw_mouse_input);
  __Pyx_XDECREF(__pyx_v_rdi);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":608
 *             ready_event.set()
 * 
 *     def _initialize_macos(self):             # <<<<<<<<<<<<<<
 *         """Initialize macOS CGEvent API for event validation"""
 *         try:
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_19_initialize_macos(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_18_initialize_macos, "Initialize macOS CGEvent API for event validation");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_19_initialize_macos = {"_initialize_macos", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_19_initialize_macos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_18_initialize_macos};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_19_initialize_macos(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_initialize_macos (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 608, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 608, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_initialize_macos", 0) < (0)) __PYX_ERR(0, 608, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_initialize_macos", 1, 1, 1, i); __PYX_ERR(0, 608, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 608, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_initialize_macos", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 608, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._initialize_macos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_18_initialize_macos(__pyx_self, __pyx_v_self);

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

/* "ws_package/utils/hardware_event_validator.py":673
 * 
 *                     # Create event tap callback
 *                     def event_tap_callback(proxy, event_type, event, user_info):             # <<<<<<<<<<<<<<
 *                         try:
 *                             if event:  # Event is not None
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_17_initialize_macos_1event_tap_callback(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_17_initialize_macos_1event_tap_callback = {"event_tap_callback", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_17_initialize_macos_1event_tap_callback, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_17_initialize_macos_1event_tap_callback(PyObject *__pyx_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_proxy = 0;
  PyObject *__pyx_v_event_type = 0;
  PyObject *__pyx_v_event = 0;
  CYTHON_UNUSED PyObject *__pyx_v_user_info = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("event_tap_callback (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_proxy,&__pyx_mstate_global->__pyx_n_u_event_type,&__pyx_mstate_global->__pyx_n_u_event,&__pyx_mstate_global->__pyx_n_u_user_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 673, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 673, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 673, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 673, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 673, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "event_tap_callback", 0) < (0)) __PYX_ERR(0, 673, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("event_tap_callback", 1, 4, 4, i); __PYX_ERR(0, 673, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 673, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 673, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 673, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 673, __pyx_L3_error)
    }
    __pyx_v_proxy = values[0];
    __pyx_v_event_type = values[1];
    __pyx_v_event = values[2];
    __pyx_v_user_info = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("event_tap_callback", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 673, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._initialize_macos.event_tap_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_17_initialize_macos_event_tap_callback(__pyx_self, __pyx_v_proxy, __pyx_v_event_type, __pyx_v_event, __pyx_v_user_info);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_17_initialize_macos_event_tap_callback(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_proxy, PyObject *__pyx_v_event_type, PyObject *__pyx_v_event, CYTHON_UNUSED PyObject *__pyx_v_user_info) {
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos *__pyx_cur_scope;
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos *__pyx_outer_scope;
  PyObject *__pyx_v_source_id = NULL;
  PyObject *__pyx_v_current_time = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("event_tap_callback", 0);
  __pyx_outer_scope = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "ws_package/utils/hardware_event_validator.py":674
 *                     # Create event tap callback
 *                     def event_tap_callback(proxy, event_type, event, user_info):
 *                         try:             # <<<<<<<<<<<<<<
 *                             if event:  # Event is not None
 *                                 # Get event source ID
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":675
 *                     def event_tap_callback(proxy, event_type, event, user_info):
 *                         try:
 *                             if event:  # Event is not None             # <<<<<<<<<<<<<<
 *                                 # Get event source ID
 *                                 source_id = quartz.CGEventGetIntegerValueField(
*/
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_event); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 675, __pyx_L3_error)
      if (__pyx_t_4) {

        /* "ws_package/utils/hardware_event_validator.py":677
 *                             if event:  # Event is not None
 *                                 # Get event source ID
 *                                 source_id = quartz.CGEventGetIntegerValueField(             # <<<<<<<<<<<<<<
 *                                     ctypes.c_void_p(event),
 *                                     kCGEventSourceStateID
*/
        if (unlikely(!__pyx_cur_scope->__pyx_v_quartz)) { __Pyx_RaiseClosureNameError("quartz"); __PYX_ERR(0, 677, __pyx_L3_error) }
        __pyx_t_6 = __pyx_cur_scope->__pyx_v_quartz;
        __Pyx_INCREF(__pyx_t_6);

        /* "ws_package/utils/hardware_event_validator.py":678
 *                                 # Get event source ID
 *                                 source_id = quartz.CGEventGetIntegerValueField(
 *                                     ctypes.c_void_p(event),             # <<<<<<<<<<<<<<
 *                                     kCGEventSourceStateID
 *                                 )
*/
        __pyx_t_8 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 678, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_c_void_p); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 678, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_11 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
          assert(__pyx_t_8);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
          __pyx_t_11 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_event};
          __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 678, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_7);
        }

        /* "ws_package/utils/hardware_event_validator.py":679
 *                                 source_id = quartz.CGEventGetIntegerValueField(
 *                                     ctypes.c_void_p(event),
 *                                     kCGEventSourceStateID             # <<<<<<<<<<<<<<
 *                                 )
 * 
*/
        __pyx_t_10 = __Pyx_PyLong_From_long(__pyx_cur_scope->__pyx_v_kCGEventSourceStateID); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 679, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_7, __pyx_t_10};
          __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_CGEventGetIntegerValueField, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
        }
        __pyx_v_source_id = __pyx_t_5;
        __pyx_t_5 = 0;

        /* "ws_package/utils/hardware_event_validator.py":682
 *                                 )
 * 
 *                                 current_time = time.time()             # <<<<<<<<<<<<<<
 * 
 *                                 # Check event type and store source
*/
        __pyx_t_10 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 682, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_11 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
          assert(__pyx_t_10);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
          __pyx_t_11 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
          __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 682, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
        }
        __pyx_v_current_time = __pyx_t_5;
        __pyx_t_5 = 0;

        /* "ws_package/utils/hardware_event_validator.py":685
 * 
 *                                 # Check event type and store source
 *                                 with self._macos_lock:             # <<<<<<<<<<<<<<
 *                                     if event_type in (kCGEventKeyDown, kCGEventKeyUp):
 *                                         self._macos_last_keyboard_event = {
*/
        /*with:*/ {
          if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 685, __pyx_L3_error) }
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_lock); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 685, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 685, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = NULL;
          __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 685, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_11 = 1;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
            assert(__pyx_t_10);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
            __pyx_t_11 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
            __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          /*try:*/ {
            {
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
              __Pyx_XGOTREF(__pyx_t_13);
              __Pyx_XGOTREF(__pyx_t_14);
              __Pyx_XGOTREF(__pyx_t_15);
              /*try:*/ {

                /* "ws_package/utils/hardware_event_validator.py":686
 *                                 # Check event type and store source
 *                                 with self._macos_lock:
 *                                     if event_type in (kCGEventKeyDown, kCGEventKeyUp):             # <<<<<<<<<<<<<<
 *                                         self._macos_last_keyboard_event = {
 *                                             'source_id': source_id,
*/
                __Pyx_INCREF(__pyx_v_event_type);
                __pyx_t_5 = __pyx_v_event_type;
                if (unlikely(!__pyx_cur_scope->__pyx_v_kCGEventKeyDown)) { __Pyx_RaiseClosureNameError("kCGEventKeyDown"); __PYX_ERR(0, 686, __pyx_L14_error) }
                __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_cur_scope->__pyx_v_kCGEventKeyDown, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 686, __pyx_L14_error)
                __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 686, __pyx_L14_error)
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (!__pyx_t_16) {
                } else {
                  __pyx_t_4 = __pyx_t_16;
                  goto __pyx_L21_bool_binop_done;
                }
                if (unlikely(!__pyx_cur_scope->__pyx_v_kCGEventKeyUp)) { __Pyx_RaiseClosureNameError("kCGEventKeyUp"); __PYX_ERR(0, 686, __pyx_L14_error) }
                __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_cur_scope->__pyx_v_kCGEventKeyUp, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 686, __pyx_L14_error)
                __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 686, __pyx_L14_error)
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                __pyx_t_4 = __pyx_t_16;
                __pyx_L21_bool_binop_done:;
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                __pyx_t_16 = __pyx_t_4;
                if (__pyx_t_16) {

                  /* "ws_package/utils/hardware_event_validator.py":688
 *                                     if event_type in (kCGEventKeyDown, kCGEventKeyUp):
 *                                         self._macos_last_keyboard_event = {
 *                                             'source_id': source_id,             # <<<<<<<<<<<<<<
 *                                             'timestamp': current_time
 *                                         }
*/
                  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 688, __pyx_L14_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_source_id, __pyx_v_source_id) < (0)) __PYX_ERR(0, 688, __pyx_L14_error)

                  /* "ws_package/utils/hardware_event_validator.py":689
 *                                         self._macos_last_keyboard_event = {
 *                                             'source_id': source_id,
 *                                             'timestamp': current_time             # <<<<<<<<<<<<<<
 *                                         }
 *                                     elif event_type in (kCGEventMouseMoved, kCGEventKeyDown, kCGEventKeyUp, kCGEventLeftMouseDown, kCGEventRightMouseDown):
*/
                  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_timestamp, __pyx_v_current_time) < (0)) __PYX_ERR(0, 688, __pyx_L14_error)

                  /* "ws_package/utils/hardware_event_validator.py":687
 *                                 with self._macos_lock:
 *                                     if event_type in (kCGEventKeyDown, kCGEventKeyUp):
 *                                         self._macos_last_keyboard_event = {             # <<<<<<<<<<<<<<
 *                                             'source_id': source_id,
 *                                             'timestamp': current_time
*/
                  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 687, __pyx_L14_error) }
                  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_last_keyboard_event, __pyx_t_5) < (0)) __PYX_ERR(0, 687, __pyx_L14_error)
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                  /* "ws_package/utils/hardware_event_validator.py":686
 *                                 # Check event type and store source
 *                                 with self._macos_lock:
 *                                     if event_type in (kCGEventKeyDown, kCGEventKeyUp):             # <<<<<<<<<<<<<<
 *                                         self._macos_last_keyboard_event = {
 *                                             'source_id': source_id,
*/
                  goto __pyx_L20;
                }

                /* "ws_package/utils/hardware_event_validator.py":691
 *                                             'timestamp': current_time
 *                                         }
 *                                     elif event_type in (kCGEventMouseMoved, kCGEventKeyDown, kCGEventKeyUp, kCGEventLeftMouseDown, kCGEventRightMouseDown):             # <<<<<<<<<<<<<<
 *                                         self._macos_last_mouse_event = {
 *                                             'source_id': source_id,
*/
                __Pyx_INCREF(__pyx_v_event_type);
                __pyx_t_5 = __pyx_v_event_type;
                if (unlikely(!__pyx_cur_scope->__pyx_v_kCGEventMouseMoved)) { __Pyx_RaiseClosureNameError("kCGEventMouseMoved"); __PYX_ERR(0, 691, __pyx_L14_error) }
                __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_cur_scope->__pyx_v_kCGEventMouseMoved, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 691, __pyx_L14_error)
                __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 691, __pyx_L14_error)
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (!__pyx_t_4) {
                } else {
                  __pyx_t_16 = __pyx_t_4;
                  goto __pyx_L23_bool_binop_done;
                }
                if (unlikely(!__pyx_cur_scope->__pyx_v_kCGEventKeyDown)) { __Pyx_RaiseClosureNameError("kCGEventKeyDown"); __PYX_ERR(0, 691, __pyx_L14_error) }
                __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_cur_scope->__pyx_v_kCGEventKeyDown, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 691, __pyx_L14_error)
                __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 691, __pyx_L14_error)
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (!__pyx_t_4) {
                } else {
                  __pyx_t_16 = __pyx_t_4;
                  goto __pyx_L23_bool_binop_done;
                }
                if (unlikely(!__pyx_cur_scope->__pyx_v_kCGEventKeyUp)) { __Pyx_RaiseClosureNameError("kCGEventKeyUp"); __PYX_ERR(0, 691, __pyx_L14_error) }
                __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_cur_scope->__pyx_v_kCGEventKeyUp, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 691, __pyx_L14_error)
                __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 691, __pyx_L14_error)
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (!__pyx_t_4) {
                } else {
                  __pyx_t_16 = __pyx_t_4;
                  goto __pyx_L23_bool_binop_done;
                }
                if (unlikely(!__pyx_cur_scope->__pyx_v_kCGEventLeftMouseDown)) { __Pyx_RaiseClosureNameError("kCGEventLeftMouseDown"); __PYX_ERR(0, 691, __pyx_L14_error) }
                __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_cur_scope->__pyx_v_kCGEventLeftMouseDown, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 691, __pyx_L14_error)
                __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 691, __pyx_L14_error)
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (!__pyx_t_4) {
                } else {
                  __pyx_t_16 = __pyx_t_4;
                  goto __pyx_L23_bool_binop_done;
                }
                if (unlikely(!__pyx_cur_scope->__pyx_v_kCGEventRightMouseDown)) { __Pyx_RaiseClosureNameError("kCGEventRightMouseDown"); __PYX_ERR(0, 691, __pyx_L14_error) }
                __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_cur_scope->__pyx_v_kCGEventRightMouseDown, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 691, __pyx_L14_error)
                __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 691, __pyx_L14_error)
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                __pyx_t_16 = __pyx_t_4;
                __pyx_L23_bool_binop_done:;
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                __pyx_t_4 = __pyx_t_16;
                if (__pyx_t_4) {

                  /* "ws_package/utils/hardware_event_validator.py":693
 *                                     elif event_type in (kCGEventMouseMoved, kCGEventKeyDown, kCGEventKeyUp, kCGEventLeftMouseDown, kCGEventRightMouseDown):
 *                                         self._macos_last_mouse_event = {
 *                                             'source_id': source_id,             # <<<<<<<<<<<<<<
 *                                             'timestamp': current_time
 *                                         }
*/
                  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 693, __pyx_L14_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_source_id, __pyx_v_source_id) < (0)) __PYX_ERR(0, 693, __pyx_L14_error)

                  /* "ws_package/utils/hardware_event_validator.py":694
 *                                         self._macos_last_mouse_event = {
 *                                             'source_id': source_id,
 *                                             'timestamp': current_time             # <<<<<<<<<<<<<<
 *                                         }
 *                         except Exception:
*/
                  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_timestamp, __pyx_v_current_time) < (0)) __PYX_ERR(0, 693, __pyx_L14_error)

                  /* "ws_package/utils/hardware_event_validator.py":692
 *                                         }
 *                                     elif event_type in (kCGEventMouseMoved, kCGEventKeyDown, kCGEventKeyUp, kCGEventLeftMouseDown, kCGEventRightMouseDown):
 *                                         self._macos_last_mouse_event = {             # <<<<<<<<<<<<<<
 *                                             'source_id': source_id,
 *                                             'timestamp': current_time
*/
                  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 692, __pyx_L14_error) }
                  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_last_mouse_event, __pyx_t_5) < (0)) __PYX_ERR(0, 692, __pyx_L14_error)
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                  /* "ws_package/utils/hardware_event_validator.py":691
 *                                             'timestamp': current_time
 *                                         }
 *                                     elif event_type in (kCGEventMouseMoved, kCGEventKeyDown, kCGEventKeyUp, kCGEventLeftMouseDown, kCGEventRightMouseDown):             # <<<<<<<<<<<<<<
 *                                         self._macos_last_mouse_event = {
 *                                             'source_id': source_id,
*/
                }
                __pyx_L20:;

                /* "ws_package/utils/hardware_event_validator.py":685
 * 
 *                                 # Check event type and store source
 *                                 with self._macos_lock:             # <<<<<<<<<<<<<<
 *                                     if event_type in (kCGEventKeyDown, kCGEventKeyUp):
 *                                         self._macos_last_keyboard_event = {
*/
              }
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              goto __pyx_L19_try_end;
              __pyx_L14_error:;
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
              /*except:*/ {
                __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._initialize_macos.event_tap_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
                if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 685, __pyx_L16_except_error)
                __Pyx_XGOTREF(__pyx_t_5);
                __Pyx_XGOTREF(__pyx_t_6);
                __Pyx_XGOTREF(__pyx_t_7);
                __pyx_t_10 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 685, __pyx_L16_except_error)
                __Pyx_GOTREF(__pyx_t_10);
                __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, NULL);
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 685, __pyx_L16_except_error)
                __Pyx_GOTREF(__pyx_t_17);
                __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_17);
                __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                if (__pyx_t_4 < (0)) __PYX_ERR(0, 685, __pyx_L16_except_error)
                __pyx_t_16 = (!__pyx_t_4);
                if (unlikely(__pyx_t_16)) {
                  __Pyx_GIVEREF(__pyx_t_5);
                  __Pyx_GIVEREF(__pyx_t_6);
                  __Pyx_XGIVEREF(__pyx_t_7);
                  __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_6, __pyx_t_7);
                  __pyx_t_5 = 0;  __pyx_t_6 = 0;  __pyx_t_7 = 0; 
                  __PYX_ERR(0, 685, __pyx_L16_except_error)
                }
                __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                goto __pyx_L15_exception_handled;
              }
              __pyx_L16_except_error:;
              __Pyx_XGIVEREF(__pyx_t_13);
              __Pyx_XGIVEREF(__pyx_t_14);
              __Pyx_XGIVEREF(__pyx_t_15);
              __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
              goto __pyx_L3_error;
              __pyx_L15_exception_handled:;
              __Pyx_XGIVEREF(__pyx_t_13);
              __Pyx_XGIVEREF(__pyx_t_14);
              __Pyx_XGIVEREF(__pyx_t_15);
              __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
              __pyx_L19_try_end:;
            }
          }
          /*finally:*/ {
            /*normal exit:*/{
              if (__pyx_t_12) {
                __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_mstate_global->__pyx_tuple[2], NULL);
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 685, __pyx_L3_error)
                __Pyx_GOTREF(__pyx_t_15);
                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
              }
              goto __pyx_L13;
            }
            __pyx_L13:;
          }
          goto __pyx_L31;
          __pyx_L10_error:;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          goto __pyx_L3_error;
          __pyx_L31:;
        }

        /* "ws_package/utils/hardware_event_validator.py":675
 *                     def event_tap_callback(proxy, event_type, event, user_info):
 *                         try:
 *                             if event:  # Event is not None             # <<<<<<<<<<<<<<
 *                                 # Get event source ID
 *                                 source_id = quartz.CGEventGetIntegerValueField(
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":674
 *                     # Create event tap callback
 *                     def event_tap_callback(proxy, event_type, event, user_info):
 *                         try:             # <<<<<<<<<<<<<<
 *                             if event:  # Event is not None
 *                                 # Get event source ID
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "ws_package/utils/hardware_event_validator.py":696
 *                                             'timestamp': current_time
 *                                         }
 *                         except Exception:             # <<<<<<<<<<<<<<
 *                             pass  # Fail silently
 * 
*/
    __pyx_t_18 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_18) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "ws_package/utils/hardware_event_validator.py":674
 *                     # Create event tap callback
 *                     def event_tap_callback(proxy, event_type, event, user_info):
 *                         try:             # <<<<<<<<<<<<<<
 *                             if event:  # Event is not None
 *                                 # Get event source ID
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ws_package/utils/hardware_event_validator.py":700
 * 
 *                         # Return event (don't block it) - return None means pass through
 *                         return event             # <<<<<<<<<<<<<<
 * 
 *                     # Create callback reference
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_event);
  __pyx_r = __pyx_v_event;
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":673
 * 
 *                     # Create event tap callback
 *                     def event_tap_callback(proxy, event_type, event, user_info):             # <<<<<<<<<<<<<<
 *                         try:
 *                             if event:  # Event is not None
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._initialize_macos.event_tap_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_source_id);
  __Pyx_XDECREF(__pyx_v_current_time);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":608
 *             ready_event.set()
 * 
 *     def _initialize_macos(self):             # <<<<<<<<<<<<<<
 *         """Initialize macOS CGEvent API for event validation"""
 *         try:
*/

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_18_initialize_macos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos *__pyx_cur_scope;
  PyObject *__pyx_v_Quartz = NULL;
  long __pyx_v_kCGEventSourceStateHIDSystemState;
  CYTHON_UNUSED long __pyx_v_kCGEventSourceStatePrivate;
  CYTHON_UNUSED long __pyx_v_kCGEventSourceStateCombinedSessionState;
  long __pyx_v_kCGEventTapOptionDefault;
  long __pyx_v_kCGHeadInsertEventTap;
  PyObject *__pyx_v_CGEventTapCallBack = NULL;
  PyObject *__pyx_v_event_tap_callback = 0;
  PyObject *__pyx_v_callback_ref = NULL;
  PyObject *__pyx_v_event_mask = NULL;
  PyObject *__pyx_v_event_tap = NULL;
  PyObject *__pyx_v_enabled = NULL;
  PyObject *__pyx_v_e2 = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_t_21;
  int __pyx_t_22;
  int __pyx_t_23;
  char const *__pyx_t_24;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  PyObject *__pyx_t_28 = NULL;
  PyObject *__pyx_t_29 = NULL;
  PyObject *__pyx_t_30 = NULL;
  char const *__pyx_t_31;
  char const *__pyx_t_32;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_initialize_macos", 0);
  __pyx_cur_scope = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos *)__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos(__pyx_mstate_global->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 608, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);

  /* "ws_package/utils/hardware_event_validator.py":610
 *     def _initialize_macos(self):
 *         """Initialize macOS CGEvent API for event validation"""
 *         try:             # <<<<<<<<<<<<<<
 *             # Primary path: MacCGEventListener passes Quartz CGEvent objects directly.
 *             # Reading kCGEventSourceStateID on the event is reliable; a secondary ctypes
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":614
 *             # Reading kCGEventSourceStateID on the event is reliable; a secondary ctypes
 *             # CGEventTap without CFRunLoop never receives callbacks.
 *             try:             # <<<<<<<<<<<<<<
 *                 import Quartz
 *                 self._macos_quartz_module = Quartz
*/
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_6);
        /*try:*/ {

          /* "ws_package/utils/hardware_event_validator.py":615
 *             # CGEventTap without CFRunLoop never receives callbacks.
 *             try:
 *                 import Quartz             # <<<<<<<<<<<<<<
 *                 self._macos_quartz_module = Quartz
 *                 self._macos_direct_validation = True
*/
          __pyx_t_8 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_Quartz, 0, 0, NULL, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L9_error)
          __pyx_t_7 = __pyx_t_8;
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_v_Quartz = __pyx_t_7;
          __pyx_t_7 = 0;

          /* "ws_package/utils/hardware_event_validator.py":616
 *             try:
 *                 import Quartz
 *                 self._macos_quartz_module = Quartz             # <<<<<<<<<<<<<<
 *                 self._macos_direct_validation = True
 *                 self._enabled = True
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_quartz_module, __pyx_v_Quartz) < (0)) __PYX_ERR(0, 616, __pyx_L9_error)

          /* "ws_package/utils/hardware_event_validator.py":617
 *                 import Quartz
 *                 self._macos_quartz_module = Quartz
 *                 self._macos_direct_validation = True             # <<<<<<<<<<<<<<
 *                 self._enabled = True
 *                 logger.info(
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_direct_validation, Py_True) < (0)) __PYX_ERR(0, 617, __pyx_L9_error)

          /* "ws_package/utils/hardware_event_validator.py":618
 *                 self._macos_quartz_module = Quartz
 *                 self._macos_direct_validation = True
 *                 self._enabled = True             # <<<<<<<<<<<<<<
 *                 logger.info(
 *                     "macOS hardware event validation enabled (direct CGEvent source check)"
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_enabled, Py_True) < (0)) __PYX_ERR(0, 618, __pyx_L9_error)

          /* "ws_package/utils/hardware_event_validator.py":619
 *                 self._macos_direct_validation = True
 *                 self._enabled = True
 *                 logger.info(             # <<<<<<<<<<<<<<
 *                     "macOS hardware event validation enabled (direct CGEvent source check)"
 *                 )
*/
          __pyx_t_9 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 619, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_info); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 619, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_12 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_11))) {
            __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
            assert(__pyx_t_9);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
            __pyx_t_12 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_macOS_hardware_event_validation};
            __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 619, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "ws_package/utils/hardware_event_validator.py":622
 *                     "macOS hardware event validation enabled (direct CGEvent source check)"
 *                 )
 *                 return             # <<<<<<<<<<<<<<
 *             except ImportError:
 *                 self._macos_direct_validation = False
*/
          __Pyx_XDECREF(__pyx_r);
          __pyx_r = Py_None; __Pyx_INCREF(Py_None);
          goto __pyx_L13_try_return;

          /* "ws_package/utils/hardware_event_validator.py":614
 *             # Reading kCGEventSourceStateID on the event is reliable; a secondary ctypes
 *             # CGEventTap without CFRunLoop never receives callbacks.
 *             try:             # <<<<<<<<<<<<<<
 *                 import Quartz
 *                 self._macos_quartz_module = Quartz
*/
        }
        __pyx_L9_error:;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "ws_package/utils/hardware_event_validator.py":623
 *                 )
 *                 return
 *             except ImportError:             # <<<<<<<<<<<<<<
 *                 self._macos_direct_validation = False
 * 
*/
        __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError))));
        if (__pyx_t_13) {
          __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._initialize_macos", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_11, &__pyx_t_9) < 0) __PYX_ERR(0, 623, __pyx_L11_except_error)
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_9);

          /* "ws_package/utils/hardware_event_validator.py":624
 *                 return
 *             except ImportError:
 *                 self._macos_direct_validation = False             # <<<<<<<<<<<<<<
 * 
 *             # Fallback: ctypes CGEventTap (legacy pynput path)
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_direct_validation, Py_False) < (0)) __PYX_ERR(0, 624, __pyx_L11_except_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L10_exception_handled;
        }
        goto __pyx_L11_except_error;

        /* "ws_package/utils/hardware_event_validator.py":614
 *             # Reading kCGEventSourceStateID on the event is reliable; a secondary ctypes
 *             # CGEventTap without CFRunLoop never receives callbacks.
 *             try:             # <<<<<<<<<<<<<<
 *                 import Quartz
 *                 self._macos_quartz_module = Quartz
*/
        __pyx_L11_except_error:;
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L3_error;
        __pyx_L13_try_return:;
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L7_try_return;
        __pyx_L10_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      }

      /* "ws_package/utils/hardware_event_validator.py":627
 * 
 *             # Fallback: ctypes CGEventTap (legacy pynput path)
 *             try:             # <<<<<<<<<<<<<<
 *                 # Load Quartz framework
 *                 quartz = ctypes.CDLL('/System/Library/Frameworks/ApplicationServices.framework/ApplicationServices')
*/
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_4);
        /*try:*/ {

          /* "ws_package/utils/hardware_event_validator.py":629
 *             try:
 *                 # Load Quartz framework
 *                 quartz = ctypes.CDLL('/System/Library/Frameworks/ApplicationServices.framework/ApplicationServices')             # <<<<<<<<<<<<<<
 * 
 *                 # Define constants
*/
          __pyx_t_11 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 629, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_CDLL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 629, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_12 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_10))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
            assert(__pyx_t_11);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
            __pyx_t_12 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_System_Library_Frameworks_Appli};
            __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 629, __pyx_L17_error)
            __Pyx_GOTREF(__pyx_t_9);
          }
          __Pyx_GIVEREF(__pyx_t_9);
          __pyx_cur_scope->__pyx_v_quartz = __pyx_t_9;
          __pyx_t_9 = 0;

          /* "ws_package/utils/hardware_event_validator.py":632
 * 
 *                 # Define constants
 *                 kCGEventSourceStateID = 0x00000045             # <<<<<<<<<<<<<<
 *                 kCGEventSourceStateHIDSystemState = 1
 *                 kCGEventSourceStatePrivate = -1
*/
          __pyx_cur_scope->__pyx_v_kCGEventSourceStateID = 0x00000045;

          /* "ws_package/utils/hardware_event_validator.py":633
 *                 # Define constants
 *                 kCGEventSourceStateID = 0x00000045
 *                 kCGEventSourceStateHIDSystemState = 1             # <<<<<<<<<<<<<<
 *                 kCGEventSourceStatePrivate = -1
 *                 kCGEventSourceStateCombinedSessionState = 0
*/
          __pyx_v_kCGEventSourceStateHIDSystemState = 1;

          /* "ws_package/utils/hardware_event_validator.py":634
 *                 kCGEventSourceStateID = 0x00000045
 *                 kCGEventSourceStateHIDSystemState = 1
 *                 kCGEventSourceStatePrivate = -1             # <<<<<<<<<<<<<<
 *                 kCGEventSourceStateCombinedSessionState = 0
 * 
*/
          __pyx_v_kCGEventSourceStatePrivate = -1L;

          /* "ws_package/utils/hardware_event_validator.py":635
 *                 kCGEventSourceStateHIDSystemState = 1
 *                 kCGEventSourceStatePrivate = -1
 *                 kCGEventSourceStateCombinedSessionState = 0             # <<<<<<<<<<<<<<
 * 
 *                 # Thread-safe storage for latest event source
*/
          __pyx_v_kCGEventSourceStateCombinedSessionState = 0;

          /* "ws_package/utils/hardware_event_validator.py":638
 * 
 *                 # Thread-safe storage for latest event source
 *                 self._macos_last_keyboard_event = {'source_id': None, 'timestamp': 0}             # <<<<<<<<<<<<<<
 *                 self._macos_last_mouse_event = {'source_id': None, 'timestamp': 0}
 *                 self._macos_lock = threading.Lock()
*/
          __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 638, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (PyDict_SetItem(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_source_id, Py_None) < (0)) __PYX_ERR(0, 638, __pyx_L17_error)
          if (PyDict_SetItem(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_timestamp, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 638, __pyx_L17_error)
          if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_last_keyboard_event, __pyx_t_9) < (0)) __PYX_ERR(0, 638, __pyx_L17_error)
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "ws_package/utils/hardware_event_validator.py":639
 *                 # Thread-safe storage for latest event source
 *                 self._macos_last_keyboard_event = {'source_id': None, 'timestamp': 0}
 *                 self._macos_last_mouse_event = {'source_id': None, 'timestamp': 0}             # <<<<<<<<<<<<<<
 *                 self._macos_lock = threading.Lock()
 * 
*/
          __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 639, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (PyDict_SetItem(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_source_id, Py_None) < (0)) __PYX_ERR(0, 639, __pyx_L17_error)
          if (PyDict_SetItem(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_timestamp, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 639, __pyx_L17_error)
          if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_last_mouse_event, __pyx_t_9) < (0)) __PYX_ERR(0, 639, __pyx_L17_error)
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "ws_package/utils/hardware_event_validator.py":640
 *                 self._macos_last_keyboard_event = {'source_id': None, 'timestamp': 0}
 *                 self._macos_last_mouse_event = {'source_id': None, 'timestamp': 0}
 *                 self._macos_lock = threading.Lock()             # <<<<<<<<<<<<<<
 * 
 *                 # Store constants for checking event sources
*/
          __pyx_t_10 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_threading); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 640, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_Lock); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 640, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_12 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
            assert(__pyx_t_10);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
            __pyx_t_12 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
            __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_12, (1-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 640, __pyx_L17_error)
            __Pyx_GOTREF(__pyx_t_9);
          }
          if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_lock, __pyx_t_9) < (0)) __PYX_ERR(0, 640, __pyx_L17_error)
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "ws_package/utils/hardware_event_validator.py":644
 *                 # Store constants for checking event sources
 *                 self._macos_constants = {
 *                     'kCGEventSourceStateID': kCGEventSourceStateID,             # <<<<<<<<<<<<<<
 *                     'kCGEventSourceStateHIDSystemState': kCGEventSourceStateHIDSystemState,
 *                 }
*/
          __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 644, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_7 = __Pyx_PyLong_From_long(__pyx_cur_scope->__pyx_v_kCGEventSourceStateID); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 644, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_7);
          if (PyDict_SetItem(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_kCGEventSourceStateID, __pyx_t_7) < (0)) __PYX_ERR(0, 644, __pyx_L17_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "ws_package/utils/hardware_event_validator.py":645
 *                 self._macos_constants = {
 *                     'kCGEventSourceStateID': kCGEventSourceStateID,
 *                     'kCGEventSourceStateHIDSystemState': kCGEventSourceStateHIDSystemState,             # <<<<<<<<<<<<<<
 *                 }
 *                 self._macos_quartz = quartz
*/
          __pyx_t_7 = __Pyx_PyLong_From_long(__pyx_v_kCGEventSourceStateHIDSystemState); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 645, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_7);
          if (PyDict_SetItem(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_kCGEventSourceStateHIDSystemStat, __pyx_t_7) < (0)) __PYX_ERR(0, 644, __pyx_L17_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "ws_package/utils/hardware_event_validator.py":643
 * 
 *                 # Store constants for checking event sources
 *                 self._macos_constants = {             # <<<<<<<<<<<<<<
 *                     'kCGEventSourceStateID': kCGEventSourceStateID,
 *                     'kCGEventSourceStateHIDSystemState': kCGEventSourceStateHIDSystemState,
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_constants, __pyx_t_9) < (0)) __PYX_ERR(0, 643, __pyx_L17_error)
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "ws_package/utils/hardware_event_validator.py":647
 *                     'kCGEventSourceStateHIDSystemState': kCGEventSourceStateHIDSystemState,
 *                 }
 *                 self._macos_quartz = quartz             # <<<<<<<<<<<<<<
 * 
 *                 # Try to set up CGEventTap to monitor events
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_quartz, __pyx_cur_scope->__pyx_v_quartz) < (0)) __PYX_ERR(0, 647, __pyx_L17_error)

          /* "ws_package/utils/hardware_event_validator.py":651
 *                 # Try to set up CGEventTap to monitor events
 *                 # Note: This requires accessibility permissions
 *                 try:             # <<<<<<<<<<<<<<
 *                     # Constants for event tap
 *                     kCGEventTapOptionDefault = 0x00000000
*/
          {
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_14, &__pyx_t_15);
            __Pyx_XGOTREF(__pyx_t_8);
            __Pyx_XGOTREF(__pyx_t_14);
            __Pyx_XGOTREF(__pyx_t_15);
            /*try:*/ {

              /* "ws_package/utils/hardware_event_validator.py":653
 *                 try:
 *                     # Constants for event tap
 *                     kCGEventTapOptionDefault = 0x00000000             # <<<<<<<<<<<<<<
 *                     kCGHeadInsertEventTap = 0
 * 
*/
              __pyx_v_kCGEventTapOptionDefault = 0x00000000;

              /* "ws_package/utils/hardware_event_validator.py":654
 *                     # Constants for event tap
 *                     kCGEventTapOptionDefault = 0x00000000
 *                     kCGHeadInsertEventTap = 0             # <<<<<<<<<<<<<<
 * 
 *                     # Event types we want to monitor
*/
              __pyx_v_kCGHeadInsertEventTap = 0;

              /* "ws_package/utils/hardware_event_validator.py":657
 * 
 *                     # Event types we want to monitor
 *                     kCGEventKeyDown = 0x0000000A             # <<<<<<<<<<<<<<
 *                     kCGEventKeyUp = 0x0000000B
 *                     kCGEventMouseMoved = 0x00000005
*/
              __Pyx_INCREF(__pyx_mstate_global->__pyx_int_10);
              __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_10);
              __pyx_cur_scope->__pyx_v_kCGEventKeyDown = __pyx_mstate_global->__pyx_int_10;

              /* "ws_package/utils/hardware_event_validator.py":658
 *                     # Event types we want to monitor
 *                     kCGEventKeyDown = 0x0000000A
 *                     kCGEventKeyUp = 0x0000000B             # <<<<<<<<<<<<<<
 *                     kCGEventMouseMoved = 0x00000005
 *                     kCGEventLeftMouseDown = 0x00000001
*/
              __Pyx_INCREF(__pyx_mstate_global->__pyx_int_11);
              __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_11);
              __pyx_cur_scope->__pyx_v_kCGEventKeyUp = __pyx_mstate_global->__pyx_int_11;

              /* "ws_package/utils/hardware_event_validator.py":659
 *                     kCGEventKeyDown = 0x0000000A
 *                     kCGEventKeyUp = 0x0000000B
 *                     kCGEventMouseMoved = 0x00000005             # <<<<<<<<<<<<<<
 *                     kCGEventLeftMouseDown = 0x00000001
 *                     kCGEventRightMouseDown = 0x00000003
*/
              __Pyx_INCREF(__pyx_mstate_global->__pyx_int_5);
              __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_5);
              __pyx_cur_scope->__pyx_v_kCGEventMouseMoved = __pyx_mstate_global->__pyx_int_5;

              /* "ws_package/utils/hardware_event_validator.py":660
 *                     kCGEventKeyUp = 0x0000000B
 *                     kCGEventMouseMoved = 0x00000005
 *                     kCGEventLeftMouseDown = 0x00000001             # <<<<<<<<<<<<<<
 *                     kCGEventRightMouseDown = 0x00000003
 * 
*/
              __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
              __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
              __pyx_cur_scope->__pyx_v_kCGEventLeftMouseDown = __pyx_mstate_global->__pyx_int_1;

              /* "ws_package/utils/hardware_event_validator.py":661
 *                     kCGEventMouseMoved = 0x00000005
 *                     kCGEventLeftMouseDown = 0x00000001
 *                     kCGEventRightMouseDown = 0x00000003             # <<<<<<<<<<<<<<
 * 
 *                     # Define callback function type
*/
              __Pyx_INCREF(__pyx_mstate_global->__pyx_int_3);
              __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_3);
              __pyx_cur_scope->__pyx_v_kCGEventRightMouseDown = __pyx_mstate_global->__pyx_int_3;

              /* "ws_package/utils/hardware_event_validator.py":664
 * 
 *                     # Define callback function type
 *                     CGEventTapCallBack = ctypes.CFUNCTYPE(             # <<<<<<<<<<<<<<
 *                         ctypes.c_void_p,  # return type
 *                         ctypes.c_void_p,  # proxy
*/
              __pyx_t_7 = NULL;
              __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 664, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CFUNCTYPE); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 664, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

              /* "ws_package/utils/hardware_event_validator.py":665
 *                     # Define callback function type
 *                     CGEventTapCallBack = ctypes.CFUNCTYPE(
 *                         ctypes.c_void_p,  # return type             # <<<<<<<<<<<<<<
 *                         ctypes.c_void_p,  # proxy
 *                         ctypes.c_int,     # event type
*/
              __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 665, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_c_void_p); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 665, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_16);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

              /* "ws_package/utils/hardware_event_validator.py":666
 *                     CGEventTapCallBack = ctypes.CFUNCTYPE(
 *                         ctypes.c_void_p,  # return type
 *                         ctypes.c_void_p,  # proxy             # <<<<<<<<<<<<<<
 *                         ctypes.c_int,     # event type
 *                         ctypes.c_void_p,  # event
*/
              __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 666, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_c_void_p); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 666, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_17);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

              /* "ws_package/utils/hardware_event_validator.py":667
 *                         ctypes.c_void_p,  # return type
 *                         ctypes.c_void_p,  # proxy
 *                         ctypes.c_int,     # event type             # <<<<<<<<<<<<<<
 *                         ctypes.c_void_p,  # event
 *                         ctypes.c_void_p   # userInfo
*/
              __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 667, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_c_int); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 667, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_18);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

              /* "ws_package/utils/hardware_event_validator.py":668
 *                         ctypes.c_void_p,  # proxy
 *                         ctypes.c_int,     # event type
 *                         ctypes.c_void_p,  # event             # <<<<<<<<<<<<<<
 *                         ctypes.c_void_p   # userInfo
 *                     )
*/
              __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 668, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_c_void_p); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 668, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_19);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

              /* "ws_package/utils/hardware_event_validator.py":669
 *                         ctypes.c_int,     # event type
 *                         ctypes.c_void_p,  # event
 *                         ctypes.c_void_p   # userInfo             # <<<<<<<<<<<<<<
 *                     )
 * 
*/
              __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 669, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_c_void_p); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 669, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_20);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __pyx_t_12 = 1;
              #if CYTHON_UNPACK_METHODS
              if (unlikely(PyMethod_Check(__pyx_t_11))) {
                __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11);
                assert(__pyx_t_7);
                PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
                __Pyx_INCREF(__pyx_t_7);
                __Pyx_INCREF(__pyx__function);
                __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
                __pyx_t_12 = 0;
              }
              #endif
              {
                PyObject *__pyx_callargs[6] = {__pyx_t_7, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_19, __pyx_t_20};
                __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_12, (6-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
                __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
                __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 664, __pyx_L23_error)
                __Pyx_GOTREF(__pyx_t_9);
              }
              __pyx_v_CGEventTapCallBack = __pyx_t_9;
              __pyx_t_9 = 0;

              /* "ws_package/utils/hardware_event_validator.py":673
 * 
 *                     # Create event tap callback
 *                     def event_tap_callback(proxy, event_type, event, user_info):             # <<<<<<<<<<<<<<
 *                         try:
 *                             if event:  # Event is not None
*/
              __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_17_initialize_macos_1event_tap_callback, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__initiali, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 673, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_v_event_tap_callback = __pyx_t_9;
              __pyx_t_9 = 0;

              /* "ws_package/utils/hardware_event_validator.py":703
 * 
 *                     # Create callback reference
 *                     callback_ref = CGEventTapCallBack(event_tap_callback)             # <<<<<<<<<<<<<<
 * 
 *                     # Build event mask
*/
              __pyx_t_11 = NULL;
              __Pyx_INCREF(__pyx_v_CGEventTapCallBack);
              __pyx_t_20 = __pyx_v_CGEventTapCallBack; 
              __pyx_t_12 = 1;
              #if CYTHON_UNPACK_METHODS
              if (unlikely(PyMethod_Check(__pyx_t_20))) {
                __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_20);
                assert(__pyx_t_11);
                PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_20);
                __Pyx_INCREF(__pyx_t_11);
                __Pyx_INCREF(__pyx__function);
                __Pyx_DECREF_SET(__pyx_t_20, __pyx__function);
                __pyx_t_12 = 0;
              }
              #endif
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_event_tap_callback};
                __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_20, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
                if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 703, __pyx_L23_error)
                __Pyx_GOTREF(__pyx_t_9);
              }
              __pyx_v_callback_ref = __pyx_t_9;
              __pyx_t_9 = 0;

              /* "ws_package/utils/hardware_event_validator.py":706
 * 
 *                     # Build event mask
 *                     event_mask = (1 << kCGEventKeyDown) | (1 << kCGEventKeyUp) | \             # <<<<<<<<<<<<<<
 *                                 (1 << kCGEventMouseMoved) | (1 << kCGEventLeftMouseDown) | (1 << kCGEventRightMouseDown)
 * 
*/
              __pyx_t_9 = PyNumber_Lshift(__pyx_mstate_global->__pyx_int_1, __pyx_cur_scope->__pyx_v_kCGEventKeyDown); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 706, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_20 = PyNumber_Lshift(__pyx_mstate_global->__pyx_int_1, __pyx_cur_scope->__pyx_v_kCGEventKeyUp); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 706, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_20);
              __pyx_t_11 = PyNumber_Or(__pyx_t_9, __pyx_t_20); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 706, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

              /* "ws_package/utils/hardware_event_validator.py":707
 *                     # Build event mask
 *                     event_mask = (1 << kCGEventKeyDown) | (1 << kCGEventKeyUp) | \
 *                                 (1 << kCGEventMouseMoved) | (1 << kCGEventLeftMouseDown) | (1 << kCGEventRightMouseDown)             # <<<<<<<<<<<<<<
 * 
 *                     # Set up CGEventTapCreate function signature
*/
              __pyx_t_20 = PyNumber_Lshift(__pyx_mstate_global->__pyx_int_1, __pyx_cur_scope->__pyx_v_kCGEventMouseMoved); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 707, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_20);

              /* "ws_package/utils/hardware_event_validator.py":706
 * 
 *                     # Build event mask
 *                     event_mask = (1 << kCGEventKeyDown) | (1 << kCGEventKeyUp) | \             # <<<<<<<<<<<<<<
 *                                 (1 << kCGEventMouseMoved) | (1 << kCGEventLeftMouseDown) | (1 << kCGEventRightMouseDown)
 * 
*/
              __pyx_t_9 = PyNumber_Or(__pyx_t_11, __pyx_t_20); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 706, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

              /* "ws_package/utils/hardware_event_validator.py":707
 *                     # Build event mask
 *                     event_mask = (1 << kCGEventKeyDown) | (1 << kCGEventKeyUp) | \
 *                                 (1 << kCGEventMouseMoved) | (1 << kCGEventLeftMouseDown) | (1 << kCGEventRightMouseDown)             # <<<<<<<<<<<<<<
 * 
 *                     # Set up CGEventTapCreate function signature
*/
              __pyx_t_20 = PyNumber_Lshift(__pyx_mstate_global->__pyx_int_1, __pyx_cur_scope->__pyx_v_kCGEventLeftMouseDown); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 707, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_20);
              __pyx_t_11 = PyNumber_Or(__pyx_t_9, __pyx_t_20); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 707, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              __pyx_t_20 = PyNumber_Lshift(__pyx_mstate_global->__pyx_int_1, __pyx_cur_scope->__pyx_v_kCGEventRightMouseDown); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 707, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_20);
              __pyx_t_9 = PyNumber_Or(__pyx_t_11, __pyx_t_20); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 707, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              __pyx_v_event_mask = __pyx_t_9;
              __pyx_t_9 = 0;

              /* "ws_package/utils/hardware_event_validator.py":712
 *                     # CGEventTapCreate(tap, place, options, eventsOfInterest, callback, userInfo)
 *                     quartz.CGEventTapCreate.argtypes = [
 *                         ctypes.c_uint32,  # tap (CGEventTapLocation)             # <<<<<<<<<<<<<<
 *                         ctypes.c_uint32,  # place (CGEventTapPlacement)
 *                         ctypes.c_uint32,  # options (CGEventTapOptions)
*/
              __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 712, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_c_uint32); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 712, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_20);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

              /* "ws_package/utils/hardware_event_validator.py":713
 *                     quartz.CGEventTapCreate.argtypes = [
 *                         ctypes.c_uint32,  # tap (CGEventTapLocation)
 *                         ctypes.c_uint32,  # place (CGEventTapPlacement)             # <<<<<<<<<<<<<<
 *                         ctypes.c_uint32,  # options (CGEventTapOptions)
 *                         ctypes.c_uint64,  # eventsOfInterest (CGEventMask)
*/
              __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 713, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_c_uint32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 713, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

              /* "ws_package/utils/hardware_event_validator.py":714
 *                         ctypes.c_uint32,  # tap (CGEventTapLocation)
 *                         ctypes.c_uint32,  # place (CGEventTapPlacement)
 *                         ctypes.c_uint32,  # options (CGEventTapOptions)             # <<<<<<<<<<<<<<
 *                         ctypes.c_uint64,  # eventsOfInterest (CGEventMask)
 *                         CGEventTapCallBack,  # callback
*/
              __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 714, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_c_uint32); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 714, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_19);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

              /* "ws_package/utils/hardware_event_validator.py":715
 *                         ctypes.c_uint32,  # place (CGEventTapPlacement)
 *                         ctypes.c_uint32,  # options (CGEventTapOptions)
 *                         ctypes.c_uint64,  # eventsOfInterest (CGEventMask)             # <<<<<<<<<<<<<<
 *                         CGEventTapCallBack,  # callback
 *                         ctypes.c_void_p   # userInfo
*/
              __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 715, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_c_uint64); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 715, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_18);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

              /* "ws_package/utils/hardware_event_validator.py":717
 *                         ctypes.c_uint64,  # eventsOfInterest (CGEventMask)
 *                         CGEventTapCallBack,  # callback
 *                         ctypes.c_void_p   # userInfo             # <<<<<<<<<<<<<<
 *                     ]
 *                     quartz.CGEventTapCreate.restype = ctypes.c_void_p
*/
              __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 717, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_c_void_p); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 717, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_17);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

              /* "ws_package/utils/hardware_event_validator.py":711
 *                     # Set up CGEventTapCreate function signature
 *                     # CGEventTapCreate(tap, place, options, eventsOfInterest, callback, userInfo)
 *                     quartz.CGEventTapCreate.argtypes = [             # <<<<<<<<<<<<<<
 *                         ctypes.c_uint32,  # tap (CGEventTapLocation)
 *                         ctypes.c_uint32,  # place (CGEventTapPlacement)
*/
              __pyx_t_9 = PyList_New(6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 711, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_GIVEREF(__pyx_t_20);
              if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_20) != (0)) __PYX_ERR(0, 711, __pyx_L23_error);
              __Pyx_GIVEREF(__pyx_t_11);
              if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 711, __pyx_L23_error);
              __Pyx_GIVEREF(__pyx_t_19);
              if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_19) != (0)) __PYX_ERR(0, 711, __pyx_L23_error);
              __Pyx_GIVEREF(__pyx_t_18);
              if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 3, __pyx_t_18) != (0)) __PYX_ERR(0, 711, __pyx_L23_error);
              __Pyx_INCREF(__pyx_v_CGEventTapCallBack);
              __Pyx_GIVEREF(__pyx_v_CGEventTapCallBack);
              if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 4, __pyx_v_CGEventTapCallBack) != (0)) __PYX_ERR(0, 711, __pyx_L23_error);
              __Pyx_GIVEREF(__pyx_t_17);
              if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 5, __pyx_t_17) != (0)) __PYX_ERR(0, 711, __pyx_L23_error);
              __pyx_t_20 = 0;
              __pyx_t_11 = 0;
              __pyx_t_19 = 0;
              __pyx_t_18 = 0;
              __pyx_t_17 = 0;
              __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_quartz, __pyx_mstate_global->__pyx_n_u_CGEventTapCreate); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 711, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_17);
              if (__Pyx_PyObject_SetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_argtypes, __pyx_t_9) < (0)) __PYX_ERR(0, 711, __pyx_L23_error)
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

              /* "ws_package/utils/hardware_event_validator.py":719
 *                         ctypes.c_void_p   # userInfo
 *                     ]
 *                     quartz.CGEventTapCreate.restype = ctypes.c_void_p             # <<<<<<<<<<<<<<
 * 
 *                     # Set up CGEventTapEnable
*/
              __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 719, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_17);
              __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_c_void_p); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 719, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
              __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_quartz, __pyx_mstate_global->__pyx_n_u_CGEventTapCreate); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 719, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_17);
              if (__Pyx_PyObject_SetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_restype, __pyx_t_9) < (0)) __PYX_ERR(0, 719, __pyx_L23_error)
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

              /* "ws_package/utils/hardware_event_validator.py":722
 * 
 *                     # Set up CGEventTapEnable
 *                     quartz.CGEventTapEnable.argtypes = [ctypes.c_void_p, ctypes.c_bool]             # <<<<<<<<<<<<<<
 *                     quartz.CGEventTapEnable.restype = ctypes.c_bool
 * 
*/
              __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 722, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_17);
              __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_c_void_p); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 722, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
              __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 722, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_17);
              __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_c_bool); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 722, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_18);
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
              __pyx_t_17 = PyList_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 722, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_17);
              __Pyx_GIVEREF(__pyx_t_9);
              if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 0, __pyx_t_9) != (0)) __PYX_ERR(0, 722, __pyx_L23_error);
              __Pyx_GIVEREF(__pyx_t_18);
              if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 1, __pyx_t_18) != (0)) __PYX_ERR(0, 722, __pyx_L23_error);
              __pyx_t_9 = 0;
              __pyx_t_18 = 0;
              __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_quartz, __pyx_mstate_global->__pyx_n_u_CGEventTapEnable); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 722, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_18);
              if (__Pyx_PyObject_SetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_argtypes, __pyx_t_17) < (0)) __PYX_ERR(0, 722, __pyx_L23_error)
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
              __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

              /* "ws_package/utils/hardware_event_validator.py":723
 *                     # Set up CGEventTapEnable
 *                     quartz.CGEventTapEnable.argtypes = [ctypes.c_void_p, ctypes.c_bool]
 *                     quartz.CGEventTapEnable.restype = ctypes.c_bool             # <<<<<<<<<<<<<<
 * 
 *                     # Set up CGEventGetIntegerValueField
*/
              __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 723, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_18);
              __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_c_bool); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 723, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_17);
              __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
              __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_quartz, __pyx_mstate_global->__pyx_n_u_CGEventTapEnable); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 723, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_18);
              if (__Pyx_PyObject_SetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_restype, __pyx_t_17) < (0)) __PYX_ERR(0, 723, __pyx_L23_error)
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
              __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

              /* "ws_package/utils/hardware_event_validator.py":726
 * 
 *                     # Set up CGEventGetIntegerValueField
 *                     quartz.CGEventGetIntegerValueField.argtypes = [ctypes.c_void_p, ctypes.c_uint64]             # <<<<<<<<<<<<<<
 *                     quartz.CGEventGetIntegerValueField.restype = ctypes.c_int64
 * 
*/
              __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 726, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_18);
              __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_c_void_p); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 726, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_17);
              __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
              __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 726, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_18);
              __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_c_uint64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 726, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
              __pyx_t_18 = PyList_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 726, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_18);
              __Pyx_GIVEREF(__pyx_t_17);
              if (__Pyx_PyList_SET_ITEM(__pyx_t_18, 0, __pyx_t_17) != (0)) __PYX_ERR(0, 726, __pyx_L23_error);
              __Pyx_GIVEREF(__pyx_t_9);
              if (__Pyx_PyList_SET_ITEM(__pyx_t_18, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 726, __pyx_L23_error);
              __pyx_t_17 = 0;
              __pyx_t_9 = 0;
              __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_quartz, __pyx_mstate_global->__pyx_n_u_CGEventGetIntegerValueField); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 726, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_9);
              if (__Pyx_PyObject_SetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_argtypes, __pyx_t_18) < (0)) __PYX_ERR(0, 726, __pyx_L23_error)
              __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

              /* "ws_package/utils/hardware_event_validator.py":727
 *                     # Set up CGEventGetIntegerValueField
 *                     quartz.CGEventGetIntegerValueField.argtypes = [ctypes.c_void_p, ctypes.c_uint64]
 *                     quartz.CGEventGetIntegerValueField.restype = ctypes.c_int64             # <<<<<<<<<<<<<<
 * 
 *                     # Create event tap (may require accessibility permissions)
*/
              __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_ctypes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 727, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_c_int64); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 727, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_18);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_quartz, __pyx_mstate_global->__pyx_n_u_CGEventGetIntegerValueField); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 727, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_9);
              if (__Pyx_PyObject_SetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_restype, __pyx_t_18) < (0)) __PYX_ERR(0, 727, __pyx_L23_error)
              __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

              /* "ws_package/utils/hardware_event_validator.py":731
 *                     # Create event tap (may require accessibility permissions)
 *                     # Parameters: tap location, placement, options, event mask, callback, userInfo
 *                     event_tap = quartz.CGEventTapCreate(             # <<<<<<<<<<<<<<
 *                         kCGHeadInsertEventTap,  # tap location
 *                         0,  # placement (0 = head, 1 = tail)
*/
              __pyx_t_18 = __pyx_cur_scope->__pyx_v_quartz;
              __Pyx_INCREF(__pyx_t_18);

              /* "ws_package/utils/hardware_event_validator.py":732
 *                     # Parameters: tap location, placement, options, event mask, callback, userInfo
 *                     event_tap = quartz.CGEventTapCreate(
 *                         kCGHeadInsertEventTap,  # tap location             # <<<<<<<<<<<<<<
 *                         0,  # placement (0 = head, 1 = tail)
 *                         kCGEventTapOptionDefault,  # options
*/
              __pyx_t_17 = __Pyx_PyLong_From_long(__pyx_v_kCGHeadInsertEventTap); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 732, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_17);

              /* "ws_package/utils/hardware_event_validator.py":734
 *                         kCGHeadInsertEventTap,  # tap location
 *                         0,  # placement (0 = head, 1 = tail)
 *                         kCGEventTapOptionDefault,  # options             # <<<<<<<<<<<<<<
 *                         event_mask,  # events of interest
 *                         callback_ref,  # callback
*/
              __pyx_t_19 = __Pyx_PyLong_From_long(__pyx_v_kCGEventTapOptionDefault); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 734, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_19);

              /* "ws_package/utils/hardware_event_validator.py":737
 *                         event_mask,  # events of interest
 *                         callback_ref,  # callback
 *                         None  # userInfo             # <<<<<<<<<<<<<<
 *                     )
 * 
*/
              __pyx_t_12 = 0;
              {
                PyObject *__pyx_callargs[7] = {__pyx_t_18, __pyx_t_17, __pyx_mstate_global->__pyx_int_0, __pyx_t_19, __pyx_v_event_mask, __pyx_v_callback_ref, Py_None};
                __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_CGEventTapCreate, __pyx_callargs+__pyx_t_12, (7-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
                __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 731, __pyx_L23_error)
                __Pyx_GOTREF(__pyx_t_9);
              }
              __pyx_v_event_tap = __pyx_t_9;
              __pyx_t_9 = 0;

              /* "ws_package/utils/hardware_event_validator.py":740
 *                     )
 * 
 *                     if event_tap and event_tap != 0:             # <<<<<<<<<<<<<<
 *                         # Enable the event tap
 *                         enabled = quartz.CGEventTapEnable(event_tap, True)
*/
              __pyx_t_22 = __Pyx_PyObject_IsTrue(__pyx_v_event_tap); if (unlikely((__pyx_t_22 < 0))) __PYX_ERR(0, 740, __pyx_L23_error)
              if (__pyx_t_22) {
              } else {
                __pyx_t_21 = __pyx_t_22;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_22 = (__Pyx_PyLong_BoolNeObjC(__pyx_v_event_tap, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_22 < 0))) __PYX_ERR(0, 740, __pyx_L23_error)
              __pyx_t_21 = __pyx_t_22;
              __pyx_L30_bool_binop_done:;
              if (__pyx_t_21) {

                /* "ws_package/utils/hardware_event_validator.py":742
 *                     if event_tap and event_tap != 0:
 *                         # Enable the event tap
 *                         enabled = quartz.CGEventTapEnable(event_tap, True)             # <<<<<<<<<<<<<<
 *                         if enabled:
 *                             self._macos_event_tap = event_tap
*/
                __pyx_t_19 = __pyx_cur_scope->__pyx_v_quartz;
                __Pyx_INCREF(__pyx_t_19);
                __pyx_t_12 = 0;
                {
                  PyObject *__pyx_callargs[3] = {__pyx_t_19, __pyx_v_event_tap, Py_True};
                  __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_CGEventTapEnable, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
                  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 742, __pyx_L23_error)
                  __Pyx_GOTREF(__pyx_t_9);
                }
                __pyx_v_enabled = __pyx_t_9;
                __pyx_t_9 = 0;

                /* "ws_package/utils/hardware_event_validator.py":743
 *                         # Enable the event tap
 *                         enabled = quartz.CGEventTapEnable(event_tap, True)
 *                         if enabled:             # <<<<<<<<<<<<<<
 *                             self._macos_event_tap = event_tap
 *                             self._macos_event_tap_callback = callback_ref  # Keep reference to prevent GC
*/
                __pyx_t_21 = __Pyx_PyObject_IsTrue(__pyx_v_enabled); if (unlikely((__pyx_t_21 < 0))) __PYX_ERR(0, 743, __pyx_L23_error)
                if (__pyx_t_21) {

                  /* "ws_package/utils/hardware_event_validator.py":744
 *                         enabled = quartz.CGEventTapEnable(event_tap, True)
 *                         if enabled:
 *                             self._macos_event_tap = event_tap             # <<<<<<<<<<<<<<
 *                             self._macos_event_tap_callback = callback_ref  # Keep reference to prevent GC
 *                             self._macos_quartz_available = True
*/
                  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_event_tap, __pyx_v_event_tap) < (0)) __PYX_ERR(0, 744, __pyx_L23_error)

                  /* "ws_package/utils/hardware_event_validator.py":745
 *                         if enabled:
 *                             self._macos_event_tap = event_tap
 *                             self._macos_event_tap_callback = callback_ref  # Keep reference to prevent GC             # <<<<<<<<<<<<<<
 *                             self._macos_quartz_available = True
 *                             logger.info("macOS hardware event validation initialized with CGEventTap")
*/
                  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_event_tap_callback, __pyx_v_callback_ref) < (0)) __PYX_ERR(0, 745, __pyx_L23_error)

                  /* "ws_package/utils/hardware_event_validator.py":746
 *                             self._macos_event_tap = event_tap
 *                             self._macos_event_tap_callback = callback_ref  # Keep reference to prevent GC
 *                             self._macos_quartz_available = True             # <<<<<<<<<<<<<<
 *                             logger.info("macOS hardware event validation initialized with CGEventTap")
 *                         else:
*/
                  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_quartz_available, Py_True) < (0)) __PYX_ERR(0, 746, __pyx_L23_error)

                  /* "ws_package/utils/hardware_event_validator.py":747
 *                             self._macos_event_tap_callback = callback_ref  # Keep reference to prevent GC
 *                             self._macos_quartz_available = True
 *                             logger.info("macOS hardware event validation initialized with CGEventTap")             # <<<<<<<<<<<<<<
 *                         else:
 *                             logger.warning("CGEventTapEnable failed - accepting all events")
*/
                  __pyx_t_19 = NULL;
                  __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 747, __pyx_L23_error)
                  __Pyx_GOTREF(__pyx_t_17);
                  __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_info); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 747, __pyx_L23_error)
                  __Pyx_GOTREF(__pyx_t_18);
                  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                  __pyx_t_12 = 1;
                  #if CYTHON_UNPACK_METHODS
                  if (unlikely(PyMethod_Check(__pyx_t_18))) {
                    __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_18);
                    assert(__pyx_t_19);
                    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18);
                    __Pyx_INCREF(__pyx_t_19);
                    __Pyx_INCREF(__pyx__function);
                    __Pyx_DECREF_SET(__pyx_t_18, __pyx__function);
                    __pyx_t_12 = 0;
                  }
                  #endif
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_19, __pyx_mstate_global->__pyx_kp_u_macOS_hardware_event_validation_2};
                    __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_18, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
                    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 747, __pyx_L23_error)
                    __Pyx_GOTREF(__pyx_t_9);
                  }
                  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

                  /* "ws_package/utils/hardware_event_validator.py":743
 *                         # Enable the event tap
 *                         enabled = quartz.CGEventTapEnable(event_tap, True)
 *                         if enabled:             # <<<<<<<<<<<<<<
 *                             self._macos_event_tap = event_tap
 *                             self._macos_event_tap_callback = callback_ref  # Keep reference to prevent GC
*/
                  goto __pyx_L32;
                }

                /* "ws_package/utils/hardware_event_validator.py":749
 *                             logger.info("macOS hardware event validation initialized with CGEventTap")
 *                         else:
 *                             logger.warning("CGEventTapEnable failed - accepting all events")             # <<<<<<<<<<<<<<
 *                             self._macos_quartz_available = False
 *                     else:
*/
                /*else*/ {
                  __pyx_t_18 = NULL;
                  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 749, __pyx_L23_error)
                  __Pyx_GOTREF(__pyx_t_19);
                  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 749, __pyx_L23_error)
                  __Pyx_GOTREF(__pyx_t_17);
                  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                  __pyx_t_12 = 1;
                  #if CYTHON_UNPACK_METHODS
                  if (unlikely(PyMethod_Check(__pyx_t_17))) {
                    __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17);
                    assert(__pyx_t_18);
                    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_17);
                    __Pyx_INCREF(__pyx_t_18);
                    __Pyx_INCREF(__pyx__function);
                    __Pyx_DECREF_SET(__pyx_t_17, __pyx__function);
                    __pyx_t_12 = 0;
                  }
                  #endif
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_18, __pyx_mstate_global->__pyx_kp_u_CGEventTapEnable_failed_acceptin};
                    __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_17, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
                    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 749, __pyx_L23_error)
                    __Pyx_GOTREF(__pyx_t_9);
                  }
                  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

                  /* "ws_package/utils/hardware_event_validator.py":750
 *                         else:
 *                             logger.warning("CGEventTapEnable failed - accepting all events")
 *                             self._macos_quartz_available = False             # <<<<<<<<<<<<<<
 *                     else:
 *                         # Event tap creation failed (likely permissions) - disable validation
*/
                  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_quartz_available, Py_False) < (0)) __PYX_ERR(0, 750, __pyx_L23_error)
                }
                __pyx_L32:;

                /* "ws_package/utils/hardware_event_validator.py":740
 *                     )
 * 
 *                     if event_tap and event_tap != 0:             # <<<<<<<<<<<<<<
 *                         # Enable the event tap
 *                         enabled = quartz.CGEventTapEnable(event_tap, True)
*/
                goto __pyx_L29;
              }

              /* "ws_package/utils/hardware_event_validator.py":753
 *                     else:
 *                         # Event tap creation failed (likely permissions) - disable validation
 *                         logger.warning("CGEventTap creation failed (may need accessibility permissions) - accepting all events")             # <<<<<<<<<<<<<<
 *                         self._macos_quartz_available = False
 * 
*/
              /*else*/ {
                __pyx_t_17 = NULL;
                __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 753, __pyx_L23_error)
                __Pyx_GOTREF(__pyx_t_18);
                __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 753, __pyx_L23_error)
                __Pyx_GOTREF(__pyx_t_19);
                __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                __pyx_t_12 = 1;
                #if CYTHON_UNPACK_METHODS
                if (unlikely(PyMethod_Check(__pyx_t_19))) {
                  __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_19);
                  assert(__pyx_t_17);
                  PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_19);
                  __Pyx_INCREF(__pyx_t_17);
                  __Pyx_INCREF(__pyx__function);
                  __Pyx_DECREF_SET(__pyx_t_19, __pyx__function);
                  __pyx_t_12 = 0;
                }
                #endif
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_mstate_global->__pyx_kp_u_CGEventTap_creation_failed_may_n};
                  __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_19, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
                  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 753, __pyx_L23_error)
                  __Pyx_GOTREF(__pyx_t_9);
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

                /* "ws_package/utils/hardware_event_validator.py":754
 *                         # Event tap creation failed (likely permissions) - disable validation
 *                         logger.warning("CGEventTap creation failed (may need accessibility permissions) - accepting all events")
 *                         self._macos_quartz_available = False             # <<<<<<<<<<<<<<
 * 
 *                 except Exception as e2:
*/
                if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_quartz_available, Py_False) < (0)) __PYX_ERR(0, 754, __pyx_L23_error)
              }
              __pyx_L29:;

              /* "ws_package/utils/hardware_event_validator.py":651
 *                 # Try to set up CGEventTap to monitor events
 *                 # Note: This requires accessibility permissions
 *                 try:             # <<<<<<<<<<<<<<
 *                     # Constants for event tap
 *                     kCGEventTapOptionDefault = 0x00000000
*/
            }
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            goto __pyx_L28_try_end;
            __pyx_L23_error:;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
            __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
            __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "ws_package/utils/hardware_event_validator.py":756
 *                         self._macos_quartz_available = False
 * 
 *                 except Exception as e2:             # <<<<<<<<<<<<<<
 *                     logger.debug("Could not create CGEventTap: %s - accepting all events", e2)
 *                     self._macos_quartz_available = False
*/
            __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
            if (__pyx_t_13) {
              __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._initialize_macos", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_19, &__pyx_t_17) < 0) __PYX_ERR(0, 756, __pyx_L25_except_error)
              __Pyx_XGOTREF(__pyx_t_9);
              __Pyx_XGOTREF(__pyx_t_19);
              __Pyx_XGOTREF(__pyx_t_17);
              __Pyx_INCREF(__pyx_t_19);
              __pyx_v_e2 = __pyx_t_19;
              /*try:*/ {

                /* "ws_package/utils/hardware_event_validator.py":757
 * 
 *                 except Exception as e2:
 *                     logger.debug("Could not create CGEventTap: %s - accepting all events", e2)             # <<<<<<<<<<<<<<
 *                     self._macos_quartz_available = False
 * 
*/
                __pyx_t_11 = NULL;
                __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 757, __pyx_L38_error)
                __Pyx_GOTREF(__pyx_t_20);
                __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 757, __pyx_L38_error)
                __Pyx_GOTREF(__pyx_t_16);
                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
                __pyx_t_12 = 1;
                #if CYTHON_UNPACK_METHODS
                if (unlikely(PyMethod_Check(__pyx_t_16))) {
                  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_16);
                  assert(__pyx_t_11);
                  PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
                  __Pyx_INCREF(__pyx_t_11);
                  __Pyx_INCREF(__pyx__function);
                  __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
                  __pyx_t_12 = 0;
                }
                #endif
                {
                  PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_Could_not_create_CGEventTap_s_ac, __pyx_v_e2};
                  __pyx_t_18 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
                  if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 757, __pyx_L38_error)
                  __Pyx_GOTREF(__pyx_t_18);
                }
                __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

                /* "ws_package/utils/hardware_event_validator.py":758
 *                 except Exception as e2:
 *                     logger.debug("Could not create CGEventTap: %s - accepting all events", e2)
 *                     self._macos_quartz_available = False             # <<<<<<<<<<<<<<
 * 
 *             except Exception as e:
*/
                if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_quartz_available, Py_False) < (0)) __PYX_ERR(0, 758, __pyx_L38_error)
              }

              /* "ws_package/utils/hardware_event_validator.py":756
 *                         self._macos_quartz_available = False
 * 
 *                 except Exception as e2:             # <<<<<<<<<<<<<<
 *                     logger.debug("Could not create CGEventTap: %s - accepting all events", e2)
 *                     self._macos_quartz_available = False
*/
              /*finally:*/ {
                /*normal exit:*/{
                  __Pyx_DECREF(__pyx_v_e2); __pyx_v_e2 = 0;
                  goto __pyx_L39;
                }
                __pyx_L38_error:;
                /*exception exit:*/{
                  __Pyx_PyThreadState_declare
                  __Pyx_PyThreadState_assign
                  __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0; __pyx_t_30 = 0;
                  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
                  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                  __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
                  __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
                  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                   __Pyx_ExceptionSwap(&__pyx_t_28, &__pyx_t_29, &__pyx_t_30);
                  if ( unlikely(__Pyx_GetException(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27) < 0)) __Pyx_ErrFetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
                  __Pyx_XGOTREF(__pyx_t_25);
                  __Pyx_XGOTREF(__pyx_t_26);
                  __Pyx_XGOTREF(__pyx_t_27);
                  __Pyx_XGOTREF(__pyx_t_28);
                  __Pyx_XGOTREF(__pyx_t_29);
                  __Pyx_XGOTREF(__pyx_t_30);
                  __pyx_t_13 = __pyx_lineno; __pyx_t_23 = __pyx_clineno; __pyx_t_24 = __pyx_filename;
                  {
                    __Pyx_DECREF(__pyx_v_e2); __pyx_v_e2 = 0;
                  }
                  __Pyx_XGIVEREF(__pyx_t_28);
                  __Pyx_XGIVEREF(__pyx_t_29);
                  __Pyx_XGIVEREF(__pyx_t_30);
                  __Pyx_ExceptionReset(__pyx_t_28, __pyx_t_29, __pyx_t_30);
                  __Pyx_XGIVEREF(__pyx_t_25);
                  __Pyx_XGIVEREF(__pyx_t_26);
                  __Pyx_XGIVEREF(__pyx_t_27);
                  __Pyx_ErrRestore(__pyx_t_25, __pyx_t_26, __pyx_t_27);
                  __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0; __pyx_t_30 = 0;
                  __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_23; __pyx_filename = __pyx_t_24;
                  goto __pyx_L25_except_error;
                }
                __pyx_L39:;
              }
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
              __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
              goto __pyx_L24_exception_handled;
            }
            goto __pyx_L25_except_error;

            /* "ws_package/utils/hardware_event_validator.py":651
 *                 # Try to set up CGEventTap to monitor events
 *                 # Note: This requires accessibility permissions
 *                 try:             # <<<<<<<<<<<<<<
 *                     # Constants for event tap
 *                     kCGEventTapOptionDefault = 0x00000000
*/
            __pyx_L25_except_error:;
            __Pyx_XGIVEREF(__pyx_t_8);
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_14, __pyx_t_15);
            goto __pyx_L17_error;
            __pyx_L24_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_8);
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_14, __pyx_t_15);
            __pyx_L28_try_end:;
          }

          /* "ws_package/utils/hardware_event_validator.py":627
 * 
 *             # Fallback: ctypes CGEventTap (legacy pynput path)
 *             try:             # <<<<<<<<<<<<<<
 *                 # Load Quartz framework
 *                 quartz = ctypes.CDLL('/System/Library/Frameworks/ApplicationServices.framework/ApplicationServices')
*/
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L22_try_end;
        __pyx_L17_error:;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "ws_package/utils/hardware_event_validator.py":760
 *                     self._macos_quartz_available = False
 * 
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 logger.warning("Could not load Quartz framework: %s", e)
 *                 self._macos_quartz_available = False
*/
        __pyx_t_23 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
        if (__pyx_t_23) {
          __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._initialize_macos", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_17, &__pyx_t_19, &__pyx_t_9) < 0) __PYX_ERR(0, 760, __pyx_L19_except_error)
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_19);
          __pyx_v_e = __pyx_t_19;
          /*try:*/ {

            /* "ws_package/utils/hardware_event_validator.py":761
 * 
 *             except Exception as e:
 *                 logger.warning("Could not load Quartz framework: %s", e)             # <<<<<<<<<<<<<<
 *                 self._macos_quartz_available = False
 * 
*/
            __pyx_t_16 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 761, __pyx_L49_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 761, __pyx_L49_error)
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_12 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_20))) {
              __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_20);
              assert(__pyx_t_16);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_20);
              __Pyx_INCREF(__pyx_t_16);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_20, __pyx__function);
              __pyx_t_12 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_mstate_global->__pyx_kp_u_Could_not_load_Quartz_framework, __pyx_v_e};
              __pyx_t_18 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_20, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 761, __pyx_L49_error)
              __Pyx_GOTREF(__pyx_t_18);
            }
            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

            /* "ws_package/utils/hardware_event_validator.py":762
 *             except Exception as e:
 *                 logger.warning("Could not load Quartz framework: %s", e)
 *                 self._macos_quartz_available = False             # <<<<<<<<<<<<<<
 * 
 *             if self._macos_quartz_available:
*/
            if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_quartz_available, Py_False) < (0)) __PYX_ERR(0, 762, __pyx_L49_error)
          }

          /* "ws_package/utils/hardware_event_validator.py":760
 *                     self._macos_quartz_available = False
 * 
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 logger.warning("Could not load Quartz framework: %s", e)
 *                 self._macos_quartz_available = False
*/
          /*finally:*/ {
            /*normal exit:*/{
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              goto __pyx_L50;
            }
            __pyx_L49_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_8 = 0; __pyx_t_30 = 0; __pyx_t_29 = 0; __pyx_t_28 = 0;
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
              __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
               __Pyx_ExceptionSwap(&__pyx_t_30, &__pyx_t_29, &__pyx_t_28);
              if ( unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_14, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_8);
              __Pyx_XGOTREF(__pyx_t_15);
              __Pyx_XGOTREF(__pyx_t_14);
              __Pyx_XGOTREF(__pyx_t_8);
              __Pyx_XGOTREF(__pyx_t_30);
              __Pyx_XGOTREF(__pyx_t_29);
              __Pyx_XGOTREF(__pyx_t_28);
              __pyx_t_23 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_31 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              }
              __Pyx_XGIVEREF(__pyx_t_30);
              __Pyx_XGIVEREF(__pyx_t_29);
              __Pyx_XGIVEREF(__pyx_t_28);
              __Pyx_ExceptionReset(__pyx_t_30, __pyx_t_29, __pyx_t_28);
              __Pyx_XGIVEREF(__pyx_t_15);
              __Pyx_XGIVEREF(__pyx_t_14);
              __Pyx_XGIVEREF(__pyx_t_8);
              __Pyx_ErrRestore(__pyx_t_15, __pyx_t_14, __pyx_t_8);
              __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_8 = 0; __pyx_t_30 = 0; __pyx_t_29 = 0; __pyx_t_28 = 0;
              __pyx_lineno = __pyx_t_23; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_31;
              goto __pyx_L19_except_error;
            }
            __pyx_L50:;
          }
          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L18_exception_handled;
        }
        goto __pyx_L19_except_error;

        /* "ws_package/utils/hardware_event_validator.py":627
 * 
 *             # Fallback: ctypes CGEventTap (legacy pynput path)
 *             try:             # <<<<<<<<<<<<<<
 *                 # Load Quartz framework
 *                 quartz = ctypes.CDLL('/System/Library/Frameworks/ApplicationServices.framework/ApplicationServices')
*/
        __pyx_L19_except_error:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4);
        goto __pyx_L3_error;
        __pyx_L18_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4);
        __pyx_L22_try_end:;
      }

      /* "ws_package/utils/hardware_event_validator.py":764
 *                 self._macos_quartz_available = False
 * 
 *             if self._macos_quartz_available:             # <<<<<<<<<<<<<<
 *                 self._enabled = True
 *             else:
*/
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_quartz_available); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 764, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_21 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_21 < 0))) __PYX_ERR(0, 764, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (__pyx_t_21) {

        /* "ws_package/utils/hardware_event_validator.py":765
 * 
 *             if self._macos_quartz_available:
 *                 self._enabled = True             # <<<<<<<<<<<<<<
 *             else:
 *                 self._enabled = False
*/
        if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_enabled, Py_True) < (0)) __PYX_ERR(0, 765, __pyx_L3_error)

        /* "ws_package/utils/hardware_event_validator.py":764
 *                 self._macos_quartz_available = False
 * 
 *             if self._macos_quartz_available:             # <<<<<<<<<<<<<<
 *                 self._enabled = True
 *             else:
*/
        goto __pyx_L55;
      }

      /* "ws_package/utils/hardware_event_validator.py":767
 *                 self._enabled = True
 *             else:
 *                 self._enabled = False             # <<<<<<<<<<<<<<
 *                 logger.info("macOS hardware validation disabled - will accept all events")
 * 
*/
      /*else*/ {
        if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_enabled, Py_False) < (0)) __PYX_ERR(0, 767, __pyx_L3_error)

        /* "ws_package/utils/hardware_event_validator.py":768
 *             else:
 *                 self._enabled = False
 *                 logger.info("macOS hardware validation disabled - will accept all events")             # <<<<<<<<<<<<<<
 * 
 *         except Exception as e:
*/
        __pyx_t_19 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 768, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_info); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 768, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_18);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_12 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_18))) {
          __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_18);
          assert(__pyx_t_19);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18);
          __Pyx_INCREF(__pyx_t_19);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_18, __pyx__function);
          __pyx_t_12 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_19, __pyx_mstate_global->__pyx_kp_u_macOS_hardware_validation_disabl};
          __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_18, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 768, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
        }
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __pyx_L55:;

      /* "ws_package/utils/hardware_event_validator.py":610
 *     def _initialize_macos(self):
 *         """Initialize macOS CGEvent API for event validation"""
 *         try:             # <<<<<<<<<<<<<<
 *             # Primary path: MacCGEventListener passes Quartz CGEvent objects directly.
 *             # Reading kCGEventSourceStateID on the event is reliable; a secondary ctypes
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
    __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "ws_package/utils/hardware_event_validator.py":770
 *                 logger.info("macOS hardware validation disabled - will accept all events")
 * 
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.warning("Failed to initialize macOS hardware detection: %s", e)
 *             self._enabled = False
*/
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._initialize_macos", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_18, &__pyx_t_19) < 0) __PYX_ERR(0, 770, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_INCREF(__pyx_t_18);
      __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_18);
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":771
 * 
 *         except Exception as e:
 *             logger.warning("Failed to initialize macOS hardware detection: %s", e)             # <<<<<<<<<<<<<<
 *             self._enabled = False
 * 
*/
        __pyx_t_20 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 771, __pyx_L61_error)
        __Pyx_GOTREF(__pyx_t_16);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 771, __pyx_L61_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __pyx_t_12 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_11);
          assert(__pyx_t_20);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_20);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
          __pyx_t_12 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_20, __pyx_mstate_global->__pyx_kp_u_Failed_to_initialize_macOS_hardw, __pyx_v_e};
          __pyx_t_17 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 771, __pyx_L61_error)
          __Pyx_GOTREF(__pyx_t_17);
        }
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

        /* "ws_package/utils/hardware_event_validator.py":772
 *         except Exception as e:
 *             logger.warning("Failed to initialize macOS hardware detection: %s", e)
 *             self._enabled = False             # <<<<<<<<<<<<<<
 * 
 *     def _initialize_linux(self):
*/
        if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_enabled, Py_False) < (0)) __PYX_ERR(0, 772, __pyx_L61_error)
      }

      /* "ws_package/utils/hardware_event_validator.py":770
 *                 logger.info("macOS hardware validation disabled - will accept all events")
 * 
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.warning("Failed to initialize macOS hardware detection: %s", e)
 *             self._enabled = False
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          goto __pyx_L62;
        }
        __pyx_L61_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0; __pyx_t_30 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_28, &__pyx_t_29, &__pyx_t_30);
          if ( unlikely(__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0)) __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_28);
          __Pyx_XGOTREF(__pyx_t_29);
          __Pyx_XGOTREF(__pyx_t_30);
          __pyx_t_13 = __pyx_lineno; __pyx_t_23 = __pyx_clineno; __pyx_t_32 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_28);
          __Pyx_XGIVEREF(__pyx_t_29);
          __Pyx_XGIVEREF(__pyx_t_30);
          __Pyx_ExceptionReset(__pyx_t_28, __pyx_t_29, __pyx_t_30);
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_ErrRestore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
          __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0; __pyx_t_30 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_23; __pyx_filename = __pyx_t_32;
          goto __pyx_L5_except_error;
        }
        __pyx_L62:;
      }
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "ws_package/utils/hardware_event_validator.py":610
 *     def _initialize_macos(self):
 *         """Initialize macOS CGEvent API for event validation"""
 *         try:             # <<<<<<<<<<<<<<
 *             # Primary path: MacCGEventListener passes Quartz CGEvent objects directly.
 *             # Reading kCGEventSourceStateID on the event is reliable; a secondary ctypes
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ws_package/utils/hardware_event_validator.py":608
 *             ready_event.set()
 * 
 *     def _initialize_macos(self):             # <<<<<<<<<<<<<<
 *         """Initialize macOS CGEvent API for event validation"""
 *         try:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._initialize_macos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Quartz);
  __Pyx_XDECREF(__pyx_v_CGEventTapCallBack);
  __Pyx_XDECREF(__pyx_v_event_tap_callback);
  __Pyx_XDECREF(__pyx_v_callback_ref);
  __Pyx_XDECREF(__pyx_v_event_mask);
  __Pyx_XDECREF(__pyx_v_event_tap);
  __Pyx_XDECREF(__pyx_v_enabled);
  __Pyx_XDECREF(__pyx_v_e2);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":774
 *             self._enabled = False
 * 
 *     def _initialize_linux(self):             # <<<<<<<<<<<<<<
 *         """
 *         Initialize Linux X11 input validation (evdev + XTEST path).
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_21_initialize_linux(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_initialize_linux, "\n        Initialize Linux X11 input validation (evdev + XTEST path).\n\n        Real hardware: kernel evdev -> X server -> pynput\n        pyautogui/xdotool: XTEST virtual device -> X server -> pynput (no evdev)\n        ");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_21_initialize_linux = {"_initialize_linux", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_21_initialize_linux, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_initialize_linux};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_21_initialize_linux(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_initialize_linux (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 774, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 774, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_initialize_linux", 0) < (0)) __PYX_ERR(0, 774, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_initialize_linux", 1, 1, 1, i); __PYX_ERR(0, 774, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 774, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_initialize_linux", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 774, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._initialize_linux", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_initialize_linux(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_20_initialize_linux(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_evdev = NULL;
  PyObject *__pyx_v_opened = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  Py_ssize_t __pyx_t_18;
  int __pyx_t_19;
  char const *__pyx_t_20;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_initialize_linux", 0);

  /* "ws_package/utils/hardware_event_validator.py":781
 *         pyautogui/xdotool: XTEST virtual device -> X server -> pynput (no evdev)
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             self._linux_xtest_device_ids = self._linux_discover_xtest_device_ids()
 *             if self._linux_xtest_device_ids:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":782
 *         """
 *         try:
 *             self._linux_xtest_device_ids = self._linux_discover_xtest_device_ids()             # <<<<<<<<<<<<<<
 *             if self._linux_xtest_device_ids:
 *                 self._start_linux_xinput_monitor()
*/
      __pyx_t_5 = __pyx_v_self;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_linux_discover_xtest_device_ids, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 782, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xtest_device_ids, __pyx_t_4) < (0)) __PYX_ERR(0, 782, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":783
 *         try:
 *             self._linux_xtest_device_ids = self._linux_discover_xtest_device_ids()
 *             if self._linux_xtest_device_ids:             # <<<<<<<<<<<<<<
 *                 self._start_linux_xinput_monitor()
 *             else:
*/
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xtest_device_ids); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 783, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 783, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_7) {

        /* "ws_package/utils/hardware_event_validator.py":784
 *             self._linux_xtest_device_ids = self._linux_discover_xtest_device_ids()
 *             if self._linux_xtest_device_ids:
 *                 self._start_linux_xinput_monitor()             # <<<<<<<<<<<<<<
 *             else:
 *                 logger.warning("Could not discover XTEST device IDs on Linux X11")
*/
        __pyx_t_5 = __pyx_v_self;
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_start_linux_xinput_monitor, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 784, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "ws_package/utils/hardware_event_validator.py":783
 *         try:
 *             self._linux_xtest_device_ids = self._linux_discover_xtest_device_ids()
 *             if self._linux_xtest_device_ids:             # <<<<<<<<<<<<<<
 *                 self._start_linux_xinput_monitor()
 *             else:
*/
        goto __pyx_L9;
      }

      /* "ws_package/utils/hardware_event_validator.py":786
 *                 self._start_linux_xinput_monitor()
 *             else:
 *                 logger.warning("Could not discover XTEST device IDs on Linux X11")             # <<<<<<<<<<<<<<
 * 
 *             try:
*/
      /*else*/ {
        __pyx_t_5 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 786, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 786, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
          assert(__pyx_t_5);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Could_not_discover_XTEST_device};
          __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 786, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_L9:;

      /* "ws_package/utils/hardware_event_validator.py":788
 *                 logger.warning("Could not discover XTEST device IDs on Linux X11")
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 import evdev
 *                 self._linux_evdev_available = True
*/
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        /*try:*/ {

          /* "ws_package/utils/hardware_event_validator.py":789
 * 
 *             try:
 *                 import evdev             # <<<<<<<<<<<<<<
 *                 self._linux_evdev_available = True
 *                 self._evdev_module = evdev
*/
          __pyx_t_13 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_evdev, 0, 0, NULL, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 789, __pyx_L10_error)
          __pyx_t_4 = __pyx_t_13;
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_v_evdev = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "ws_package/utils/hardware_event_validator.py":790
 *             try:
 *                 import evdev
 *                 self._linux_evdev_available = True             # <<<<<<<<<<<<<<
 *                 self._evdev_module = evdev
 *                 opened = self._linux_open_evdev_devices()
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_evdev_available, Py_True) < (0)) __PYX_ERR(0, 790, __pyx_L10_error)

          /* "ws_package/utils/hardware_event_validator.py":791
 *                 import evdev
 *                 self._linux_evdev_available = True
 *                 self._evdev_module = evdev             # <<<<<<<<<<<<<<
 *                 opened = self._linux_open_evdev_devices()
 *                 if opened:
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_evdev_module, __pyx_v_evdev) < (0)) __PYX_ERR(0, 791, __pyx_L10_error)

          /* "ws_package/utils/hardware_event_validator.py":792
 *                 self._linux_evdev_available = True
 *                 self._evdev_module = evdev
 *                 opened = self._linux_open_evdev_devices()             # <<<<<<<<<<<<<<
 *                 if opened:
 *                     self._start_linux_evdev_reader()
*/
          __pyx_t_9 = __pyx_v_self;
          __Pyx_INCREF(__pyx_t_9);
          __pyx_t_6 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
            __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_linux_open_evdev_devices, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 792, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __pyx_v_opened = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "ws_package/utils/hardware_event_validator.py":793
 *                 self._evdev_module = evdev
 *                 opened = self._linux_open_evdev_devices()
 *                 if opened:             # <<<<<<<<<<<<<<
 *                     self._start_linux_evdev_reader()
 *                     logger.info(
*/
          __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_opened); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 793, __pyx_L10_error)
          if (__pyx_t_7) {

            /* "ws_package/utils/hardware_event_validator.py":794
 *                 opened = self._linux_open_evdev_devices()
 *                 if opened:
 *                     self._start_linux_evdev_reader()             # <<<<<<<<<<<<<<
 *                     logger.info(
 *                         "Linux evdev hardware path ready (%s keyboard/mouse devices)",
*/
            __pyx_t_9 = __pyx_v_self;
            __Pyx_INCREF(__pyx_t_9);
            __pyx_t_6 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
              __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_start_linux_evdev_reader, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 794, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_4);
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

            /* "ws_package/utils/hardware_event_validator.py":795
 *                 if opened:
 *                     self._start_linux_evdev_reader()
 *                     logger.info(             # <<<<<<<<<<<<<<
 *                         "Linux evdev hardware path ready (%s keyboard/mouse devices)",
 *                         opened,
*/
            __pyx_t_9 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 795, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_info); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 795, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "ws_package/utils/hardware_event_validator.py":797
 *                     logger.info(
 *                         "Linux evdev hardware path ready (%s keyboard/mouse devices)",
 *                         opened,             # <<<<<<<<<<<<<<
 *                     )
 *                 else:
*/
            __pyx_t_6 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_8))) {
              __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
              assert(__pyx_t_9);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
              __Pyx_INCREF(__pyx_t_9);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
              __pyx_t_6 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_Linux_evdev_hardware_path_ready, __pyx_v_opened};
              __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_4);
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

            /* "ws_package/utils/hardware_event_validator.py":793
 *                 self._evdev_module = evdev
 *                 opened = self._linux_open_evdev_devices()
 *                 if opened:             # <<<<<<<<<<<<<<
 *                     self._start_linux_evdev_reader()
 *                     logger.info(
*/
            goto __pyx_L16;
          }

          /* "ws_package/utils/hardware_event_validator.py":800
 *                     )
 *                 else:
 *                     logger.warning("Linux evdev: no keyboard/mouse devices opened")             # <<<<<<<<<<<<<<
 *             except ImportError:
 *                 logger.warning("python-evdev not available on Linux - XTEST-only validation")
*/
          /*else*/ {
            __pyx_t_8 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 800, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_9);
            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 800, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __pyx_t_6 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_5))) {
              __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
              assert(__pyx_t_8);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_8);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
              __pyx_t_6 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_Linux_evdev_no_keyboard_mouse_de};
              __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 800, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_4);
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          }
          __pyx_L16:;

          /* "ws_package/utils/hardware_event_validator.py":788
 *                 logger.warning("Could not discover XTEST device IDs on Linux X11")
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 import evdev
 *                 self._linux_evdev_available = True
*/
        }
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L15_try_end;
        __pyx_L10_error:;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "ws_package/utils/hardware_event_validator.py":801
 *                 else:
 *                     logger.warning("Linux evdev: no keyboard/mouse devices opened")
 *             except ImportError:             # <<<<<<<<<<<<<<
 *                 logger.warning("python-evdev not available on Linux - XTEST-only validation")
 * 
*/
        __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError))));
        if (__pyx_t_14) {
          __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._initialize_linux", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_8) < 0) __PYX_ERR(0, 801, __pyx_L12_except_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_8);

          /* "ws_package/utils/hardware_event_validator.py":802
 *                     logger.warning("Linux evdev: no keyboard/mouse devices opened")
 *             except ImportError:
 *                 logger.warning("python-evdev not available on Linux - XTEST-only validation")             # <<<<<<<<<<<<<<
 * 
 *             self._enabled = bool(self._linux_open_devices) or self._linux_xinput_monitor_active
*/
          __pyx_t_15 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 802, __pyx_L12_except_error)
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 802, __pyx_L12_except_error)
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __pyx_t_6 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_17))) {
            __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_17);
            assert(__pyx_t_15);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_17, __pyx__function);
            __pyx_t_6 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_mstate_global->__pyx_kp_u_python_evdev_not_available_on_Li};
            __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_17, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 802, __pyx_L12_except_error)
            __Pyx_GOTREF(__pyx_t_9);
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L11_exception_handled;
        }
        goto __pyx_L12_except_error;

        /* "ws_package/utils/hardware_event_validator.py":788
 *                 logger.warning("Could not discover XTEST device IDs on Linux X11")
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 import evdev
 *                 self._linux_evdev_available = True
*/
        __pyx_L12_except_error:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        goto __pyx_L3_error;
        __pyx_L11_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        __pyx_L15_try_end:;
      }

      /* "ws_package/utils/hardware_event_validator.py":804
 *                 logger.warning("python-evdev not available on Linux - XTEST-only validation")
 * 
 *             self._enabled = bool(self._linux_open_devices) or self._linux_xinput_monitor_active             # <<<<<<<<<<<<<<
 *             if self._enabled:
 *                 logger.info(
*/
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_open_devices); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 804, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 804, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyBool_FromLong((!(!__pyx_t_7))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 804, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 804, __pyx_L3_error)
      if (!__pyx_t_7) {
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_8 = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L19_bool_binop_done;
      }
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_monitor_active); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 804, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_8 = __pyx_t_5;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_L19_bool_binop_done:;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_enabled, __pyx_t_8) < (0)) __PYX_ERR(0, 804, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "ws_package/utils/hardware_event_validator.py":805
 * 
 *             self._enabled = bool(self._linux_open_devices) or self._linux_xinput_monitor_active
 *             if self._enabled:             # <<<<<<<<<<<<<<
 *                 logger.info(
 *                     "Linux X11 hardware validation initialized "
*/
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_enabled); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 805, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 805, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_7) {

        /* "ws_package/utils/hardware_event_validator.py":806
 *             self._enabled = bool(self._linux_open_devices) or self._linux_xinput_monitor_active
 *             if self._enabled:
 *                 logger.info(             # <<<<<<<<<<<<<<
 *                     "Linux X11 hardware validation initialized "
 *                     "(evdev=%s, xtest_ids=%s, xinput_monitor=%s)",
*/
        __pyx_t_5 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 806, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_info); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 806, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "ws_package/utils/hardware_event_validator.py":809
 *                     "Linux X11 hardware validation initialized "
 *                     "(evdev=%s, xtest_ids=%s, xinput_monitor=%s)",
 *                     len(self._linux_open_devices),             # <<<<<<<<<<<<<<
 *                     sorted(self._linux_xtest_device_ids),
 *                     self._linux_xinput_monitor_active,
*/
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_open_devices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 809, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_18 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_18 == ((Py_ssize_t)-1))) __PYX_ERR(0, 809, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_18); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 809, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);

        /* "ws_package/utils/hardware_event_validator.py":810
 *                     "(evdev=%s, xtest_ids=%s, xinput_monitor=%s)",
 *                     len(self._linux_open_devices),
 *                     sorted(self._linux_xtest_device_ids),             # <<<<<<<<<<<<<<
 *                     self._linux_xinput_monitor_active,
 *                 )
*/
        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xtest_device_ids); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 810, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_15 = PySequence_List(__pyx_t_17); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 810, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        if (unlikely((PyList_Sort(__pyx_t_15) < 0))) __PYX_ERR(0, 810, __pyx_L3_error)

        /* "ws_package/utils/hardware_event_validator.py":811
 *                     len(self._linux_open_devices),
 *                     sorted(self._linux_xtest_device_ids),
 *                     self._linux_xinput_monitor_active,             # <<<<<<<<<<<<<<
 *                 )
 *             else:
*/
        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_monitor_active); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 811, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
          assert(__pyx_t_5);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Linux_X11_hardware_validation_in, __pyx_t_4, __pyx_t_15, __pyx_t_17};
          __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_6, (5-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 806, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "ws_package/utils/hardware_event_validator.py":805
 * 
 *             self._enabled = bool(self._linux_open_devices) or self._linux_xinput_monitor_active
 *             if self._enabled:             # <<<<<<<<<<<<<<
 *                 logger.info(
 *                     "Linux X11 hardware validation initialized "
*/
        goto __pyx_L21;
      }

      /* "ws_package/utils/hardware_event_validator.py":814
 *                 )
 *             else:
 *                 logger.warning("Linux hardware validation unavailable - accepting all events")             # <<<<<<<<<<<<<<
 *         except Exception as e:
 *             logger.warning("Failed to initialize Linux hardware detection: %s", e)
*/
      /*else*/ {
        __pyx_t_9 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 814, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 814, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_15);
          assert(__pyx_t_9);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_15, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_Linux_hardware_validation_unavai};
          __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 814, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __pyx_L21:;

      /* "ws_package/utils/hardware_event_validator.py":781
 *         pyautogui/xdotool: XTEST virtual device -> X server -> pynput (no evdev)
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             self._linux_xtest_device_ids = self._linux_discover_xtest_device_ids()
 *             if self._linux_xtest_device_ids:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "ws_package/utils/hardware_event_validator.py":815
 *             else:
 *                 logger.warning("Linux hardware validation unavailable - accepting all events")
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.warning("Failed to initialize Linux hardware detection: %s", e)
 *             self._enabled = False
*/
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._initialize_linux", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_15, &__pyx_t_9) < 0) __PYX_ERR(0, 815, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_15);
      __pyx_v_e = __pyx_t_15;
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":816
 *                 logger.warning("Linux hardware validation unavailable - accepting all events")
 *         except Exception as e:
 *             logger.warning("Failed to initialize Linux hardware detection: %s", e)             # <<<<<<<<<<<<<<
 *             self._enabled = False
 * 
*/
        __pyx_t_4 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 816, __pyx_L27_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 816, __pyx_L27_error)
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_16))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_16);
          assert(__pyx_t_4);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Failed_to_initialize_Linux_hardw, __pyx_v_e};
          __pyx_t_17 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 816, __pyx_L27_error)
          __Pyx_GOTREF(__pyx_t_17);
        }
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

        /* "ws_package/utils/hardware_event_validator.py":817
 *         except Exception as e:
 *             logger.warning("Failed to initialize Linux hardware detection: %s", e)
 *             self._enabled = False             # <<<<<<<<<<<<<<
 * 
 *     def _linux_xinput_binary(self) -> Optional[str]:
*/
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_enabled, Py_False) < (0)) __PYX_ERR(0, 817, __pyx_L27_error)
      }

      /* "ws_package/utils/hardware_event_validator.py":815
 *             else:
 *                 logger.warning("Linux hardware validation unavailable - accepting all events")
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.warning("Failed to initialize Linux hardware detection: %s", e)
 *             self._enabled = False
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          goto __pyx_L28;
        }
        __pyx_L27_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_13 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_21, &__pyx_t_22);
          if ( unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_14 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_21, __pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_ErrRestore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
          __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_13 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20;
          goto __pyx_L5_except_error;
        }
        __pyx_L28:;
      }
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "ws_package/utils/hardware_event_validator.py":781
 *         pyautogui/xdotool: XTEST virtual device -> X server -> pynput (no evdev)
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             self._linux_xtest_device_ids = self._linux_discover_xtest_device_ids()
 *             if self._linux_xtest_device_ids:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "ws_package/utils/hardware_event_validator.py":774
 *             self._enabled = False
 * 
 *     def _initialize_linux(self):             # <<<<<<<<<<<<<<
 *         """
 *         Initialize Linux X11 input validation (evdev + XTEST path).
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._initialize_linux", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_evdev);
  __Pyx_XDECREF(__pyx_v_opened);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":819
 *             self._enabled = False
 * 
 *     def _linux_xinput_binary(self) -> Optional[str]:             # <<<<<<<<<<<<<<
 *         """Resolve the xinput binary path for X11 sessions."""
 *         if self._linux_xinput_path:
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_23_linux_xinput_binary(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_22_linux_xinput_binary, "Resolve the xinput binary path for X11 sessions.");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_23_linux_xinput_binary = {"_linux_xinput_binary", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_23_linux_xinput_binary, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_22_linux_xinput_binary};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_23_linux_xinput_binary(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_linux_xinput_binary (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 819, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 819, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_linux_xinput_binary", 0) < (0)) __PYX_ERR(0, 819, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_linux_xinput_binary", 1, 1, 1, i); __PYX_ERR(0, 819, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 819, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_linux_xinput_binary", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 819, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_xinput_binary", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_22_linux_xinput_binary(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_22_linux_xinput_binary(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_candidate = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_linux_xinput_binary", 0);

  /* "ws_package/utils/hardware_event_validator.py":821
 *     def _linux_xinput_binary(self) -> Optional[str]:
 *         """Resolve the xinput binary path for X11 sessions."""
 *         if self._linux_xinput_path:             # <<<<<<<<<<<<<<
 *             return self._linux_xinput_path
 *         for candidate in (
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 821, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "ws_package/utils/hardware_event_validator.py":822
 *         """Resolve the xinput binary path for X11 sessions."""
 *         if self._linux_xinput_path:
 *             return self._linux_xinput_path             # <<<<<<<<<<<<<<
 *         for candidate in (
 *             shutil.which('xinput'),
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 822, __pyx_L1_error)
    __pyx_r = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":821
 *     def _linux_xinput_binary(self) -> Optional[str]:
 *         """Resolve the xinput binary path for X11 sessions."""
 *         if self._linux_xinput_path:             # <<<<<<<<<<<<<<
 *             return self._linux_xinput_path
 *         for candidate in (
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":824
 *             return self._linux_xinput_path
 *         for candidate in (
 *             shutil.which('xinput'),             # <<<<<<<<<<<<<<
 *             '/usr/bin/xinput',
 *             '/bin/xinput',
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_shutil); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_which); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_n_u_xinput};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 824, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_usr_bin_xinput);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_usr_bin_xinput);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_kp_u_usr_bin_xinput) != (0)) __PYX_ERR(0, 824, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_bin_xinput);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_bin_xinput);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_mstate_global->__pyx_kp_u_bin_xinput) != (0)) __PYX_ERR(0, 824, __pyx_L1_error);
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":823
 *         if self._linux_xinput_path:
 *             return self._linux_xinput_path
 *         for candidate in (             # <<<<<<<<<<<<<<
 *             shutil.which('xinput'),
 *             '/usr/bin/xinput',
*/
  __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (__pyx_t_7 >= 3) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7));
    #else
    __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7);
    #endif
    ++__pyx_t_7;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_candidate, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "ws_package/utils/hardware_event_validator.py":828
 *             '/bin/xinput',
 *         ):
 *             if candidate and os.path.isfile(candidate) and os.access(candidate, os.X_OK):             # <<<<<<<<<<<<<<
 *                 self._linux_xinput_path = candidate
 *                 return candidate
*/
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_candidate); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 828, __pyx_L1_error)
    if (__pyx_t_8) {
    } else {
      __pyx_t_2 = __pyx_t_8;
      goto __pyx_L7_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __pyx_t_9;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_candidate};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_isfile, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 828, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_8) {
    } else {
      __pyx_t_2 = __pyx_t_8;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_9 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_access); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_X_OK); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_9);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_candidate, __pyx_t_10};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 828, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __pyx_t_8;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_2) {

      /* "ws_package/utils/hardware_event_validator.py":829
 *         ):
 *             if candidate and os.path.isfile(candidate) and os.access(candidate, os.X_OK):
 *                 self._linux_xinput_path = candidate             # <<<<<<<<<<<<<<
 *                 return candidate
 *         return None
*/
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_path, __pyx_v_candidate) < (0)) __PYX_ERR(0, 829, __pyx_L1_error)

      /* "ws_package/utils/hardware_event_validator.py":830
 *             if candidate and os.path.isfile(candidate) and os.access(candidate, os.X_OK):
 *                 self._linux_xinput_path = candidate
 *                 return candidate             # <<<<<<<<<<<<<<
 *         return None
 * 
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __pyx_v_candidate;
      __Pyx_INCREF(__pyx_t_5);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(0, 830, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "ws_package/utils/hardware_event_validator.py":828
 *             '/bin/xinput',
 *         ):
 *             if candidate and os.path.isfile(candidate) and os.access(candidate, os.X_OK):             # <<<<<<<<<<<<<<
 *                 self._linux_xinput_path = candidate
 *                 return candidate
*/
    }

    /* "ws_package/utils/hardware_event_validator.py":823
 *         if self._linux_xinput_path:
 *             return self._linux_xinput_path
 *         for candidate in (             # <<<<<<<<<<<<<<
 *             shutil.which('xinput'),
 *             '/usr/bin/xinput',
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":831
 *                 self._linux_xinput_path = candidate
 *                 return candidate
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     def _linux_discover_xtest_device_ids(self) -> Set[int]:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":819
 *             self._enabled = False
 * 
 *     def _linux_xinput_binary(self) -> Optional[str]:             # <<<<<<<<<<<<<<
 *         """Resolve the xinput binary path for X11 sessions."""
 *         if self._linux_xinput_path:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_xinput_binary", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_candidate);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":833
 *         return None
 * 
 *     def _linux_discover_xtest_device_ids(self) -> Set[int]:             # <<<<<<<<<<<<<<
 *         """Discover Virtual core XTEST pointer/keyboard device IDs."""
 *         ids: Set[int] = set()
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_25_linux_discover_xtest_device_ids(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_24_linux_discover_xtest_device_ids, "Discover Virtual core XTEST pointer/keyboard device IDs.");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_25_linux_discover_xtest_device_ids = {"_linux_discover_xtest_device_ids", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_25_linux_discover_xtest_device_ids, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_24_linux_discover_xtest_device_ids};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_25_linux_discover_xtest_device_ids(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_linux_discover_xtest_device_ids (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 833, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 833, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_linux_discover_xtest_device_ids", 0) < (0)) __PYX_ERR(0, 833, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_linux_discover_xtest_device_ids", 1, 1, 1, i); __PYX_ERR(0, 833, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 833, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_linux_discover_xtest_device_ids", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 833, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_discover_xtest_device_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_24_linux_discover_xtest_device_ids(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_24_linux_discover_xtest_device_ids(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_ids = 0;
  PyObject *__pyx_v_xinput_bin = NULL;
  PyObject *__pyx_v_output = NULL;
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_v_match = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  Py_ssize_t __pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
  int __pyx_t_17;
  int __pyx_t_18;
  int __pyx_t_19;
  char const *__pyx_t_20;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  char const *__pyx_t_27;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_linux_discover_xtest_device_ids", 0);

  /* "ws_package/utils/hardware_event_validator.py":835
 *     def _linux_discover_xtest_device_ids(self) -> Set[int]:
 *         """Discover Virtual core XTEST pointer/keyboard device IDs."""
 *         ids: Set[int] = set()             # <<<<<<<<<<<<<<
 * 
 *         xinput_bin = self._linux_xinput_binary()
*/
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ids = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":837
 *         ids: Set[int] = set()
 * 
 *         xinput_bin = self._linux_xinput_binary()             # <<<<<<<<<<<<<<
 *         if xinput_bin:
 *             try:
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_linux_xinput_binary, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_xinput_bin = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":838
 * 
 *         xinput_bin = self._linux_xinput_binary()
 *         if xinput_bin:             # <<<<<<<<<<<<<<
 *             try:
 *                 output = subprocess.check_output(
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_xinput_bin); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 838, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "ws_package/utils/hardware_event_validator.py":839
 *         xinput_bin = self._linux_xinput_binary()
 *         if xinput_bin:
 *             try:             # <<<<<<<<<<<<<<
 *                 output = subprocess.check_output(
 *                     [xinput_bin, 'list'],
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":840
 *         if xinput_bin:
 *             try:
 *                 output = subprocess.check_output(             # <<<<<<<<<<<<<<
 *                     [xinput_bin, 'list'],
 *                     text=True,
*/
        __pyx_t_2 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_subprocess); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 840, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_check_output); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 840, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "ws_package/utils/hardware_event_validator.py":841
 *             try:
 *                 output = subprocess.check_output(
 *                     [xinput_bin, 'list'],             # <<<<<<<<<<<<<<
 *                     text=True,
 *                     timeout=5,
*/
        __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 841, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_v_xinput_bin);
        __Pyx_GIVEREF(__pyx_v_xinput_bin);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_v_xinput_bin) != (0)) __PYX_ERR(0, 841, __pyx_L4_error);
        __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_list);
        __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_list);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_n_u_list) != (0)) __PYX_ERR(0, 841, __pyx_L4_error);

        /* "ws_package/utils/hardware_event_validator.py":844
 *                     text=True,
 *                     timeout=5,
 *                     stderr=subprocess.DEVNULL,             # <<<<<<<<<<<<<<
 *                     env=os.environ.copy(),
 *                 )
*/
        __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_subprocess); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 844, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEVNULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 844, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "ws_package/utils/hardware_event_validator.py":845
 *                     timeout=5,
 *                     stderr=subprocess.DEVNULL,
 *                     env=os.environ.copy(),             # <<<<<<<<<<<<<<
 *                 )
 *                 for line in output.splitlines():
*/
        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 845, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_environ); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 845, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_12 = __pyx_t_14;
        __Pyx_INCREF(__pyx_t_12);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
          __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 845, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_10);
        }
        __pyx_t_3 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
          assert(__pyx_t_2);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
          __pyx_t_3 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_2, __pyx_t_8};
          __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 840, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_14);
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_text, Py_True, __pyx_t_14, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 840, __pyx_L4_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_timeout, __pyx_mstate_global->__pyx_int_5, __pyx_t_14, __pyx_callargs+2, 1) < (0)) __PYX_ERR(0, 840, __pyx_L4_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_stderr, __pyx_t_11, __pyx_t_14, __pyx_callargs+2, 2) < (0)) __PYX_ERR(0, 840, __pyx_L4_error)
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_env, __pyx_t_10, __pyx_t_14, __pyx_callargs+2, 3) < (0)) __PYX_ERR(0, 840, __pyx_L4_error)
          __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_14);
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 840, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __pyx_v_output = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":847
 *                     env=os.environ.copy(),
 *                 )
 *                 for line in output.splitlines():             # <<<<<<<<<<<<<<
 *                     if 'XTEST' not in line.upper():
 *                         continue
*/
        __pyx_t_9 = __pyx_v_output;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_splitlines, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9);
          __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
        } else {
          __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 847, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 847, __pyx_L4_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_16)) {
            if (likely(PyList_CheckExact(__pyx_t_9))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 847, __pyx_L4_error)
                #endif
                if (__pyx_t_15 >= __pyx_temp) break;
              }
              __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_15, __Pyx_ReferenceSharing_OwnStrongReference);
              ++__pyx_t_15;
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 847, __pyx_L4_error)
                #endif
                if (__pyx_t_15 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15));
              #else
              __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_15);
              #endif
              ++__pyx_t_15;
            }
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L4_error)
          } else {
            __pyx_t_1 = __pyx_t_16(__pyx_t_9);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 847, __pyx_L4_error)
                PyErr_Clear();
              }
              break;
            }
          }
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "ws_package/utils/hardware_event_validator.py":848
 *                 )
 *                 for line in output.splitlines():
 *                     if 'XTEST' not in line.upper():             # <<<<<<<<<<<<<<
 *                         continue
 *                     match = re.search(r'id=(\d+)', line)
*/
          __pyx_t_14 = __pyx_v_line;
          __Pyx_INCREF(__pyx_t_14);
          __pyx_t_3 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL};
            __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_upper, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_1);
          }
          __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_XTEST, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 848, __pyx_L4_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (__pyx_t_4) {

            /* "ws_package/utils/hardware_event_validator.py":849
 *                 for line in output.splitlines():
 *                     if 'XTEST' not in line.upper():
 *                         continue             # <<<<<<<<<<<<<<
 *                     match = re.search(r'id=(\d+)', line)
 *                     if match:
*/
            goto __pyx_L10_continue;

            /* "ws_package/utils/hardware_event_validator.py":848
 *                 )
 *                 for line in output.splitlines():
 *                     if 'XTEST' not in line.upper():             # <<<<<<<<<<<<<<
 *                         continue
 *                     match = re.search(r'id=(\d+)', line)
*/
          }

          /* "ws_package/utils/hardware_event_validator.py":850
 *                     if 'XTEST' not in line.upper():
 *                         continue
 *                     match = re.search(r'id=(\d+)', line)             # <<<<<<<<<<<<<<
 *                     if match:
 *                         ids.add(int(match.group(1)))
*/
          __pyx_t_14 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 850, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_search); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 850, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_3 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_11))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_11);
            assert(__pyx_t_14);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
            __pyx_t_3 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_id_d, __pyx_v_line};
            __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_1);
          }
          __Pyx_XDECREF_SET(__pyx_v_match, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "ws_package/utils/hardware_event_validator.py":851
 *                         continue
 *                     match = re.search(r'id=(\d+)', line)
 *                     if match:             # <<<<<<<<<<<<<<
 *                         ids.add(int(match.group(1)))
 *             except Exception as e:
*/
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_match); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 851, __pyx_L4_error)
          if (__pyx_t_4) {

            /* "ws_package/utils/hardware_event_validator.py":852
 *                     match = re.search(r'id=(\d+)', line)
 *                     if match:
 *                         ids.add(int(match.group(1)))             # <<<<<<<<<<<<<<
 *             except Exception as e:
 *                 logger.debug("xinput list failed while discovering XTEST devices: %s", e)
*/
            __pyx_t_11 = __pyx_v_match;
            __Pyx_INCREF(__pyx_t_11);
            __pyx_t_3 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_int_1};
              __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L4_error)
              __Pyx_GOTREF(__pyx_t_1);
            }
            __pyx_t_11 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 852, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_17 = PySet_Add(__pyx_v_ids, __pyx_t_11); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 852, __pyx_L4_error)
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

            /* "ws_package/utils/hardware_event_validator.py":851
 *                         continue
 *                     match = re.search(r'id=(\d+)', line)
 *                     if match:             # <<<<<<<<<<<<<<
 *                         ids.add(int(match.group(1)))
 *             except Exception as e:
*/
          }

          /* "ws_package/utils/hardware_event_validator.py":847
 *                     env=os.environ.copy(),
 *                 )
 *                 for line in output.splitlines():             # <<<<<<<<<<<<<<
 *                     if 'XTEST' not in line.upper():
 *                         continue
*/
          __pyx_L10_continue:;
        }
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "ws_package/utils/hardware_event_validator.py":839
 *         xinput_bin = self._linux_xinput_binary()
 *         if xinput_bin:
 *             try:             # <<<<<<<<<<<<<<
 *                 output = subprocess.check_output(
 *                     [xinput_bin, 'list'],
*/
      }
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L9_try_end;
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "ws_package/utils/hardware_event_validator.py":853
 *                     if match:
 *                         ids.add(int(match.group(1)))
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 logger.debug("xinput list failed while discovering XTEST devices: %s", e)
 * 
*/
      __pyx_t_18 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_18) {
        __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_discover_xtest_device_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_11, &__pyx_t_1) < 0) __PYX_ERR(0, 853, __pyx_L6_except_error)
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_11);
        __pyx_v_e = __pyx_t_11;
        /*try:*/ {

          /* "ws_package/utils/hardware_event_validator.py":854
 *                         ids.add(int(match.group(1)))
 *             except Exception as e:
 *                 logger.debug("xinput list failed while discovering XTEST devices: %s", e)             # <<<<<<<<<<<<<<
 * 
 *         if ids:
*/
          __pyx_t_10 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 854, __pyx_L20_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L20_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_3 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
            assert(__pyx_t_10);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
            __pyx_t_3 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_xinput_list_failed_while_discove, __pyx_v_e};
            __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 854, __pyx_L20_error)
            __Pyx_GOTREF(__pyx_t_14);
          }
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        }

        /* "ws_package/utils/hardware_event_validator.py":853
 *                     if match:
 *                         ids.add(int(match.group(1)))
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 logger.debug("xinput list failed while discovering XTEST devices: %s", e)
 * 
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            goto __pyx_L21;
          }
          __pyx_L20_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26);
            if ( unlikely(__Pyx_GetException(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23) < 0)) __Pyx_ErrFetch(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_23);
            __Pyx_XGOTREF(__pyx_t_24);
            __Pyx_XGOTREF(__pyx_t_25);
            __Pyx_XGOTREF(__pyx_t_26);
            __pyx_t_18 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_24);
            __Pyx_XGIVEREF(__pyx_t_25);
            __Pyx_XGIVEREF(__pyx_t_26);
            __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_23);
            __Pyx_ErrRestore(__pyx_t_21, __pyx_t_22, __pyx_t_23);
            __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0;
            __pyx_lineno = __pyx_t_18; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20;
            goto __pyx_L6_except_error;
          }
          __pyx_L21:;
        }
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L5_exception_handled;
      }
      goto __pyx_L6_except_error;

      /* "ws_package/utils/hardware_event_validator.py":839
 *         xinput_bin = self._linux_xinput_binary()
 *         if xinput_bin:
 *             try:             # <<<<<<<<<<<<<<
 *                 output = subprocess.check_output(
 *                     [xinput_bin, 'list'],
*/
      __pyx_L6_except_error:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L5_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      __pyx_L9_try_end:;
    }

    /* "ws_package/utils/hardware_event_validator.py":838
 * 
 *         xinput_bin = self._linux_xinput_binary()
 *         if xinput_bin:             # <<<<<<<<<<<<<<
 *             try:
 *                 output = subprocess.check_output(
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":856
 *                 logger.debug("xinput list failed while discovering XTEST devices: %s", e)
 * 
 *         if ids:             # <<<<<<<<<<<<<<
 *             return ids
 * 
*/
  {
    Py_ssize_t __pyx_temp = __Pyx_PySet_GET_SIZE(__pyx_v_ids);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 856, __pyx_L1_error)
    __pyx_t_4 = (__pyx_temp != 0);
  }

  if (__pyx_t_4) {

    /* "ws_package/utils/hardware_event_validator.py":857
 * 
 *         if ids:
 *             return ids             # <<<<<<<<<<<<<<
 * 
 *         # Fallback: query libXi directly (no external binary required)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_ids);
    __pyx_r = __pyx_v_ids;
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":856
 *                 logger.debug("xinput list failed while discovering XTEST devices: %s", e)
 * 
 *         if ids:             # <<<<<<<<<<<<<<
 *             return ids
 * 
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":860
 * 
 *         # Fallback: query libXi directly (no external binary required)
 *         try:             # <<<<<<<<<<<<<<
 *             ids = self._linux_discover_xtest_device_ids_ctypes()
 *         except Exception as e:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":861
 *         # Fallback: query libXi directly (no external binary required)
 *         try:
 *             ids = self._linux_discover_xtest_device_ids_ctypes()             # <<<<<<<<<<<<<<
 *         except Exception as e:
 *             logger.debug("ctypes XTEST discovery failed: %s", e)
*/
      __pyx_t_11 = __pyx_v_self;
      __Pyx_INCREF(__pyx_t_11);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_linux_discover_xtest_device_ids_2, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 861, __pyx_L27_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("set", __pyx_t_1))) __PYX_ERR(0, 861, __pyx_L27_error)
      __Pyx_DECREF_SET(__pyx_v_ids, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "ws_package/utils/hardware_event_validator.py":860
 * 
 *         # Fallback: query libXi directly (no external binary required)
 *         try:             # <<<<<<<<<<<<<<
 *             ids = self._linux_discover_xtest_device_ids_ctypes()
 *         except Exception as e:
*/
    }
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L32_try_end;
    __pyx_L27_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "ws_package/utils/hardware_event_validator.py":862
 *         try:
 *             ids = self._linux_discover_xtest_device_ids_ctypes()
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.debug("ctypes XTEST discovery failed: %s", e)
 *         return ids
*/
    __pyx_t_19 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_19) {
      __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_discover_xtest_device_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_11, &__pyx_t_9) < 0) __PYX_ERR(0, 862, __pyx_L29_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_11);
      __pyx_v_e = __pyx_t_11;
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":863
 *             ids = self._linux_discover_xtest_device_ids_ctypes()
 *         except Exception as e:
 *             logger.debug("ctypes XTEST discovery failed: %s", e)             # <<<<<<<<<<<<<<
 *         return ids
 * 
*/
        __pyx_t_2 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 863, __pyx_L38_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 863, __pyx_L38_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_3 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
          assert(__pyx_t_2);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
          __pyx_t_3 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_ctypes_XTEST_discovery_failed_s, __pyx_v_e};
          __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 863, __pyx_L38_error)
          __Pyx_GOTREF(__pyx_t_14);
        }
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      }

      /* "ws_package/utils/hardware_event_validator.py":862
 *         try:
 *             ids = self._linux_discover_xtest_device_ids_ctypes()
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.debug("ctypes XTEST discovery failed: %s", e)
 *         return ids
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          goto __pyx_L39;
        }
        __pyx_L38_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
          if ( unlikely(__Pyx_GetException(&__pyx_t_26, &__pyx_t_25, &__pyx_t_24) < 0)) __Pyx_ErrFetch(&__pyx_t_26, &__pyx_t_25, &__pyx_t_24);
          __Pyx_XGOTREF(__pyx_t_26);
          __Pyx_XGOTREF(__pyx_t_25);
          __Pyx_XGOTREF(__pyx_t_24);
          __Pyx_XGOTREF(__pyx_t_23);
          __Pyx_XGOTREF(__pyx_t_22);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_19 = __pyx_lineno; __pyx_t_18 = __pyx_clineno; __pyx_t_27 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_23);
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_22, __pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_26);
          __Pyx_XGIVEREF(__pyx_t_25);
          __Pyx_XGIVEREF(__pyx_t_24);
          __Pyx_ErrRestore(__pyx_t_26, __pyx_t_25, __pyx_t_24);
          __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_19; __pyx_clineno = __pyx_t_18; __pyx_filename = __pyx_t_27;
          goto __pyx_L29_except_error;
        }
        __pyx_L39:;
      }
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L28_exception_handled;
    }
    goto __pyx_L29_except_error;

    /* "ws_package/utils/hardware_event_validator.py":860
 * 
 *         # Fallback: query libXi directly (no external binary required)
 *         try:             # <<<<<<<<<<<<<<
 *             ids = self._linux_discover_xtest_device_ids_ctypes()
 *         except Exception as e:
*/
    __pyx_L29_except_error:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L28_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
    __pyx_L32_try_end:;
  }

  /* "ws_package/utils/hardware_event_validator.py":864
 *         except Exception as e:
 *             logger.debug("ctypes XTEST discovery failed: %s", e)
 *         return ids             # <<<<<<<<<<<<<<
 * 
 *     def _linux_discover_xtest_device_ids_ctypes(self) -> Set[int]:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ids);
  __pyx_r = __pyx_v_ids;
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":833
 *         return None
 * 
 *     def _linux_discover_xtest_device_ids(self) -> Set[int]:             # <<<<<<<<<<<<<<
 *         """Discover Virtual core XTEST pointer/keyboard device IDs."""
 *         ids: Set[int] = set()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_discover_xtest_device_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ids);
  __Pyx_XDECREF(__pyx_v_xinput_bin);
  __Pyx_XDECREF(__pyx_v_output);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_v_match);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":866
 *         return ids
 * 
 *     def _linux_discover_xtest_device_ids_ctypes(self) -> Set[int]:             # <<<<<<<<<<<<<<
 *         """Discover XTEST device IDs via libXi (works in frozen PyInstaller builds)."""
 *         import ctypes.util
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_27_linux_discover_xtest_device_ids_ctypes(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_26_linux_discover_xtest_device_ids_ctypes, "Discover XTEST device IDs via libXi (works in frozen PyInstaller builds).");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_27_linux_discover_xtest_device_ids_ctypes = {"_linux_discover_xtest_device_ids_ctypes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_27_linux_discover_xtest_device_ids_ctypes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_26_linux_discover_xtest_device_ids_ctypes};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_27_linux_discover_xtest_device_ids_ctypes(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_linux_discover_xtest_device_ids_ctypes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 866, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 866, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_linux_discover_xtest_device_ids_ctypes", 0) < (0)) __PYX_ERR(0, 866, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_linux_discover_xtest_device_ids_ctypes", 1, 1, 1, i); __PYX_ERR(0, 866, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 866, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_linux_discover_xtest_device_ids_ctypes", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 866, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_discover_xtest_device_ids_ctypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_26_linux_discover_xtest_device_ids_ctypes(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_26_linux_discover_xtest_device_ids_ctypes(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
  PyObject *__pyx_v_ctypes = NULL;
  PyObject *__pyx_v_c_void_p = NULL;
  PyObject *__pyx_v_c_int = NULL;
  PyObject *__pyx_v_POINTER = NULL;
  PyObject *__pyx_v_Structure = NULL;
  PyObject *__pyx_v_byref = NULL;
  PyObject *__pyx_v_c_bool = NULL;
  PyObject *__pyx_v_libx11 = NULL;
  PyObject *__pyx_v_libxi = NULL;
  PyObject *__pyx_v_Display = NULL;
  PyObject *__pyx_v_XIDeviceInfo = NULL;
  PyObject *__pyx_v_display = NULL;
  PyObject *__pyx_v_ids = 0;
  PyObject *__pyx_v_major = NULL;
  PyObject *__pyx_v_minor = NULL;
  PyObject *__pyx_v_ndevices = NULL;
  PyObject *__pyx_v_devices = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_label = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *(*__pyx_t_18)(PyObject *);
  int __pyx_t_19;
  int __pyx_t_20;
  int __pyx_t_21;
  char const *__pyx_t_22;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_linux_discover_xtest_device_ids_ctypes", 0);

  /* "ws_package/utils/hardware_event_validator.py":868
 *     def _linux_discover_xtest_device_ids_ctypes(self) -> Set[int]:
 *         """Discover XTEST device IDs via libXi (works in frozen PyInstaller builds)."""
 *         import ctypes.util             # <<<<<<<<<<<<<<
 *         from ctypes import c_void_p, c_int, POINTER, Structure, byref, c_bool
 * 
*/
  __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_ctypes_util, 0, 0, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 868, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ctypes = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":869
 *         """Discover XTEST device IDs via libXi (works in frozen PyInstaller builds)."""
 *         import ctypes.util
 *         from ctypes import c_void_p, c_int, POINTER, Structure, byref, c_bool             # <<<<<<<<<<<<<<
 * 
 *         libx11 = ctypes.CDLL(ctypes.util.find_library('X11'))
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_c_void_p,__pyx_mstate_global->__pyx_n_u_c_int,__pyx_mstate_global->__pyx_n_u_POINTER,__pyx_mstate_global->__pyx_n_u_Structure,__pyx_mstate_global->__pyx_n_u_byref,__pyx_mstate_global->__pyx_n_u_c_bool};
    __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_ctypes, __pyx_imported_names, 6, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 869, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_t_2;
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_c_void_p,__pyx_mstate_global->__pyx_n_u_c_int,__pyx_mstate_global->__pyx_n_u_POINTER,__pyx_mstate_global->__pyx_n_u_Structure,__pyx_mstate_global->__pyx_n_u_byref,__pyx_mstate_global->__pyx_n_u_c_bool};
    for (__pyx_t_3=0; __pyx_t_3 < 6; __pyx_t_3++) {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_1, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 869, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      switch (__pyx_t_3) {
        case 0:
        __Pyx_INCREF(__pyx_t_4);
        __pyx_v_c_void_p = __pyx_t_4;
        break;
        case 1:
        __Pyx_INCREF(__pyx_t_4);
        __pyx_v_c_int = __pyx_t_4;
        break;
        case 2:
        __Pyx_INCREF(__pyx_t_4);
        __pyx_v_POINTER = __pyx_t_4;
        break;
        case 3:
        __Pyx_INCREF(__pyx_t_4);
        __pyx_v_Structure = __pyx_t_4;
        break;
        case 4:
        __Pyx_INCREF(__pyx_t_4);
        __pyx_v_byref = __pyx_t_4;
        break;
        case 5:
        __Pyx_INCREF(__pyx_t_4);
        __pyx_v_c_bool = __pyx_t_4;
        break;
        default:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":871
 *         from ctypes import c_void_p, c_int, POINTER, Structure, byref, c_bool
 * 
 *         libx11 = ctypes.CDLL(ctypes.util.find_library('X11'))             # <<<<<<<<<<<<<<
 *         libxi = ctypes.CDLL(ctypes.util.find_library('Xi'))
 *         if not libx11 or not libxi:
*/
  __pyx_t_4 = __pyx_v_ctypes;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_ctypes, __pyx_mstate_global->__pyx_n_u_util); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __pyx_t_7;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_X11};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_find_library, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 871, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_CDLL, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_libx11 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":872
 * 
 *         libx11 = ctypes.CDLL(ctypes.util.find_library('X11'))
 *         libxi = ctypes.CDLL(ctypes.util.find_library('Xi'))             # <<<<<<<<<<<<<<
 *         if not libx11 or not libxi:
 *             return set()
*/
  __pyx_t_5 = __pyx_v_ctypes;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ctypes, __pyx_mstate_global->__pyx_n_u_util); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __pyx_t_6;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Xi};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_find_library, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_CDLL, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_libxi = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":873
 *         libx11 = ctypes.CDLL(ctypes.util.find_library('X11'))
 *         libxi = ctypes.CDLL(ctypes.util.find_library('Xi'))
 *         if not libx11 or not libxi:             # <<<<<<<<<<<<<<
 *             return set()
 * 
*/
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_libx11); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 873, __pyx_L1_error)
  __pyx_t_11 = (!__pyx_t_10);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_9 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_libxi); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 873, __pyx_L1_error)
  __pyx_t_10 = (!__pyx_t_11);
  __pyx_t_9 = __pyx_t_10;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_9) {

    /* "ws_package/utils/hardware_event_validator.py":874
 *         libxi = ctypes.CDLL(ctypes.util.find_library('Xi'))
 *         if not libx11 or not libxi:
 *             return set()             # <<<<<<<<<<<<<<
 * 
 *         Display = c_void_p
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":873
 *         libx11 = ctypes.CDLL(ctypes.util.find_library('X11'))
 *         libxi = ctypes.CDLL(ctypes.util.find_library('Xi'))
 *         if not libx11 or not libxi:             # <<<<<<<<<<<<<<
 *             return set()
 * 
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":876
 *             return set()
 * 
 *         Display = c_void_p             # <<<<<<<<<<<<<<
 * 
 *         class XIDeviceInfo(Structure):
*/
  __Pyx_INCREF(__pyx_v_c_void_p);
  __pyx_v_Display = __pyx_v_c_void_p;

  /* "ws_package/utils/hardware_event_validator.py":878
 *         Display = c_void_p
 * 
 *         class XIDeviceInfo(Structure):             # <<<<<<<<<<<<<<
 *             _fields_ = [
 *                 ('deviceid', c_int),
*/
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_Structure);
  __Pyx_GIVEREF(__pyx_v_Structure);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_Structure) != (0)) __PYX_ERR(0, 878, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_XIDeviceInfo, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__linux_di, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4 != __pyx_t_1) {
    if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_1) < 0))) __PYX_ERR(0, 878, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":880
 *         class XIDeviceInfo(Structure):
 *             _fields_ = [
 *                 ('deviceid', c_int),             # <<<<<<<<<<<<<<
 *                 ('name', ctypes.c_char_p),
 *                 ('use', c_int),
*/
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_deviceid);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_deviceid);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_n_u_deviceid) != (0)) __PYX_ERR(0, 880, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_c_int);
  __Pyx_GIVEREF(__pyx_v_c_int);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_c_int) != (0)) __PYX_ERR(0, 880, __pyx_L1_error);

  /* "ws_package/utils/hardware_event_validator.py":881
 *             _fields_ = [
 *                 ('deviceid', c_int),
 *                 ('name', ctypes.c_char_p),             # <<<<<<<<<<<<<<
 *                 ('use', c_int),
 *                 ('attachment', c_int),
*/
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_ctypes, __pyx_mstate_global->__pyx_n_u_c_char_p); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_name);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_name);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_mstate_global->__pyx_n_u_name) != (0)) __PYX_ERR(0, 881, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 881, __pyx_L1_error);
  __pyx_t_7 = 0;

  /* "ws_package/utils/hardware_event_validator.py":882
 *                 ('deviceid', c_int),
 *                 ('name', ctypes.c_char_p),
 *                 ('use', c_int),             # <<<<<<<<<<<<<<
 *                 ('attachment', c_int),
 *                 ('enabled', c_bool),
*/
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_use);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_use);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_mstate_global->__pyx_n_u_use) != (0)) __PYX_ERR(0, 882, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_c_int);
  __Pyx_GIVEREF(__pyx_v_c_int);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_c_int) != (0)) __PYX_ERR(0, 882, __pyx_L1_error);

  /* "ws_package/utils/hardware_event_validator.py":883
 *                 ('name', ctypes.c_char_p),
 *                 ('use', c_int),
 *                 ('attachment', c_int),             # <<<<<<<<<<<<<<
 *                 ('enabled', c_bool),
 *                 ('num_classes', c_int),
*/
  __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_attachment);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_attachment);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_mstate_global->__pyx_n_u_attachment) != (0)) __PYX_ERR(0, 883, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_c_int);
  __Pyx_GIVEREF(__pyx_v_c_int);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_c_int) != (0)) __PYX_ERR(0, 883, __pyx_L1_error);

  /* "ws_package/utils/hardware_event_validator.py":884
 *                 ('use', c_int),
 *                 ('attachment', c_int),
 *                 ('enabled', c_bool),             # <<<<<<<<<<<<<<
 *                 ('num_classes', c_int),
 *                 ('classes', c_void_p),
*/
  __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_enabled_2);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_enabled_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_mstate_global->__pyx_n_u_enabled_2) != (0)) __PYX_ERR(0, 884, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_c_bool);
  __Pyx_GIVEREF(__pyx_v_c_bool);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_c_bool) != (0)) __PYX_ERR(0, 884, __pyx_L1_error);

  /* "ws_package/utils/hardware_event_validator.py":885
 *                 ('attachment', c_int),
 *                 ('enabled', c_bool),
 *                 ('num_classes', c_int),             # <<<<<<<<<<<<<<
 *                 ('classes', c_void_p),
 *             ]
*/
  __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_num_classes);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_num_classes);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_mstate_global->__pyx_n_u_num_classes) != (0)) __PYX_ERR(0, 885, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_c_int);
  __Pyx_GIVEREF(__pyx_v_c_int);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_c_int) != (0)) __PYX_ERR(0, 885, __pyx_L1_error);

  /* "ws_package/utils/hardware_event_validator.py":886
 *                 ('enabled', c_bool),
 *                 ('num_classes', c_int),
 *                 ('classes', c_void_p),             # <<<<<<<<<<<<<<
 *             ]
 * 
*/
  __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_classes);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_classes);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_mstate_global->__pyx_n_u_classes) != (0)) __PYX_ERR(0, 886, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_c_void_p);
  __Pyx_GIVEREF(__pyx_v_c_void_p);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_v_c_void_p) != (0)) __PYX_ERR(0, 886, __pyx_L1_error);

  /* "ws_package/utils/hardware_event_validator.py":879
 * 
 *         class XIDeviceInfo(Structure):
 *             _fields_ = [             # <<<<<<<<<<<<<<
 *                 ('deviceid', c_int),
 *                 ('name', ctypes.c_char_p),
*/
  __pyx_t_17 = PyList_New(7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 879, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 1, __pyx_t_12) != (0)) __PYX_ERR(0, 879, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 879, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_13);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 3, __pyx_t_13) != (0)) __PYX_ERR(0, 879, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 4, __pyx_t_14) != (0)) __PYX_ERR(0, 879, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_15);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 5, __pyx_t_15) != (0)) __PYX_ERR(0, 879, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_16);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 6, __pyx_t_16) != (0)) __PYX_ERR(0, 879, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_12 = 0;
  __pyx_t_7 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_fields, __pyx_t_17) < (0)) __PYX_ERR(0, 879, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "ws_package/utils/hardware_event_validator.py":878
 *         Display = c_void_p
 * 
 *         class XIDeviceInfo(Structure):             # <<<<<<<<<<<<<<
 *             _fields_ = [
 *                 ('deviceid', c_int),
*/
  __pyx_t_17 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_XIDeviceInfo, __pyx_t_4, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_v_XIDeviceInfo = __pyx_t_17;
  __pyx_t_17 = 0;
  __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;

  /* "ws_package/utils/hardware_event_validator.py":889
 *             ]
 * 
 *         libx11.XOpenDisplay.argtypes = [ctypes.c_char_p]             # <<<<<<<<<<<<<<
 *         libx11.XOpenDisplay.restype = Display
 *         libx11.XCloseDisplay.argtypes = [Display]
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ctypes, __pyx_mstate_global->__pyx_n_u_c_char_p); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 889, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_libx11, __pyx_mstate_global->__pyx_n_u_XOpenDisplay); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_argtypes, __pyx_t_5) < (0)) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ws_package/utils/hardware_event_validator.py":890
 * 
 *         libx11.XOpenDisplay.argtypes = [ctypes.c_char_p]
 *         libx11.XOpenDisplay.restype = Display             # <<<<<<<<<<<<<<
 *         libx11.XCloseDisplay.argtypes = [Display]
 *         libxi.XIQueryVersion.argtypes = [Display, POINTER(c_int), POINTER(c_int)]
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_libx11, __pyx_mstate_global->__pyx_n_u_XOpenDisplay); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_restype, __pyx_v_Display) < (0)) __PYX_ERR(0, 890, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ws_package/utils/hardware_event_validator.py":891
 *         libx11.XOpenDisplay.argtypes = [ctypes.c_char_p]
 *         libx11.XOpenDisplay.restype = Display
 *         libx11.XCloseDisplay.argtypes = [Display]             # <<<<<<<<<<<<<<
 *         libxi.XIQueryVersion.argtypes = [Display, POINTER(c_int), POINTER(c_int)]
 *         libxi.XIQueryDevice.argtypes = [Display, c_int, POINTER(c_int)]
*/
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_Display);
  __Pyx_GIVEREF(__pyx_v_Display);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_Display) != (0)) __PYX_ERR(0, 891, __pyx_L1_error);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_libx11, __pyx_mstate_global->__pyx_n_u_XCloseDisplay); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_argtypes, __pyx_t_4) < (0)) __PYX_ERR(0, 891, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":892
 *         libx11.XOpenDisplay.restype = Display
 *         libx11.XCloseDisplay.argtypes = [Display]
 *         libxi.XIQueryVersion.argtypes = [Display, POINTER(c_int), POINTER(c_int)]             # <<<<<<<<<<<<<<
 *         libxi.XIQueryDevice.argtypes = [Display, c_int, POINTER(c_int)]
 *         libxi.XIQueryDevice.restype = POINTER(XIDeviceInfo)
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_v_POINTER);
  __pyx_t_6 = __pyx_v_POINTER; 
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_c_int};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_v_POINTER);
  __pyx_t_17 = __pyx_v_POINTER; 
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_17))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_17);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_17);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_17, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_c_int};
    __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_17, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_17 = PyList_New(3); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_INCREF(__pyx_v_Display);
  __Pyx_GIVEREF(__pyx_v_Display);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 0, __pyx_v_Display) != (0)) __PYX_ERR(0, 892, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 892, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 2, __pyx_t_6) != (0)) __PYX_ERR(0, 892, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_libxi, __pyx_mstate_global->__pyx_n_u_XIQueryVersion); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_argtypes, __pyx_t_17) < (0)) __PYX_ERR(0, 892, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":893
 *         libx11.XCloseDisplay.argtypes = [Display]
 *         libxi.XIQueryVersion.argtypes = [Display, POINTER(c_int), POINTER(c_int)]
 *         libxi.XIQueryDevice.argtypes = [Display, c_int, POINTER(c_int)]             # <<<<<<<<<<<<<<
 *         libxi.XIQueryDevice.restype = POINTER(XIDeviceInfo)
 *         libxi.XIFreeDeviceInfo.argtypes = [POINTER(XIDeviceInfo)]
*/
  __pyx_t_17 = NULL;
  __Pyx_INCREF(__pyx_v_POINTER);
  __pyx_t_5 = __pyx_v_POINTER; 
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_17);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_17);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_v_c_int};
    __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_Display);
  __Pyx_GIVEREF(__pyx_v_Display);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_Display) != (0)) __PYX_ERR(0, 893, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_c_int);
  __Pyx_GIVEREF(__pyx_v_c_int);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_v_c_int) != (0)) __PYX_ERR(0, 893, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_t_6) != (0)) __PYX_ERR(0, 893, __pyx_L1_error);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_libxi, __pyx_mstate_global->__pyx_n_u_XIQueryDevice); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_argtypes, __pyx_t_5) < (0)) __PYX_ERR(0, 893, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":894
 *         libxi.XIQueryVersion.argtypes = [Display, POINTER(c_int), POINTER(c_int)]
 *         libxi.XIQueryDevice.argtypes = [Display, c_int, POINTER(c_int)]
 *         libxi.XIQueryDevice.restype = POINTER(XIDeviceInfo)             # <<<<<<<<<<<<<<
 *         libxi.XIFreeDeviceInfo.argtypes = [POINTER(XIDeviceInfo)]
 * 
*/
  __pyx_t_5 = NULL;
  __Pyx_INCREF(__pyx_v_POINTER);
  __pyx_t_17 = __pyx_v_POINTER; 
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_17))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_17);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_17);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_17, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_XIDeviceInfo};
    __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_17, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_libxi, __pyx_mstate_global->__pyx_n_u_XIQueryDevice); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_restype, __pyx_t_6) < (0)) __PYX_ERR(0, 894, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "ws_package/utils/hardware_event_validator.py":895
 *         libxi.XIQueryDevice.argtypes = [Display, c_int, POINTER(c_int)]
 *         libxi.XIQueryDevice.restype = POINTER(XIDeviceInfo)
 *         libxi.XIFreeDeviceInfo.argtypes = [POINTER(XIDeviceInfo)]             # <<<<<<<<<<<<<<
 * 
 *         display = libx11.XOpenDisplay(None)
*/
  __pyx_t_6 = NULL;
  __Pyx_INCREF(__pyx_v_POINTER);
  __pyx_t_5 = __pyx_v_POINTER; 
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_XIDeviceInfo};
    __pyx_t_17 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
  }
  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_17);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_17) != (0)) __PYX_ERR(0, 895, __pyx_L1_error);
  __pyx_t_17 = 0;
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_libxi, __pyx_mstate_global->__pyx_n_u_XIFreeDeviceInfo); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_argtypes, __pyx_t_5) < (0)) __PYX_ERR(0, 895, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "ws_package/utils/hardware_event_validator.py":897
 *         libxi.XIFreeDeviceInfo.argtypes = [POINTER(XIDeviceInfo)]
 * 
 *         display = libx11.XOpenDisplay(None)             # <<<<<<<<<<<<<<
 *         if not display:
 *             return set()
*/
  __pyx_t_5 = __pyx_v_libx11;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, Py_None};
    __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_XOpenDisplay, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
  }
  __pyx_v_display = __pyx_t_17;
  __pyx_t_17 = 0;

  /* "ws_package/utils/hardware_event_validator.py":898
 * 
 *         display = libx11.XOpenDisplay(None)
 *         if not display:             # <<<<<<<<<<<<<<
 *             return set()
 * 
*/
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_display); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 898, __pyx_L1_error)
  __pyx_t_10 = (!__pyx_t_9);
  if (__pyx_t_10) {

    /* "ws_package/utils/hardware_event_validator.py":899
 *         display = libx11.XOpenDisplay(None)
 *         if not display:
 *             return set()             # <<<<<<<<<<<<<<
 * 
 *         ids: Set[int] = set()
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_17 = PySet_New(0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_r = ((PyObject*)__pyx_t_17);
    __pyx_t_17 = 0;
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":898
 * 
 *         display = libx11.XOpenDisplay(None)
 *         if not display:             # <<<<<<<<<<<<<<
 *             return set()
 * 
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":901
 *             return set()
 * 
 *         ids: Set[int] = set()             # <<<<<<<<<<<<<<
 *         try:
 *             major, minor = c_int(2), c_int(0)
*/
  __pyx_t_17 = PySet_New(0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_v_ids = ((PyObject*)__pyx_t_17);
  __pyx_t_17 = 0;

  /* "ws_package/utils/hardware_event_validator.py":902
 * 
 *         ids: Set[int] = set()
 *         try:             # <<<<<<<<<<<<<<
 *             major, minor = c_int(2), c_int(0)
 *             libxi.XIQueryVersion(display, byref(major), byref(minor))
*/
  /*try:*/ {

    /* "ws_package/utils/hardware_event_validator.py":903
 *         ids: Set[int] = set()
 *         try:
 *             major, minor = c_int(2), c_int(0)             # <<<<<<<<<<<<<<
 *             libxi.XIQueryVersion(display, byref(major), byref(minor))
 *             ndevices = c_int(0)
*/
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_c_int);
    __pyx_t_6 = __pyx_v_c_int; 
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_int_2};
      __pyx_t_17 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 903, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_17);
    }
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_c_int);
    __pyx_t_4 = __pyx_v_c_int; 
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 903, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_v_major = __pyx_t_17;
    __pyx_t_17 = 0;
    __pyx_v_minor = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "ws_package/utils/hardware_event_validator.py":904
 *         try:
 *             major, minor = c_int(2), c_int(0)
 *             libxi.XIQueryVersion(display, byref(major), byref(minor))             # <<<<<<<<<<<<<<
 *             ndevices = c_int(0)
 *             devices = libxi.XIQueryDevice(display, 0, byref(ndevices))
*/
    __pyx_t_17 = __pyx_v_libxi;
    __Pyx_INCREF(__pyx_t_17);
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_byref);
    __pyx_t_16 = __pyx_v_byref; 
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_16))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_16);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_major};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 904, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_byref);
    __pyx_t_15 = __pyx_v_byref; 
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_15))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_15);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_15, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_minor};
      __pyx_t_16 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 904, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_16);
    }
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_17, __pyx_v_display, __pyx_t_4, __pyx_t_16};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_XIQueryVersion, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 904, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "ws_package/utils/hardware_event_validator.py":905
 *             major, minor = c_int(2), c_int(0)
 *             libxi.XIQueryVersion(display, byref(major), byref(minor))
 *             ndevices = c_int(0)             # <<<<<<<<<<<<<<
 *             devices = libxi.XIQueryDevice(display, 0, byref(ndevices))
 *             if devices:
*/
    __pyx_t_16 = NULL;
    __Pyx_INCREF(__pyx_v_c_int);
    __pyx_t_4 = __pyx_v_c_int; 
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_16);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_16);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 905, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_v_ndevices = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "ws_package/utils/hardware_event_validator.py":906
 *             libxi.XIQueryVersion(display, byref(major), byref(minor))
 *             ndevices = c_int(0)
 *             devices = libxi.XIQueryDevice(display, 0, byref(ndevices))             # <<<<<<<<<<<<<<
 *             if devices:
 *                 for index in range(ndevices.value):
*/
    __pyx_t_4 = __pyx_v_libxi;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_17 = NULL;
    __Pyx_INCREF(__pyx_v_byref);
    __pyx_t_15 = __pyx_v_byref; 
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_15))) {
      __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_15);
      assert(__pyx_t_17);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15);
      __Pyx_INCREF(__pyx_t_17);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_15, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_v_ndevices};
      __pyx_t_16 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 906, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_16);
    }
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_display, __pyx_mstate_global->__pyx_int_0, __pyx_t_16};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_XIQueryDevice, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 906, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_v_devices = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "ws_package/utils/hardware_event_validator.py":907
 *             ndevices = c_int(0)
 *             devices = libxi.XIQueryDevice(display, 0, byref(ndevices))
 *             if devices:             # <<<<<<<<<<<<<<
 *                 for index in range(ndevices.value):
 *                     name = devices[index].name
*/
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_devices); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 907, __pyx_L8_error)
    if (__pyx_t_10) {

      /* "ws_package/utils/hardware_event_validator.py":908
 *             devices = libxi.XIQueryDevice(display, 0, byref(ndevices))
 *             if devices:
 *                 for index in range(ndevices.value):             # <<<<<<<<<<<<<<
 *                     name = devices[index].name
 *                     label = name.decode('utf-8', 'replace') if name else ''
*/
      __pyx_t_16 = NULL;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ndevices, __pyx_mstate_global->__pyx_n_u_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_t_4};
        __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 908, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_t_4 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_18 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 908, __pyx_L8_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      for (;;) {
        {
          __pyx_t_6 = __pyx_t_18(__pyx_t_4);
          if (unlikely(!__pyx_t_6)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 908, __pyx_L8_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "ws_package/utils/hardware_event_validator.py":909
 *             if devices:
 *                 for index in range(ndevices.value):
 *                     name = devices[index].name             # <<<<<<<<<<<<<<
 *                     label = name.decode('utf-8', 'replace') if name else ''
 *                     if 'XTEST' in label.upper():
*/
        __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_devices, __pyx_v_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 909, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 909, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_16);
        __pyx_t_16 = 0;

        /* "ws_package/utils/hardware_event_validator.py":910
 *                 for index in range(ndevices.value):
 *                     name = devices[index].name
 *                     label = name.decode('utf-8', 'replace') if name else ''             # <<<<<<<<<<<<<<
 *                     if 'XTEST' in label.upper():
 *                         ids.add(devices[index].deviceid)
*/
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 910, __pyx_L8_error)
        if (__pyx_t_10) {
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_mstate_global->__pyx_n_u_decode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 910, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[3], NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 910, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_16 = __pyx_t_15;
          __pyx_t_15 = 0;
        } else {
          __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__2);
          __pyx_t_16 = __pyx_mstate_global->__pyx_kp_u__2;
        }
        __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_16);
        __pyx_t_16 = 0;

        /* "ws_package/utils/hardware_event_validator.py":911
 *                     name = devices[index].name
 *                     label = name.decode('utf-8', 'replace') if name else ''
 *                     if 'XTEST' in label.upper():             # <<<<<<<<<<<<<<
 *                         ids.add(devices[index].deviceid)
 *                 libxi.XIFreeDeviceInfo(devices)
*/
        __pyx_t_15 = __pyx_v_label;
        __Pyx_INCREF(__pyx_t_15);
        __pyx_t_8 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_15, NULL};
          __pyx_t_16 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_upper, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 911, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_16);
        }
        __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_XTEST, __pyx_t_16, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 911, __pyx_L8_error)
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        if (__pyx_t_10) {

          /* "ws_package/utils/hardware_event_validator.py":912
 *                     label = name.decode('utf-8', 'replace') if name else ''
 *                     if 'XTEST' in label.upper():
 *                         ids.add(devices[index].deviceid)             # <<<<<<<<<<<<<<
 *                 libxi.XIFreeDeviceInfo(devices)
 *         finally:
*/
          __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_devices, __pyx_v_index); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 912, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_deviceid); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 912, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __pyx_t_19 = PySet_Add(__pyx_v_ids, __pyx_t_15); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(0, 912, __pyx_L8_error)
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

          /* "ws_package/utils/hardware_event_validator.py":911
 *                     name = devices[index].name
 *                     label = name.decode('utf-8', 'replace') if name else ''
 *                     if 'XTEST' in label.upper():             # <<<<<<<<<<<<<<
 *                         ids.add(devices[index].deviceid)
 *                 libxi.XIFreeDeviceInfo(devices)
*/
        }

        /* "ws_package/utils/hardware_event_validator.py":908
 *             devices = libxi.XIQueryDevice(display, 0, byref(ndevices))
 *             if devices:
 *                 for index in range(ndevices.value):             # <<<<<<<<<<<<<<
 *                     name = devices[index].name
 *                     label = name.decode('utf-8', 'replace') if name else ''
*/
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":913
 *                     if 'XTEST' in label.upper():
 *                         ids.add(devices[index].deviceid)
 *                 libxi.XIFreeDeviceInfo(devices)             # <<<<<<<<<<<<<<
 *         finally:
 *             libx11.XCloseDisplay(display)
*/
      __pyx_t_15 = __pyx_v_libxi;
      __Pyx_INCREF(__pyx_t_15);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_devices};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_XIFreeDeviceInfo, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 913, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":907
 *             ndevices = c_int(0)
 *             devices = libxi.XIQueryDevice(display, 0, byref(ndevices))
 *             if devices:             # <<<<<<<<<<<<<<
 *                 for index in range(ndevices.value):
 *                     name = devices[index].name
*/
    }
  }

  /* "ws_package/utils/hardware_event_validator.py":915
 *                 libxi.XIFreeDeviceInfo(devices)
 *         finally:
 *             libx11.XCloseDisplay(display)             # <<<<<<<<<<<<<<
 *         return ids
 * 
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_15 = __pyx_v_libx11;
      __Pyx_INCREF(__pyx_t_15);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_display};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_XCloseDisplay, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 915, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L9;
    }
    __pyx_L8_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_2 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
      if ( unlikely(__Pyx_GetException(&__pyx_t_2, &__pyx_t_23, &__pyx_t_24) < 0)) __Pyx_ErrFetch(&__pyx_t_2, &__pyx_t_23, &__pyx_t_24);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_23);
      __Pyx_XGOTREF(__pyx_t_24);
      __Pyx_XGOTREF(__pyx_t_25);
      __Pyx_XGOTREF(__pyx_t_26);
      __Pyx_XGOTREF(__pyx_t_27);
      __pyx_t_20 = __pyx_lineno; __pyx_t_21 = __pyx_clineno; __pyx_t_22 = __pyx_filename;
      {
        __pyx_t_15 = __pyx_v_libx11;
        __Pyx_INCREF(__pyx_t_15);
        __pyx_t_8 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_display};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_XCloseDisplay, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 915, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_XGIVEREF(__pyx_t_25);
      __Pyx_XGIVEREF(__pyx_t_26);
      __Pyx_XGIVEREF(__pyx_t_27);
      __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_26, __pyx_t_27);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_23);
      __Pyx_XGIVEREF(__pyx_t_24);
      __Pyx_ErrRestore(__pyx_t_2, __pyx_t_23, __pyx_t_24);
      __pyx_t_2 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0;
      __pyx_lineno = __pyx_t_20; __pyx_clineno = __pyx_t_21; __pyx_filename = __pyx_t_22;
      goto __pyx_L1_error;
      __pyx_L16_error:;
      __Pyx_XGIVEREF(__pyx_t_25);
      __Pyx_XGIVEREF(__pyx_t_26);
      __Pyx_XGIVEREF(__pyx_t_27);
      __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_26, __pyx_t_27);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
      __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
      __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L9:;
  }

  /* "ws_package/utils/hardware_event_validator.py":916
 *         finally:
 *             libx11.XCloseDisplay(display)
 *         return ids             # <<<<<<<<<<<<<<
 * 
 *     def _automation_process_active(self) -> bool:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ids);
  __pyx_r = __pyx_v_ids;
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":866
 *         return ids
 * 
 *     def _linux_discover_xtest_device_ids_ctypes(self) -> Set[int]:             # <<<<<<<<<<<<<<
 *         """Discover XTEST device IDs via libXi (works in frozen PyInstaller builds)."""
 *         import ctypes.util
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_discover_xtest_device_ids_ctypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ctypes);
  __Pyx_XDECREF(__pyx_v_c_void_p);
  __Pyx_XDECREF(__pyx_v_c_int);
  __Pyx_XDECREF(__pyx_v_POINTER);
  __Pyx_XDECREF(__pyx_v_Structure);
  __Pyx_XDECREF(__pyx_v_byref);
  __Pyx_XDECREF(__pyx_v_c_bool);
  __Pyx_XDECREF(__pyx_v_libx11);
  __Pyx_XDECREF(__pyx_v_libxi);
  __Pyx_XDECREF(__pyx_v_Display);
  __Pyx_XDECREF(__pyx_v_XIDeviceInfo);
  __Pyx_XDECREF(__pyx_v_display);
  __Pyx_XDECREF(__pyx_v_ids);
  __Pyx_XDECREF(__pyx_v_major);
  __Pyx_XDECREF(__pyx_v_minor);
  __Pyx_XDECREF(__pyx_v_ndevices);
  __Pyx_XDECREF(__pyx_v_devices);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_label);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":918
 *         return ids
 * 
 *     def _automation_process_active(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return True when a known input-automation script/process is running."""
 *         now = time.time()
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_29_automation_process_active(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_28_automation_process_active, "Return True when a known input-automation script/process is running.");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_29_automation_process_active = {"_automation_process_active", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_29_automation_process_active, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_28_automation_process_active};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_29_automation_process_active(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_automation_process_active (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 918, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_automation_process_active", 0) < (0)) __PYX_ERR(0, 918, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_automation_process_active", 1, 1, 1, i); __PYX_ERR(0, 918, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 918, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_automation_process_active", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 918, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._automation_process_active", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_28_automation_process_active(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_28_automation_process_active(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_now = NULL;
  PyObject *__pyx_v_active = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_automation_process_active", 0);

  /* "ws_package/utils/hardware_event_validator.py":920
 *     def _automation_process_active(self) -> bool:
 *         """Return True when a known input-automation script/process is running."""
 *         now = time.time()             # <<<<<<<<<<<<<<
 *         if (now - self._automation_scan_cache_ts) < self._automation_scan_interval:
 *             return self._automation_scan_cache_active
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 920, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_now = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":921
 *         """Return True when a known input-automation script/process is running."""
 *         now = time.time()
 *         if (now - self._automation_scan_cache_ts) < self._automation_scan_interval:             # <<<<<<<<<<<<<<
 *             return self._automation_scan_cache_active
 *         active = False
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_automation_scan_cache_ts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyNumber_Subtract(__pyx_v_now, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_automation_scan_interval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 921, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 921, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_6) {

    /* "ws_package/utils/hardware_event_validator.py":922
 *         now = time.time()
 *         if (now - self._automation_scan_cache_ts) < self._automation_scan_interval:
 *             return self._automation_scan_cache_active             # <<<<<<<<<<<<<<
 *         active = False
 *         try:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_automation_scan_cache_active); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":921
 *         """Return True when a known input-automation script/process is running."""
 *         now = time.time()
 *         if (now - self._automation_scan_cache_ts) < self._automation_scan_interval:             # <<<<<<<<<<<<<<
 *             return self._automation_scan_cache_active
 *         active = False
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":923
 *         if (now - self._automation_scan_cache_ts) < self._automation_scan_interval:
 *             return self._automation_scan_cache_active
 *         active = False             # <<<<<<<<<<<<<<
 *         try:
 *             if self._platform == "Linux":
*/
  __Pyx_INCREF(Py_False);
  __pyx_v_active = Py_False;

  /* "ws_package/utils/hardware_event_validator.py":924
 *             return self._automation_scan_cache_active
 *         active = False
 *         try:             # <<<<<<<<<<<<<<
 *             if self._platform == "Linux":
 *                 active = self._scan_linux_automation_processes()
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":925
 *         active = False
 *         try:
 *             if self._platform == "Linux":             # <<<<<<<<<<<<<<
 *                 active = self._scan_linux_automation_processes()
 *             elif self._platform == "Windows":
*/
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 925, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Linux, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 925, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_6) {

        /* "ws_package/utils/hardware_event_validator.py":926
 *         try:
 *             if self._platform == "Linux":
 *                 active = self._scan_linux_automation_processes()             # <<<<<<<<<<<<<<
 *             elif self._platform == "Windows":
 *                 active = self._scan_windows_automation_processes()
*/
        __pyx_t_1 = __pyx_v_self;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_scan_linux_automation_processes, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 926, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF_SET(__pyx_v_active, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "ws_package/utils/hardware_event_validator.py":925
 *         active = False
 *         try:
 *             if self._platform == "Linux":             # <<<<<<<<<<<<<<
 *                 active = self._scan_linux_automation_processes()
 *             elif self._platform == "Windows":
*/
        goto __pyx_L10;
      }

      /* "ws_package/utils/hardware_event_validator.py":927
 *             if self._platform == "Linux":
 *                 active = self._scan_linux_automation_processes()
 *             elif self._platform == "Windows":             # <<<<<<<<<<<<<<
 *                 active = self._scan_windows_automation_processes()
 *         except Exception as e:
*/
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Windows, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 927, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_6) {

        /* "ws_package/utils/hardware_event_validator.py":928
 *                 active = self._scan_linux_automation_processes()
 *             elif self._platform == "Windows":
 *                 active = self._scan_windows_automation_processes()             # <<<<<<<<<<<<<<
 *         except Exception as e:
 *             logger.debug("Automation process scan failed: %s", e)
*/
        __pyx_t_1 = __pyx_v_self;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_scan_windows_automation_process, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 928, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF_SET(__pyx_v_active, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "ws_package/utils/hardware_event_validator.py":927
 *             if self._platform == "Linux":
 *                 active = self._scan_linux_automation_processes()
 *             elif self._platform == "Windows":             # <<<<<<<<<<<<<<
 *                 active = self._scan_windows_automation_processes()
 *         except Exception as e:
*/
      }
      __pyx_L10:;

      /* "ws_package/utils/hardware_event_validator.py":924
 *             return self._automation_scan_cache_active
 *         active = False
 *         try:             # <<<<<<<<<<<<<<
 *             if self._platform == "Linux":
 *                 active = self._scan_linux_automation_processes()
*/
    }
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ws_package/utils/hardware_event_validator.py":929
 *             elif self._platform == "Windows":
 *                 active = self._scan_windows_automation_processes()
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.debug("Automation process scan failed: %s", e)
 *         self._automation_scan_cache_active = active
*/
    __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_10) {
      __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._automation_process_active", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 929, __pyx_L6_except_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_v_e = __pyx_t_1;
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":930
 *                 active = self._scan_windows_automation_processes()
 *         except Exception as e:
 *             logger.debug("Automation process scan failed: %s", e)             # <<<<<<<<<<<<<<
 *         self._automation_scan_cache_active = active
 *         self._automation_scan_cache_ts = now
*/
        __pyx_t_11 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 930, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 930, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_13);
          assert(__pyx_t_11);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_Automation_process_scan_failed_s, __pyx_v_e};
          __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 930, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }

      /* "ws_package/utils/hardware_event_validator.py":929
 *             elif self._platform == "Windows":
 *                 active = self._scan_windows_automation_processes()
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.debug("Automation process scan failed: %s", e)
 *         self._automation_scan_cache_active = active
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          goto __pyx_L17;
        }
        __pyx_L16_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ( unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_10 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L6_except_error;
        }
        __pyx_L17:;
      }
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;

    /* "ws_package/utils/hardware_event_validator.py":924
 *             return self._automation_scan_cache_active
 *         active = False
 *         try:             # <<<<<<<<<<<<<<
 *             if self._platform == "Linux":
 *                 active = self._scan_linux_automation_processes()
*/
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    goto __pyx_L1_error;
    __pyx_L5_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    __pyx_L9_try_end:;
  }

  /* "ws_package/utils/hardware_event_validator.py":931
 *         except Exception as e:
 *             logger.debug("Automation process scan failed: %s", e)
 *         self._automation_scan_cache_active = active             # <<<<<<<<<<<<<<
 *         self._automation_scan_cache_ts = now
 *         return active
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_automation_scan_cache_active, __pyx_v_active) < (0)) __PYX_ERR(0, 931, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":932
 *             logger.debug("Automation process scan failed: %s", e)
 *         self._automation_scan_cache_active = active
 *         self._automation_scan_cache_ts = now             # <<<<<<<<<<<<<<
 *         return active
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_automation_scan_cache_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 932, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":933
 *         self._automation_scan_cache_active = active
 *         self._automation_scan_cache_ts = now
 *         return active             # <<<<<<<<<<<<<<
 * 
 *     def _scan_linux_automation_processes(self) -> bool:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_active);
  __pyx_r = __pyx_v_active;
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":918
 *         return ids
 * 
 *     def _automation_process_active(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return True when a known input-automation script/process is running."""
 *         now = time.time()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._automation_process_active", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_now);
  __Pyx_XDECREF(__pyx_v_active);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":935
 *         return active
 * 
 *     def _scan_linux_automation_processes(self) -> bool:             # <<<<<<<<<<<<<<
 *         own_pid = os.getpid()
 *         for cmdline_path in glob.glob('/proc/[0-9]*[inserted by cython to avoid comment closer]/cmdline'):
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_31_scan_linux_automation_processes(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_31_scan_linux_automation_processes = {"_scan_linux_automation_processes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_31_scan_linux_automation_processes, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_31_scan_linux_automation_processes(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_scan_linux_automation_processes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 935, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 935, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_scan_linux_automation_processes", 0) < (0)) __PYX_ERR(0, 935, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_scan_linux_automation_processes", 1, 1, 1, i); __PYX_ERR(0, 935, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 935, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_scan_linux_automation_processes", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 935, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._scan_linux_automation_processes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_30_scan_linux_automation_processes(__pyx_self, __pyx_v_self);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_32_scan_linux_automation_processes_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "ws_package/utils/hardware_event_validator.py":949
 *             except OSError:
 *                 continue
 *             if any(marker in cmdline for marker in self._automation_markers):             # <<<<<<<<<<<<<<
 *                 return True
 *         return False
*/

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_32_scan_linux_automation_processes_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr *)__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr(__pyx_mstate_global->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 949, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_32_scan_linux_automation_processes_2generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__scan_lin, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event); if (unlikely(!gen)) __PYX_ERR(0, 949, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._scan_linux_automation_processes.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_32_scan_linux_automation_processes_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 949, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 949, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 949, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 949, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 949, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 949, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 949, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_marker);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_marker, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_cmdline)) { __Pyx_RaiseClosureNameError("cmdline"); __PYX_ERR(0, 949, __pyx_L1_error) }
    __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_marker, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_cmdline, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 949, __pyx_L1_error)
    if (__pyx_t_5) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":935
 *         return active
 * 
 *     def _scan_linux_automation_processes(self) -> bool:             # <<<<<<<<<<<<<<
 *         own_pid = os.getpid()
 *         for cmdline_path in glob.glob('/proc/[0-9]*[inserted by cython to avoid comment closer]/cmdline'):
*/

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_30_scan_linux_automation_processes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes *__pyx_cur_scope;
  PyObject *__pyx_v_own_pid = NULL;
  PyObject *__pyx_v_cmdline_path = NULL;
  PyObject *__pyx_v_pid = NULL;
  PyObject *__pyx_v_handle = NULL;
  PyObject *__pyx_gb_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_32_scan_linux_automation_processes_2generator = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_scan_linux_automation_processes", 0);
  __pyx_cur_scope = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes *)__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes(__pyx_mstate_global->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 935, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }

  /* "ws_package/utils/hardware_event_validator.py":936
 * 
 *     def _scan_linux_automation_processes(self) -> bool:
 *         own_pid = os.getpid()             # <<<<<<<<<<<<<<
 *         for cmdline_path in glob.glob('/proc/[0-9]*[inserted by cython to avoid comment closer]/cmdline'):
 *             try:
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getpid); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_own_pid = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":937
 *     def _scan_linux_automation_processes(self) -> bool:
 *         own_pid = os.getpid()
 *         for cmdline_path in glob.glob('/proc/[0-9]*[inserted by cython to avoid comment closer]/cmdline'):             # <<<<<<<<<<<<<<
 *             try:
 *                 pid = int(cmdline_path.split('/')[2])
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_glob); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_glob); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_proc_0_9_cmdline};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 937, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 937, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_6;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 937, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6);
        #endif
        ++__pyx_t_6;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 937, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_cmdline_path, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "ws_package/utils/hardware_event_validator.py":938
 *         own_pid = os.getpid()
 *         for cmdline_path in glob.glob('/proc/[0-9]*[inserted by cython to avoid comment closer]/cmdline'):
 *             try:             # <<<<<<<<<<<<<<
 *                 pid = int(cmdline_path.split('/')[2])
 *             except (IndexError, ValueError):
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":939
 *         for cmdline_path in glob.glob('/proc/[0-9]*[inserted by cython to avoid comment closer]/cmdline'):
 *             try:
 *                 pid = int(cmdline_path.split('/')[2])             # <<<<<<<<<<<<<<
 *             except (IndexError, ValueError):
 *                 continue
*/
        __pyx_t_4 = __pyx_v_cmdline_path;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u__3};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_split, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 939, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 939, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 939, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_pid, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":938
 *         own_pid = os.getpid()
 *         for cmdline_path in glob.glob('/proc/[0-9]*[inserted by cython to avoid comment closer]/cmdline'):
 *             try:             # <<<<<<<<<<<<<<
 *                 pid = int(cmdline_path.split('/')[2])
 *             except (IndexError, ValueError):
*/
      }
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":940
 *             try:
 *                 pid = int(cmdline_path.split('/')[2])
 *             except (IndexError, ValueError):             # <<<<<<<<<<<<<<
 *                 continue
 *             if pid == own_pid:
*/
      __pyx_t_11 = __Pyx_PyErr_ExceptionMatches2(((PyObject *)(((PyTypeObject*)PyExc_IndexError))), ((PyObject *)(((PyTypeObject*)PyExc_ValueError))));
      if (__pyx_t_11) {
        __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._scan_linux_automation_processes", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_2) < 0) __PYX_ERR(0, 940, __pyx_L7_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_2);

        /* "ws_package/utils/hardware_event_validator.py":941
 *                 pid = int(cmdline_path.split('/')[2])
 *             except (IndexError, ValueError):
 *                 continue             # <<<<<<<<<<<<<<
 *             if pid == own_pid:
 *                 continue
*/
        goto __pyx_L13_except_continue;
        __pyx_L13_except_continue:;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L11_try_continue;
      }
      goto __pyx_L7_except_error;

      /* "ws_package/utils/hardware_event_validator.py":938
 *         own_pid = os.getpid()
 *         for cmdline_path in glob.glob('/proc/[0-9]*[inserted by cython to avoid comment closer]/cmdline'):
 *             try:             # <<<<<<<<<<<<<<
 *                 pid = int(cmdline_path.split('/')[2])
 *             except (IndexError, ValueError):
*/
      __pyx_L7_except_error:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      goto __pyx_L1_error;
      __pyx_L11_try_continue:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      goto __pyx_L3_continue;
      __pyx_L12_try_end:;
    }

    /* "ws_package/utils/hardware_event_validator.py":942
 *             except (IndexError, ValueError):
 *                 continue
 *             if pid == own_pid:             # <<<<<<<<<<<<<<
 *                 continue
 *             try:
*/
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_pid, __pyx_v_own_pid, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 942, __pyx_L1_error)
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 942, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_12) {

      /* "ws_package/utils/hardware_event_validator.py":943
 *                 continue
 *             if pid == own_pid:
 *                 continue             # <<<<<<<<<<<<<<
 *             try:
 *                 with open(cmdline_path, 'rb') as handle:
*/
      goto __pyx_L3_continue;

      /* "ws_package/utils/hardware_event_validator.py":942
 *             except (IndexError, ValueError):
 *                 continue
 *             if pid == own_pid:             # <<<<<<<<<<<<<<
 *                 continue
 *             try:
*/
    }

    /* "ws_package/utils/hardware_event_validator.py":944
 *             if pid == own_pid:
 *                 continue
 *             try:             # <<<<<<<<<<<<<<
 *                 with open(cmdline_path, 'rb') as handle:
 *                     cmdline = handle.read().replace(b'\x00', b' ').decode('utf-8', 'ignore').lower()
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":945
 *                 continue
 *             try:
 *                 with open(cmdline_path, 'rb') as handle:             # <<<<<<<<<<<<<<
 *                     cmdline = handle.read().replace(b'\x00', b' ').decode('utf-8', 'ignore').lower()
 *             except OSError:
*/
        /*with:*/ {
          __pyx_t_4 = NULL;
          __pyx_t_5 = 1;
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_cmdline_path, __pyx_mstate_global->__pyx_n_u_rb};
            __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 945, __pyx_L16_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __pyx_t_13 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 945, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_1 = NULL;
          __pyx_t_14 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 945, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_5 = 1;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
            assert(__pyx_t_1);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
            __pyx_t_5 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
            __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 945, __pyx_L24_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __pyx_t_14 = __pyx_t_4;
          __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          /*try:*/ {
            {
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
              __Pyx_XGOTREF(__pyx_t_15);
              __Pyx_XGOTREF(__pyx_t_16);
              __Pyx_XGOTREF(__pyx_t_17);
              /*try:*/ {
                __Pyx_XDECREF_SET(__pyx_v_handle, __pyx_t_14);
                __pyx_t_14 = 0;

                /* "ws_package/utils/hardware_event_validator.py":946
 *             try:
 *                 with open(cmdline_path, 'rb') as handle:
 *                     cmdline = handle.read().replace(b'\x00', b' ').decode('utf-8', 'ignore').lower()             # <<<<<<<<<<<<<<
 *             except OSError:
 *                 continue
*/
                __pyx_t_1 = __pyx_v_handle;
                __Pyx_INCREF(__pyx_t_1);
                __pyx_t_5 = 0;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
                  __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_read, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 946, __pyx_L30_error)
                  __Pyx_GOTREF(__pyx_t_4);
                }
                __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 946, __pyx_L30_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[4], NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 946, __pyx_L30_error)
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 946, __pyx_L30_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[5], NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 946, __pyx_L30_error)
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_2 = __pyx_t_4;
                __Pyx_INCREF(__pyx_t_2);
                __pyx_t_5 = 0;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
                  __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_lower, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 946, __pyx_L30_error)
                  __Pyx_GOTREF(__pyx_t_14);
                }
                __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_cmdline);
                __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_cmdline, __pyx_t_14);
                __Pyx_GIVEREF(__pyx_t_14);
                __pyx_t_14 = 0;

                /* "ws_package/utils/hardware_event_validator.py":945
 *                 continue
 *             try:
 *                 with open(cmdline_path, 'rb') as handle:             # <<<<<<<<<<<<<<
 *                     cmdline = handle.read().replace(b'\x00', b' ').decode('utf-8', 'ignore').lower()
 *             except OSError:
*/
              }
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
              goto __pyx_L37_try_end;
              __pyx_L30_error:;
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              /*except:*/ {
                __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._scan_linux_automation_processes", __pyx_clineno, __pyx_lineno, __pyx_filename);
                if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_4, &__pyx_t_2) < 0) __PYX_ERR(0, 945, __pyx_L32_except_error)
                __Pyx_XGOTREF(__pyx_t_14);
                __Pyx_XGOTREF(__pyx_t_4);
                __Pyx_XGOTREF(__pyx_t_2);
                __pyx_t_1 = PyTuple_Pack(3, __pyx_t_14, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L32_except_error)
                __Pyx_GOTREF(__pyx_t_1);
                __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_1, NULL);
                __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 945, __pyx_L32_except_error)
                __Pyx_GOTREF(__pyx_t_18);
                __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_18);
                __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                if (__pyx_t_12 < (0)) __PYX_ERR(0, 945, __pyx_L32_except_error)
                __pyx_t_19 = (!__pyx_t_12);
                if (unlikely(__pyx_t_19)) {
                  __Pyx_GIVEREF(__pyx_t_14);
                  __Pyx_GIVEREF(__pyx_t_4);
                  __Pyx_XGIVEREF(__pyx_t_2);
                  __Pyx_ErrRestoreWithState(__pyx_t_14, __pyx_t_4, __pyx_t_2);
                  __pyx_t_14 = 0;  __pyx_t_4 = 0;  __pyx_t_2 = 0; 
                  __PYX_ERR(0, 945, __pyx_L32_except_error)
                }
                __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                goto __pyx_L31_exception_handled;
              }
              __pyx_L32_except_error:;
              __Pyx_XGIVEREF(__pyx_t_15);
              __Pyx_XGIVEREF(__pyx_t_16);
              __Pyx_XGIVEREF(__pyx_t_17);
              __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
              goto __pyx_L16_error;
              __pyx_L31_exception_handled:;
              __Pyx_XGIVEREF(__pyx_t_15);
              __Pyx_XGIVEREF(__pyx_t_16);
              __Pyx_XGIVEREF(__pyx_t_17);
              __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
              __pyx_L37_try_end:;
            }
          }
          /*finally:*/ {
            /*normal exit:*/{
              if (__pyx_t_13) {
                __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[2], NULL);
                __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 945, __pyx_L16_error)
                __Pyx_GOTREF(__pyx_t_17);
                __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
              }
              goto __pyx_L29;
            }
            __pyx_L29:;
          }
          goto __pyx_L41;
          __pyx_L24_error:;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          goto __pyx_L16_error;
          __pyx_L41:;
        }

        /* "ws_package/utils/hardware_event_validator.py":944
 *             if pid == own_pid:
 *                 continue
 *             try:             # <<<<<<<<<<<<<<
 *                 with open(cmdline_path, 'rb') as handle:
 *                     cmdline = handle.read().replace(b'\x00', b' ').decode('utf-8', 'ignore').lower()
*/
      }
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L23_try_end;
      __pyx_L16_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":947
 *                 with open(cmdline_path, 'rb') as handle:
 *                     cmdline = handle.read().replace(b'\x00', b' ').decode('utf-8', 'ignore').lower()
 *             except OSError:             # <<<<<<<<<<<<<<
 *                 continue
 *             if any(marker in cmdline for marker in self._automation_markers):
*/
      __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_OSError))));
      if (__pyx_t_11) {
        __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._scan_linux_automation_processes", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_14) < 0) __PYX_ERR(0, 947, __pyx_L18_except_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_14);

        /* "ws_package/utils/hardware_event_validator.py":948
 *                     cmdline = handle.read().replace(b'\x00', b' ').decode('utf-8', 'ignore').lower()
 *             except OSError:
 *                 continue             # <<<<<<<<<<<<<<
 *             if any(marker in cmdline for marker in self._automation_markers):
 *                 return True
*/
        goto __pyx_L42_except_continue;
        __pyx_L42_except_continue:;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L22_try_continue;
      }
      goto __pyx_L18_except_error;

      /* "ws_package/utils/hardware_event_validator.py":944
 *             if pid == own_pid:
 *                 continue
 *             try:             # <<<<<<<<<<<<<<
 *                 with open(cmdline_path, 'rb') as handle:
 *                     cmdline = handle.read().replace(b'\x00', b' ').decode('utf-8', 'ignore').lower()
*/
      __pyx_L18_except_error:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      goto __pyx_L1_error;
      __pyx_L22_try_continue:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      goto __pyx_L3_continue;
      __pyx_L23_try_end:;
    }

    /* "ws_package/utils/hardware_event_validator.py":949
 *             except OSError:
 *                 continue
 *             if any(marker in cmdline for marker in self._automation_markers):             # <<<<<<<<<<<<<<
 *                 return True
 *         return False
*/
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_automation_markers); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_4 = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_32_scan_linux_automation_processes_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 949, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (__pyx_t_19) {

      /* "ws_package/utils/hardware_event_validator.py":950
 *                 continue
 *             if any(marker in cmdline for marker in self._automation_markers):
 *                 return True             # <<<<<<<<<<<<<<
 *         return False
 * 
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "ws_package/utils/hardware_event_validator.py":949
 *             except OSError:
 *                 continue
 *             if any(marker in cmdline for marker in self._automation_markers):             # <<<<<<<<<<<<<<
 *                 return True
 *         return False
*/
    }

    /* "ws_package/utils/hardware_event_validator.py":937
 *     def _scan_linux_automation_processes(self) -> bool:
 *         own_pid = os.getpid()
 *         for cmdline_path in glob.glob('/proc/[0-9]*[inserted by cython to avoid comment closer]/cmdline'):             # <<<<<<<<<<<<<<
 *             try:
 *                 pid = int(cmdline_path.split('/')[2])
*/
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "ws_package/utils/hardware_event_validator.py":951
 *             if any(marker in cmdline for marker in self._automation_markers):
 *                 return True
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     def _scan_windows_automation_processes(self) -> bool:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":935
 *         return active
 * 
 *     def _scan_linux_automation_processes(self) -> bool:             # <<<<<<<<<<<<<<
 *         own_pid = os.getpid()
 *         for cmdline_path in glob.glob('/proc/[0-9]*[inserted by cython to avoid comment closer]/cmdline'):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._scan_linux_automation_processes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_own_pid);
  __Pyx_XDECREF(__pyx_v_cmdline_path);
  __Pyx_XDECREF(__pyx_v_pid);
  __Pyx_XDECREF(__pyx_v_handle);
  __Pyx_XDECREF(__pyx_gb_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_32_scan_linux_automation_processes_2generator);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":953
 *         return False
 * 
 *     def _scan_windows_automation_processes(self) -> bool:             # <<<<<<<<<<<<<<
 *         own_pid = os.getpid()
 *         try:
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_33_scan_windows_automation_processes(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_33_scan_windows_automation_processes = {"_scan_windows_automation_processes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_33_scan_windows_automation_processes, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_33_scan_windows_automation_processes(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_scan_windows_automation_processes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 953, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 953, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_scan_windows_automation_processes", 0) < (0)) __PYX_ERR(0, 953, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_scan_windows_automation_processes", 1, 1, 1, i); __PYX_ERR(0, 953, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 953, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_scan_windows_automation_processes", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 953, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._scan_windows_automation_processes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_32_scan_windows_automation_processes(__pyx_self, __pyx_v_self);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_34_scan_windows_automation_processes_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "ws_package/utils/hardware_event_validator.py":966
 *                 name = (proc.info['name'] or '').lower()
 *                 haystack = f"{cmdline} {name}"
 *                 if any(marker in haystack for marker in self._automation_markers):             # <<<<<<<<<<<<<<
 *                     return True
 *             except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
*/

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_34_scan_windows_automation_processes_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr *)__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr(__pyx_mstate_global->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 966, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_34_scan_windows_automation_processes_2generator1, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__scan_win, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event); if (unlikely(!gen)) __PYX_ERR(0, 966, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._scan_windows_automation_processes.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_34_scan_windows_automation_processes_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 966, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 966, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 966, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 966, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 966, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 966, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_marker);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_marker, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_haystack)) { __Pyx_RaiseClosureNameError("haystack"); __PYX_ERR(0, 966, __pyx_L1_error) }
    if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_haystack == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 966, __pyx_L1_error)
    }
    __pyx_t_5 = (__Pyx_PyUnicode_ContainsTF(__pyx_cur_scope->__pyx_v_marker, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_haystack, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 966, __pyx_L1_error)
    if (__pyx_t_5) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":953
 *         return False
 * 
 *     def _scan_windows_automation_processes(self) -> bool:             # <<<<<<<<<<<<<<
 *         own_pid = os.getpid()
 *         try:
*/

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_32_scan_windows_automation_processes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes *__pyx_cur_scope;
  PyObject *__pyx_v_own_pid = NULL;
  PyObject *__pyx_v_psutil = NULL;
  PyObject *__pyx_v_proc = NULL;
  PyObject *__pyx_v_cmdline = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_gb_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_34_scan_windows_automation_processes_2generator1 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16[3];
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_scan_windows_automation_processes", 0);
  __pyx_cur_scope = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes *)__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes(__pyx_mstate_global->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 953, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }

  /* "ws_package/utils/hardware_event_validator.py":954
 * 
 *     def _scan_windows_automation_processes(self) -> bool:
 *         own_pid = os.getpid()             # <<<<<<<<<<<<<<
 *         try:
 *             import psutil
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getpid); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_own_pid = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":955
 *     def _scan_windows_automation_processes(self) -> bool:
 *         own_pid = os.getpid()
 *         try:             # <<<<<<<<<<<<<<
 *             import psutil
 *         except ImportError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":956
 *         own_pid = os.getpid()
 *         try:
 *             import psutil             # <<<<<<<<<<<<<<
 *         except ImportError:
 *             return False
*/
      __pyx_t_9 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psutil, 0, 0, NULL, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 956, __pyx_L3_error)
      __pyx_t_1 = __pyx_t_9;
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_psutil = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "ws_package/utils/hardware_event_validator.py":955
 *     def _scan_windows_automation_processes(self) -> bool:
 *         own_pid = os.getpid()
 *         try:             # <<<<<<<<<<<<<<
 *             import psutil
 *         except ImportError:
*/
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "ws_package/utils/hardware_event_validator.py":957
 *         try:
 *             import psutil
 *         except ImportError:             # <<<<<<<<<<<<<<
 *             return False
 *         for proc in psutil.process_iter(['pid', 'cmdline', 'name']):
*/
    __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError))));
    if (__pyx_t_10) {
      __Pyx_ErrRestore(0,0,0);

      /* "ws_package/utils/hardware_event_validator.py":958
 *             import psutil
 *         except ImportError:
 *             return False             # <<<<<<<<<<<<<<
 *         for proc in psutil.process_iter(['pid', 'cmdline', 'name']):
 *             try:
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;

    /* "ws_package/utils/hardware_event_validator.py":955
 *     def _scan_windows_automation_processes(self) -> bool:
 *         own_pid = os.getpid()
 *         try:             # <<<<<<<<<<<<<<
 *             import psutil
 *         except ImportError:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "ws_package/utils/hardware_event_validator.py":959
 *         except ImportError:
 *             return False
 *         for proc in psutil.process_iter(['pid', 'cmdline', 'name']):             # <<<<<<<<<<<<<<
 *             try:
 *                 if proc.info['pid'] == own_pid:
*/
  __pyx_t_4 = __pyx_v_psutil;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_pid);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_pid);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_n_u_pid) != (0)) __PYX_ERR(0, 959, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_cmdline);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_cmdline);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_n_u_cmdline) != (0)) __PYX_ERR(0, 959, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_name);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_name);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_mstate_global->__pyx_n_u_name) != (0)) __PYX_ERR(0, 959, __pyx_L1_error);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_process_iter, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __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_11 = 0;
    __pyx_t_12 = NULL;
  } else {
    __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 959, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_12)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 959, __pyx_L1_error)
          #endif
          if (__pyx_t_11 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_11;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 959, __pyx_L1_error)
          #endif
          if (__pyx_t_11 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11);
        #endif
        ++__pyx_t_11;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_12(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 959, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_proc, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "ws_package/utils/hardware_event_validator.py":960
 *             return False
 *         for proc in psutil.process_iter(['pid', 'cmdline', 'name']):
 *             try:             # <<<<<<<<<<<<<<
 *                 if proc.info['pid'] == own_pid:
 *                     continue
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_6);
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":961
 *         for proc in psutil.process_iter(['pid', 'cmdline', 'name']):
 *             try:
 *                 if proc.info['pid'] == own_pid:             # <<<<<<<<<<<<<<
 *                     continue
 *                 cmdline = ' '.join(proc.info['cmdline'] or []).lower()
*/
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_mstate_global->__pyx_n_u_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pid); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 961, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_own_pid, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L13_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 961, __pyx_L13_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_13) {

          /* "ws_package/utils/hardware_event_validator.py":962
 *             try:
 *                 if proc.info['pid'] == own_pid:
 *                     continue             # <<<<<<<<<<<<<<
 *                 cmdline = ' '.join(proc.info['cmdline'] or []).lower()
 *                 name = (proc.info['name'] or '').lower()
*/
          goto __pyx_L19_try_continue;

          /* "ws_package/utils/hardware_event_validator.py":961
 *         for proc in psutil.process_iter(['pid', 'cmdline', 'name']):
 *             try:
 *                 if proc.info['pid'] == own_pid:             # <<<<<<<<<<<<<<
 *                     continue
 *                 cmdline = ' '.join(proc.info['cmdline'] or []).lower()
*/
        }

        /* "ws_package/utils/hardware_event_validator.py":963
 *                 if proc.info['pid'] == own_pid:
 *                     continue
 *                 cmdline = ' '.join(proc.info['cmdline'] or []).lower()             # <<<<<<<<<<<<<<
 *                 name = (proc.info['name'] or '').lower()
 *                 haystack = f"{cmdline} {name}"
*/
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_mstate_global->__pyx_n_u_info); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 963, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = __Pyx_PyObject_Dict_GetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_cmdline); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 963, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 963, __pyx_L13_error)
        if (!__pyx_t_13) {
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        } else {
          __Pyx_INCREF(__pyx_t_15);
          __pyx_t_3 = __pyx_t_15;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          goto __pyx_L22_bool_binop_done;
        }
        __pyx_t_15 = PyList_New(0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 963, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_INCREF(__pyx_t_15);
        __pyx_t_3 = __pyx_t_15;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_L22_bool_binop_done:;
        __pyx_t_15 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__5, __pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 963, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_4 = __pyx_t_15;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_lower, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_XDECREF_SET(__pyx_v_cmdline, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":964
 *                     continue
 *                 cmdline = ' '.join(proc.info['cmdline'] or []).lower()
 *                 name = (proc.info['name'] or '').lower()             # <<<<<<<<<<<<<<
 *                 haystack = f"{cmdline} {name}"
 *                 if any(marker in haystack for marker in self._automation_markers):
*/
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_mstate_global->__pyx_n_u_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 964, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_14 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 964, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 964, __pyx_L13_error)
        if (!__pyx_t_13) {
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        } else {
          __Pyx_INCREF(__pyx_t_14);
          __pyx_t_4 = __pyx_t_14;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          goto __pyx_L24_bool_binop_done;
        }
        __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__2);
        __pyx_t_4 = __pyx_mstate_global->__pyx_kp_u__2;
        __pyx_L24_bool_binop_done:;
        __pyx_t_15 = __pyx_t_4;
        __Pyx_INCREF(__pyx_t_15);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_15, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_lower, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 964, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":965
 *                 cmdline = ' '.join(proc.info['cmdline'] or []).lower()
 *                 name = (proc.info['name'] or '').lower()
 *                 haystack = f"{cmdline} {name}"             # <<<<<<<<<<<<<<
 *                 if any(marker in haystack for marker in self._automation_markers):
 *                     return True
*/
        __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_name, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_16[0] = __pyx_v_cmdline;
        __pyx_t_16[1] = __pyx_mstate_global->__pyx_kp_u__5;
        __pyx_t_16[2] = __pyx_t_1;
        __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_16, 3, __Pyx_PyUnicode_GET_LENGTH(__pyx_v_cmdline) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_cmdline) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1));
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 965, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_haystack);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_haystack, ((PyObject*)__pyx_t_4));
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;

        /* "ws_package/utils/hardware_event_validator.py":966
 *                 name = (proc.info['name'] or '').lower()
 *                 haystack = f"{cmdline} {name}"
 *                 if any(marker in haystack for marker in self._automation_markers):             # <<<<<<<<<<<<<<
 *                     return True
 *             except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
*/
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_automation_markers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_34_scan_windows_automation_processes_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 966, __pyx_L13_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_13) {

          /* "ws_package/utils/hardware_event_validator.py":967
 *                 haystack = f"{cmdline} {name}"
 *                 if any(marker in haystack for marker in self._automation_markers):
 *                     return True             # <<<<<<<<<<<<<<
 *             except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
 *                 continue
*/
          __Pyx_XDECREF(__pyx_r);
          __Pyx_INCREF(Py_True);
          __pyx_r = Py_True;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L17_try_return;

          /* "ws_package/utils/hardware_event_validator.py":966
 *                 name = (proc.info['name'] or '').lower()
 *                 haystack = f"{cmdline} {name}"
 *                 if any(marker in haystack for marker in self._automation_markers):             # <<<<<<<<<<<<<<
 *                     return True
 *             except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
*/
        }

        /* "ws_package/utils/hardware_event_validator.py":960
 *             return False
 *         for proc in psutil.process_iter(['pid', 'cmdline', 'name']):
 *             try:             # <<<<<<<<<<<<<<
 *                 if proc.info['pid'] == own_pid:
 *                     continue
*/
      }
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L20_try_end;
      __pyx_L13_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":968
 *                 if any(marker in haystack for marker in self._automation_markers):
 *                     return True
 *             except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):             # <<<<<<<<<<<<<<
 *                 continue
 *         return False
*/
      __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_1, &__pyx_t_15);
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_psutil, __pyx_mstate_global->__pyx_n_u_NoSuchProcess); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 968, __pyx_L15_except_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_psutil, __pyx_mstate_global->__pyx_n_u_AccessDenied); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 968, __pyx_L15_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_psutil, __pyx_mstate_global->__pyx_n_u_ZombieProcess); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 968, __pyx_L15_except_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_10 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_14) || __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_3) || __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_17);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_ErrRestore(__pyx_t_4, __pyx_t_1, __pyx_t_15);
      __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_15 = 0;
      if (__pyx_t_10) {
        __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._scan_windows_automation_processes", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_15, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 968, __pyx_L15_except_error)
        __Pyx_XGOTREF(__pyx_t_15);
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_4);

        /* "ws_package/utils/hardware_event_validator.py":969
 *                     return True
 *             except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
 *                 continue             # <<<<<<<<<<<<<<
 *         return False
 * 
*/
        goto __pyx_L27_except_continue;
        __pyx_L27_except_continue:;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L19_try_continue;
      }
      goto __pyx_L15_except_error;

      /* "ws_package/utils/hardware_event_validator.py":960
 *             return False
 *         for proc in psutil.process_iter(['pid', 'cmdline', 'name']):
 *             try:             # <<<<<<<<<<<<<<
 *                 if proc.info['pid'] == own_pid:
 *                     continue
*/
      __pyx_L15_except_error:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      goto __pyx_L1_error;
      __pyx_L19_try_continue:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      goto __pyx_L11_continue;
      __pyx_L17_try_return:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      goto __pyx_L0;
      __pyx_L20_try_end:;
    }

    /* "ws_package/utils/hardware_event_validator.py":959
 *         except ImportError:
 *             return False
 *         for proc in psutil.process_iter(['pid', 'cmdline', 'name']):             # <<<<<<<<<<<<<<
 *             try:
 *                 if proc.info['pid'] == own_pid:
*/
    __pyx_L11_continue:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":970
 *             except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
 *                 continue
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     def _linux_automation_process_active(self) -> bool:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":953
 *         return False
 * 
 *     def _scan_windows_automation_processes(self) -> bool:             # <<<<<<<<<<<<<<
 *         own_pid = os.getpid()
 *         try:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._scan_windows_automation_processes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_own_pid);
  __Pyx_XDECREF(__pyx_v_psutil);
  __Pyx_XDECREF(__pyx_v_proc);
  __Pyx_XDECREF(__pyx_v_cmdline);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_gb_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_34_scan_windows_automation_processes_2generator1);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":972
 *         return False
 * 
 *     def _linux_automation_process_active(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return True when a known input-automation script/process is running."""
 *         return self._automation_process_active()
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_35_linux_automation_process_active(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_34_linux_automation_process_active, "Return True when a known input-automation script/process is running.");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_35_linux_automation_process_active = {"_linux_automation_process_active", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_35_linux_automation_process_active, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_34_linux_automation_process_active};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_35_linux_automation_process_active(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_linux_automation_process_active (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 972, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 972, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_linux_automation_process_active", 0) < (0)) __PYX_ERR(0, 972, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_linux_automation_process_active", 1, 1, 1, i); __PYX_ERR(0, 972, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 972, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_linux_automation_process_active", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 972, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_automation_process_active", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_34_linux_automation_process_active(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_34_linux_automation_process_active(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_linux_automation_process_active", 0);

  /* "ws_package/utils/hardware_event_validator.py":974
 *     def _linux_automation_process_active(self) -> bool:
 *         """Return True when a known input-automation script/process is running."""
 *         return self._automation_process_active()             # <<<<<<<<<<<<<<
 * 
 *     def _linux_open_evdev_devices(self) -> int:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_automation_process_active, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":972
 *         return False
 * 
 *     def _linux_automation_process_active(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return True when a known input-automation script/process is running."""
 *         return self._automation_process_active()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_automation_process_active", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":976
 *         return self._automation_process_active()
 * 
 *     def _linux_open_evdev_devices(self) -> int:             # <<<<<<<<<<<<<<
 *         """Open physical keyboard/mouse evdev nodes for synchronous draining."""
 *         evdev = self._evdev_module
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_37_linux_open_evdev_devices(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_36_linux_open_evdev_devices, "Open physical keyboard/mouse evdev nodes for synchronous draining.");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_37_linux_open_evdev_devices = {"_linux_open_evdev_devices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_37_linux_open_evdev_devices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_36_linux_open_evdev_devices};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_37_linux_open_evdev_devices(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_linux_open_evdev_devices (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 976, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 976, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_linux_open_evdev_devices", 0) < (0)) __PYX_ERR(0, 976, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_linux_open_evdev_devices", 1, 1, 1, i); __PYX_ERR(0, 976, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 976, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_linux_open_evdev_devices", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 976, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_open_evdev_devices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_36_linux_open_evdev_devices(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_36_linux_open_evdev_devices(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_evdev = NULL;
  PyObject *__pyx_v_ecodes = NULL;
  PyObject *__pyx_v_opened = NULL;
  PyObject *__pyx_v_path = NULL;
  PyObject *__pyx_v_device = NULL;
  PyObject *__pyx_v_name_lower = NULL;
  PyObject *__pyx_v_caps = NULL;
  PyObject *__pyx_v_key_codes = NULL;
  PyObject *__pyx_v_is_keyboard = NULL;
  PyObject *__pyx_v_is_mouse = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  int __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  char const *__pyx_t_20;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  char const *__pyx_t_27;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_linux_open_evdev_devices", 0);

  /* "ws_package/utils/hardware_event_validator.py":978
 *     def _linux_open_evdev_devices(self) -> int:
 *         """Open physical keyboard/mouse evdev nodes for synchronous draining."""
 *         evdev = self._evdev_module             # <<<<<<<<<<<<<<
 *         ecodes = evdev.ecodes
 *         opened = 0
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_evdev_module); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_evdev = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":979
 *         """Open physical keyboard/mouse evdev nodes for synchronous draining."""
 *         evdev = self._evdev_module
 *         ecodes = evdev.ecodes             # <<<<<<<<<<<<<<
 *         opened = 0
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_evdev, __pyx_mstate_global->__pyx_n_u_ecodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ecodes = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":980
 *         evdev = self._evdev_module
 *         ecodes = evdev.ecodes
 *         opened = 0             # <<<<<<<<<<<<<<
 * 
 *         for path in evdev.list_devices():
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_v_opened = __pyx_mstate_global->__pyx_int_0;

  /* "ws_package/utils/hardware_event_validator.py":982
 *         opened = 0
 * 
 *         for path in evdev.list_devices():             # <<<<<<<<<<<<<<
 *             try:
 *                 device = evdev.InputDevice(path)
*/
  __pyx_t_2 = __pyx_v_evdev;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_list_devices, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __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_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 982, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_4;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 982, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4);
        #endif
        ++__pyx_t_4;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 982, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_path, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "ws_package/utils/hardware_event_validator.py":983
 * 
 *         for path in evdev.list_devices():
 *             try:             # <<<<<<<<<<<<<<
 *                 device = evdev.InputDevice(path)
 *                 name_lower = (device.name or '').lower()
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":984
 *         for path in evdev.list_devices():
 *             try:
 *                 device = evdev.InputDevice(path)             # <<<<<<<<<<<<<<
 *                 name_lower = (device.name or '').lower()
 *                 if 'virtual' in name_lower or 'uinput' in name_lower:
*/
        __pyx_t_9 = __pyx_v_evdev;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_path};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_InputDevice, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_XDECREF_SET(__pyx_v_device, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":985
 *             try:
 *                 device = evdev.InputDevice(path)
 *                 name_lower = (device.name or '').lower()             # <<<<<<<<<<<<<<
 *                 if 'virtual' in name_lower or 'uinput' in name_lower:
 *                     continue
*/
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_device, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 985, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 985, __pyx_L5_error)
        if (!__pyx_t_12) {
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        } else {
          __Pyx_INCREF(__pyx_t_11);
          __pyx_t_10 = __pyx_t_11;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L13_bool_binop_done;
        }
        __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__2);
        __pyx_t_10 = __pyx_mstate_global->__pyx_kp_u__2;
        __pyx_L13_bool_binop_done:;
        __pyx_t_9 = __pyx_t_10;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_lower, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_XDECREF_SET(__pyx_v_name_lower, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":986
 *                 device = evdev.InputDevice(path)
 *                 name_lower = (device.name or '').lower()
 *                 if 'virtual' in name_lower or 'uinput' in name_lower:             # <<<<<<<<<<<<<<
 *                     continue
 * 
*/
        __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_virtual, __pyx_v_name_lower, Py_EQ)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 986, __pyx_L5_error)
        if (!__pyx_t_13) {
        } else {
          __pyx_t_12 = __pyx_t_13;
          goto __pyx_L16_bool_binop_done;
        }
        __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_uinput, __pyx_v_name_lower, Py_EQ)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 986, __pyx_L5_error)
        __pyx_t_12 = __pyx_t_13;
        __pyx_L16_bool_binop_done:;
        if (__pyx_t_12) {

          /* "ws_package/utils/hardware_event_validator.py":987
 *                 name_lower = (device.name or '').lower()
 *                 if 'virtual' in name_lower or 'uinput' in name_lower:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *                 caps = device.capabilities(absinfo=False)
*/
          goto __pyx_L11_try_continue;

          /* "ws_package/utils/hardware_event_validator.py":986
 *                 device = evdev.InputDevice(path)
 *                 name_lower = (device.name or '').lower()
 *                 if 'virtual' in name_lower or 'uinput' in name_lower:             # <<<<<<<<<<<<<<
 *                     continue
 * 
*/
        }

        /* "ws_package/utils/hardware_event_validator.py":989
 *                     continue
 * 
 *                 caps = device.capabilities(absinfo=False)             # <<<<<<<<<<<<<<
 *                 key_codes = caps.get(ecodes.EV_KEY, [])
 *                 is_keyboard = ecodes.EV_KEY in caps and ecodes.KEY_A in key_codes
*/
        __pyx_t_10 = __pyx_v_device;
        __Pyx_INCREF(__pyx_t_10);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_10, NULL};
          __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 989, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_absinfo, Py_False, __pyx_t_9, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 989, __pyx_L5_error)
          __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_capabilities, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_XDECREF_SET(__pyx_v_caps, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":990
 * 
 *                 caps = device.capabilities(absinfo=False)
 *                 key_codes = caps.get(ecodes.EV_KEY, [])             # <<<<<<<<<<<<<<
 *                 is_keyboard = ecodes.EV_KEY in caps and ecodes.KEY_A in key_codes
 *                 is_mouse = ecodes.EV_REL in caps or (
*/
        __pyx_t_9 = __pyx_v_caps;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_ecodes, __pyx_mstate_global->__pyx_n_u_EV_KEY); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 990, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 990, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_10, __pyx_t_11};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_XDECREF_SET(__pyx_v_key_codes, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":991
 *                 caps = device.capabilities(absinfo=False)
 *                 key_codes = caps.get(ecodes.EV_KEY, [])
 *                 is_keyboard = ecodes.EV_KEY in caps and ecodes.KEY_A in key_codes             # <<<<<<<<<<<<<<
 *                 is_mouse = ecodes.EV_REL in caps or (
 *                     ecodes.EV_ABS in caps and ecodes.ABS_X in caps.get(ecodes.EV_ABS, [])
*/
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_ecodes, __pyx_mstate_global->__pyx_n_u_EV_KEY); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 991, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_11, __pyx_v_caps, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 991, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (__pyx_t_12) {
        } else {
          __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 991, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_1 = __pyx_t_11;
          __pyx_t_11 = 0;
          goto __pyx_L18_bool_binop_done;
        }
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_ecodes, __pyx_mstate_global->__pyx_n_u_KEY_A); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 991, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_11, __pyx_v_key_codes, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 991, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 991, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_1 = __pyx_t_11;
        __pyx_t_11 = 0;
        __pyx_L18_bool_binop_done:;
        __Pyx_XDECREF_SET(__pyx_v_is_keyboard, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":992
 *                 key_codes = caps.get(ecodes.EV_KEY, [])
 *                 is_keyboard = ecodes.EV_KEY in caps and ecodes.KEY_A in key_codes
 *                 is_mouse = ecodes.EV_REL in caps or (             # <<<<<<<<<<<<<<
 *                     ecodes.EV_ABS in caps and ecodes.ABS_X in caps.get(ecodes.EV_ABS, [])
 *                 )
*/
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_ecodes, __pyx_mstate_global->__pyx_n_u_EV_REL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 992, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_11, __pyx_v_caps, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 992, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (!__pyx_t_12) {
        } else {
          __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 992, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_1 = __pyx_t_11;
          __pyx_t_11 = 0;
          goto __pyx_L20_bool_binop_done;
        }

        /* "ws_package/utils/hardware_event_validator.py":993
 *                 is_keyboard = ecodes.EV_KEY in caps and ecodes.KEY_A in key_codes
 *                 is_mouse = ecodes.EV_REL in caps or (
 *                     ecodes.EV_ABS in caps and ecodes.ABS_X in caps.get(ecodes.EV_ABS, [])             # <<<<<<<<<<<<<<
 *                 )
 *                 if not (is_keyboard or is_mouse):
*/
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_ecodes, __pyx_mstate_global->__pyx_n_u_EV_ABS); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 993, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_11, __pyx_v_caps, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 993, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (__pyx_t_12) {
        } else {
          __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 993, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_1 = __pyx_t_11;
          __pyx_t_11 = 0;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_ecodes, __pyx_mstate_global->__pyx_n_u_ABS_X); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 993, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_9 = __pyx_v_caps;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_ecodes, __pyx_mstate_global->__pyx_n_u_EV_ABS); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 993, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = PyList_New(0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 993, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_14, __pyx_t_15};
          __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 993, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_10);
        }
        __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_t_11, __pyx_t_10, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 993, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 993, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_1 = __pyx_t_10;
        __pyx_t_10 = 0;
        __pyx_L20_bool_binop_done:;
        __Pyx_XDECREF_SET(__pyx_v_is_mouse, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":995
 *                     ecodes.EV_ABS in caps and ecodes.ABS_X in caps.get(ecodes.EV_ABS, [])
 *                 )
 *                 if not (is_keyboard or is_mouse):             # <<<<<<<<<<<<<<
 *                     continue
 * 
*/
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_is_keyboard); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 995, __pyx_L5_error)
        if (!__pyx_t_13) {
        } else {
          __pyx_t_12 = __pyx_t_13;
          goto __pyx_L24_bool_binop_done;
        }
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_is_mouse); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 995, __pyx_L5_error)
        __pyx_t_12 = __pyx_t_13;
        __pyx_L24_bool_binop_done:;
        __pyx_t_13 = (!__pyx_t_12);
        if (__pyx_t_13) {

          /* "ws_package/utils/hardware_event_validator.py":996
 *                 )
 *                 if not (is_keyboard or is_mouse):
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *                 os.set_blocking(device.fd, False)
*/
          goto __pyx_L11_try_continue;

          /* "ws_package/utils/hardware_event_validator.py":995
 *                     ecodes.EV_ABS in caps and ecodes.ABS_X in caps.get(ecodes.EV_ABS, [])
 *                 )
 *                 if not (is_keyboard or is_mouse):             # <<<<<<<<<<<<<<
 *                     continue
 * 
*/
        }

        /* "ws_package/utils/hardware_event_validator.py":998
 *                     continue
 * 
 *                 os.set_blocking(device.fd, False)             # <<<<<<<<<<<<<<
 *                 self._linux_open_devices.append(device)
 *                 opened += 1
*/
        __pyx_t_10 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 998, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_set_blocking); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 998, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_device, __pyx_mstate_global->__pyx_n_u_fd); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 998, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_3 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_15);
          assert(__pyx_t_10);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_15, __pyx__function);
          __pyx_t_3 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_11, Py_False};
          __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":999
 * 
 *                 os.set_blocking(device.fd, False)
 *                 self._linux_open_devices.append(device)             # <<<<<<<<<<<<<<
 *                 opened += 1
 *                 logger.debug("Linux evdev opened: %s (%s)", path, device.name)
*/
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_open_devices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_device); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 999, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":1000
 *                 os.set_blocking(device.fd, False)
 *                 self._linux_open_devices.append(device)
 *                 opened += 1             # <<<<<<<<<<<<<<
 *                 logger.debug("Linux evdev opened: %s (%s)", path, device.name)
 *             except (OSError, PermissionError) as e:
*/
        __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_v_opened, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_opened, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":1001
 *                 self._linux_open_devices.append(device)
 *                 opened += 1
 *                 logger.debug("Linux evdev opened: %s (%s)", path, device.name)             # <<<<<<<<<<<<<<
 *             except (OSError, PermissionError) as e:
 *                 logger.debug("Cannot open Linux input device %s: %s", path, e)
*/
        __pyx_t_15 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1001, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1001, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_device, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1001, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_3 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_10);
          assert(__pyx_t_15);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_15);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
          __pyx_t_3 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_15, __pyx_mstate_global->__pyx_kp_u_Linux_evdev_opened_s_s, __pyx_v_path, __pyx_t_11};
          __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":983
 * 
 *         for path in evdev.list_devices():
 *             try:             # <<<<<<<<<<<<<<
 *                 device = evdev.InputDevice(path)
 *                 name_lower = (device.name or '').lower()
*/
      }
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "ws_package/utils/hardware_event_validator.py":1002
 *                 opened += 1
 *                 logger.debug("Linux evdev opened: %s (%s)", path, device.name)
 *             except (OSError, PermissionError) as e:             # <<<<<<<<<<<<<<
 *                 logger.debug("Cannot open Linux input device %s: %s", path, e)
 *             except Exception as e:
*/
      __pyx_t_17 = __Pyx_PyErr_ExceptionMatches2(((PyObject *)(((PyTypeObject*)PyExc_OSError))), ((PyObject *)(((PyTypeObject*)PyExc_PermissionError))));
      if (__pyx_t_17) {
        __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_open_evdev_devices", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_10, &__pyx_t_11) < 0) __PYX_ERR(0, 1002, __pyx_L7_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_10);
        __pyx_v_e = __pyx_t_10;
        /*try:*/ {

          /* "ws_package/utils/hardware_event_validator.py":1003
 *                 logger.debug("Linux evdev opened: %s (%s)", path, device.name)
 *             except (OSError, PermissionError) as e:
 *                 logger.debug("Cannot open Linux input device %s: %s", path, e)             # <<<<<<<<<<<<<<
 *             except Exception as e:
 *                 logger.debug("Error opening Linux input device %s: %s", path, e)
*/
          __pyx_t_14 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1003, __pyx_L31_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1003, __pyx_L31_error)
          __Pyx_GOTREF(__pyx_t_18);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_3 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_18))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_18);
            assert(__pyx_t_14);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_18, __pyx__function);
            __pyx_t_3 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[4] = {__pyx_t_14, __pyx_mstate_global->__pyx_kp_u_Cannot_open_Linux_input_device_s, __pyx_v_path, __pyx_v_e};
            __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_18, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
            if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1003, __pyx_L31_error)
            __Pyx_GOTREF(__pyx_t_15);
          }
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        }

        /* "ws_package/utils/hardware_event_validator.py":1002
 *                 opened += 1
 *                 logger.debug("Linux evdev opened: %s (%s)", path, device.name)
 *             except (OSError, PermissionError) as e:             # <<<<<<<<<<<<<<
 *                 logger.debug("Cannot open Linux input device %s: %s", path, e)
 *             except Exception as e:
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            goto __pyx_L32;
          }
          __pyx_L31_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26);
            if ( unlikely(__Pyx_GetException(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23) < 0)) __Pyx_ErrFetch(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_23);
            __Pyx_XGOTREF(__pyx_t_24);
            __Pyx_XGOTREF(__pyx_t_25);
            __Pyx_XGOTREF(__pyx_t_26);
            __pyx_t_17 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_24);
            __Pyx_XGIVEREF(__pyx_t_25);
            __Pyx_XGIVEREF(__pyx_t_26);
            __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_23);
            __Pyx_ErrRestore(__pyx_t_21, __pyx_t_22, __pyx_t_23);
            __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0;
            __pyx_lineno = __pyx_t_17; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20;
            goto __pyx_L7_except_error;
          }
          __pyx_L32:;
        }
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L6_exception_handled;
      }

      /* "ws_package/utils/hardware_event_validator.py":1004
 *             except (OSError, PermissionError) as e:
 *                 logger.debug("Cannot open Linux input device %s: %s", path, e)
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 logger.debug("Error opening Linux input device %s: %s", path, e)
 * 
*/
      __pyx_t_19 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_19) {
        __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_open_evdev_devices", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_1) < 0) __PYX_ERR(0, 1004, __pyx_L7_except_error)
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_10);
        __pyx_v_e = __pyx_t_10;
        /*try:*/ {

          /* "ws_package/utils/hardware_event_validator.py":1005
 *                 logger.debug("Cannot open Linux input device %s: %s", path, e)
 *             except Exception as e:
 *                 logger.debug("Error opening Linux input device %s: %s", path, e)             # <<<<<<<<<<<<<<
 * 
 *         return opened
*/
          __pyx_t_18 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1005, __pyx_L42_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1005, __pyx_L42_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_3 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_9);
            assert(__pyx_t_18);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_18);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
            __pyx_t_3 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[4] = {__pyx_t_18, __pyx_mstate_global->__pyx_kp_u_Error_opening_Linux_input_device, __pyx_v_path, __pyx_v_e};
            __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1005, __pyx_L42_error)
            __Pyx_GOTREF(__pyx_t_15);
          }
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        }

        /* "ws_package/utils/hardware_event_validator.py":1004
 *             except (OSError, PermissionError) as e:
 *                 logger.debug("Cannot open Linux input device %s: %s", path, e)
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 logger.debug("Error opening Linux input device %s: %s", path, e)
 * 
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            goto __pyx_L43;
          }
          __pyx_L42_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
            if ( unlikely(__Pyx_GetException(&__pyx_t_26, &__pyx_t_25, &__pyx_t_24) < 0)) __Pyx_ErrFetch(&__pyx_t_26, &__pyx_t_25, &__pyx_t_24);
            __Pyx_XGOTREF(__pyx_t_26);
            __Pyx_XGOTREF(__pyx_t_25);
            __Pyx_XGOTREF(__pyx_t_24);
            __Pyx_XGOTREF(__pyx_t_23);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_21);
            __pyx_t_19 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_27 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_23);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_22, __pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_26);
            __Pyx_XGIVEREF(__pyx_t_25);
            __Pyx_XGIVEREF(__pyx_t_24);
            __Pyx_ErrRestore(__pyx_t_26, __pyx_t_25, __pyx_t_24);
            __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0;
            __pyx_lineno = __pyx_t_19; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_27;
            goto __pyx_L7_except_error;
          }
          __pyx_L43:;
        }
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L6_exception_handled;
      }
      goto __pyx_L7_except_error;

      /* "ws_package/utils/hardware_event_validator.py":983
 * 
 *         for path in evdev.list_devices():
 *             try:             # <<<<<<<<<<<<<<
 *                 device = evdev.InputDevice(path)
 *                 name_lower = (device.name or '').lower()
*/
      __pyx_L7_except_error:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L1_error;
      __pyx_L11_try_continue:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L3_continue;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      __pyx_L12_try_end:;
    }

    /* "ws_package/utils/hardware_event_validator.py":982
 *         opened = 0
 * 
 *         for path in evdev.list_devices():             # <<<<<<<<<<<<<<
 *             try:
 *                 device = evdev.InputDevice(path)
*/
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1007
 *                 logger.debug("Error opening Linux input device %s: %s", path, e)
 * 
 *         return opened             # <<<<<<<<<<<<<<
 * 
 *     def _start_linux_evdev_reader(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_v_opened;
  __Pyx_INCREF(__pyx_t_2);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_2, NULL, 1) < (0)) __PYX_ERR(0, 1007, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":976
 *         return self._automation_process_active()
 * 
 *     def _linux_open_evdev_devices(self) -> int:             # <<<<<<<<<<<<<<
 *         """Open physical keyboard/mouse evdev nodes for synchronous draining."""
 *         evdev = self._evdev_module
*/

  /* 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_11);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_open_evdev_devices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_evdev);
  __Pyx_XDECREF(__pyx_v_ecodes);
  __Pyx_XDECREF(__pyx_v_opened);
  __Pyx_XDECREF(__pyx_v_path);
  __Pyx_XDECREF(__pyx_v_device);
  __Pyx_XDECREF(__pyx_v_name_lower);
  __Pyx_XDECREF(__pyx_v_caps);
  __Pyx_XDECREF(__pyx_v_key_codes);
  __Pyx_XDECREF(__pyx_v_is_keyboard);
  __Pyx_XDECREF(__pyx_v_is_mouse);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1009
 *         return opened
 * 
 *     def _start_linux_evdev_reader(self):             # <<<<<<<<<<<<<<
 *         """Background thread keeps evdev timestamps warm for pynput correlation."""
 *         if not self._linux_open_devices:
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_39_start_linux_evdev_reader(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_38_start_linux_evdev_reader, "Background thread keeps evdev timestamps warm for pynput correlation.");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_39_start_linux_evdev_reader = {"_start_linux_evdev_reader", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_39_start_linux_evdev_reader, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_38_start_linux_evdev_reader};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_39_start_linux_evdev_reader(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_start_linux_evdev_reader (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1009, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1009, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_start_linux_evdev_reader", 0) < (0)) __PYX_ERR(0, 1009, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_start_linux_evdev_reader", 1, 1, 1, i); __PYX_ERR(0, 1009, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1009, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_start_linux_evdev_reader", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1009, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._start_linux_evdev_reader", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_38_start_linux_evdev_reader(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_38_start_linux_evdev_reader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_start_linux_evdev_reader", 0);

  /* "ws_package/utils/hardware_event_validator.py":1011
 *     def _start_linux_evdev_reader(self):
 *         """Background thread keeps evdev timestamps warm for pynput correlation."""
 *         if not self._linux_open_devices:             # <<<<<<<<<<<<<<
 *             return
 *         if self._linux_evdev_thread and self._linux_evdev_thread.is_alive():
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_open_devices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1011, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {

    /* "ws_package/utils/hardware_event_validator.py":1012
 *         """Background thread keeps evdev timestamps warm for pynput correlation."""
 *         if not self._linux_open_devices:
 *             return             # <<<<<<<<<<<<<<
 *         if self._linux_evdev_thread and self._linux_evdev_thread.is_alive():
 *             return
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1011
 *     def _start_linux_evdev_reader(self):
 *         """Background thread keeps evdev timestamps warm for pynput correlation."""
 *         if not self._linux_open_devices:             # <<<<<<<<<<<<<<
 *             return
 *         if self._linux_evdev_thread and self._linux_evdev_thread.is_alive():
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1013
 *         if not self._linux_open_devices:
 *             return
 *         if self._linux_evdev_thread and self._linux_evdev_thread.is_alive():             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_evdev_thread); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_evdev_thread); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_alive, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "ws_package/utils/hardware_event_validator.py":1014
 *             return
 *         if self._linux_evdev_thread and self._linux_evdev_thread.is_alive():
 *             return             # <<<<<<<<<<<<<<
 * 
 *         self._linux_evdev_thread = threading.Thread(
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1013
 *         if not self._linux_open_devices:
 *             return
 *         if self._linux_evdev_thread and self._linux_evdev_thread.is_alive():             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1016
 *             return
 * 
 *         self._linux_evdev_thread = threading.Thread(             # <<<<<<<<<<<<<<
 *             target=self._linux_evdev_reader_thread,
 *             daemon=True,
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_threading); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Thread); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1017
 * 
 *         self._linux_evdev_thread = threading.Thread(
 *             target=self._linux_evdev_reader_thread,             # <<<<<<<<<<<<<<
 *             daemon=True,
 *             name="LinuxEvdevReader",
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_evdev_reader_thread); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "ws_package/utils/hardware_event_validator.py":1018
 *         self._linux_evdev_thread = threading.Thread(
 *             target=self._linux_evdev_reader_thread,
 *             daemon=True,             # <<<<<<<<<<<<<<
 *             name="LinuxEvdevReader",
 *         )
*/
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_5, NULL};
    __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_target, __pyx_t_4, __pyx_t_8, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 1016, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_daemon, Py_True, __pyx_t_8, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 1016, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_LinuxEvdevReader, __pyx_t_8, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 1016, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }

  /* "ws_package/utils/hardware_event_validator.py":1016
 *             return
 * 
 *         self._linux_evdev_thread = threading.Thread(             # <<<<<<<<<<<<<<
 *             target=self._linux_evdev_reader_thread,
 *             daemon=True,
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_evdev_thread, __pyx_t_1) < (0)) __PYX_ERR(0, 1016, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1021
 *             name="LinuxEvdevReader",
 *         )
 *         self._linux_evdev_thread.start()             # <<<<<<<<<<<<<<
 * 
 *     def _linux_evdev_reader_thread(self):
*/
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_evdev_thread); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __pyx_t_8;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_start, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1009
 *         return opened
 * 
 *     def _start_linux_evdev_reader(self):             # <<<<<<<<<<<<<<
 *         """Background thread keeps evdev timestamps warm for pynput correlation."""
 *         if not self._linux_open_devices:
*/

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._start_linux_evdev_reader", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1023
 *         self._linux_evdev_thread.start()
 * 
 *     def _linux_evdev_reader_thread(self):             # <<<<<<<<<<<<<<
 *         """Continuously timestamp physical keyboard/mouse evdev events."""
 *         import select
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_41_linux_evdev_reader_thread(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_40_linux_evdev_reader_thread, "Continuously timestamp physical keyboard/mouse evdev events.");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_41_linux_evdev_reader_thread = {"_linux_evdev_reader_thread", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_41_linux_evdev_reader_thread, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_40_linux_evdev_reader_thread};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_41_linux_evdev_reader_thread(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_linux_evdev_reader_thread (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1023, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1023, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_linux_evdev_reader_thread", 0) < (0)) __PYX_ERR(0, 1023, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_linux_evdev_reader_thread", 1, 1, 1, i); __PYX_ERR(0, 1023, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1023, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_linux_evdev_reader_thread", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1023, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_evdev_reader_thread", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_40_linux_evdev_reader_thread(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_40_linux_evdev_reader_thread(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_select = NULL;
  PyObject *__pyx_v_evdev = NULL;
  PyObject *__pyx_v_ecodes = NULL;
  PyObject *__pyx_v_fd_map = NULL;
  PyObject *__pyx_v_readable = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_v_now = NULL;
  PyObject *__pyx_v_fd = NULL;
  PyObject *__pyx_v_event = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_8genexpr2__pyx_v_device = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  Py_ssize_t __pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  int __pyx_t_23;
  PyObject *__pyx_t_24 = NULL;
  int __pyx_t_25;
  char const *__pyx_t_26;
  PyObject *__pyx_t_27 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_linux_evdev_reader_thread", 0);

  /* "ws_package/utils/hardware_event_validator.py":1025
 *     def _linux_evdev_reader_thread(self):
 *         """Continuously timestamp physical keyboard/mouse evdev events."""
 *         import select             # <<<<<<<<<<<<<<
 * 
 *         evdev = self._evdev_module
*/
  __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_select, 0, 0, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_select = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1027
 *         import select
 * 
 *         evdev = self._evdev_module             # <<<<<<<<<<<<<<
 *         ecodes = evdev.ecodes
 *         fd_map = {device.fileno(): device for device in self._linux_open_devices}
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_evdev_module); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_evdev = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1028
 * 
 *         evdev = self._evdev_module
 *         ecodes = evdev.ecodes             # <<<<<<<<<<<<<<
 *         fd_map = {device.fileno(): device for device in self._linux_open_devices}
 *         if not fd_map:
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_evdev, __pyx_mstate_global->__pyx_n_u_ecodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ecodes = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1029
 *         evdev = self._evdev_module
 *         ecodes = evdev.ecodes
 *         fd_map = {device.fileno(): device for device in self._linux_open_devices}             # <<<<<<<<<<<<<<
 *         if not fd_map:
 *             return
*/
  { /* enter inner scope */
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_open_devices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1029, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1029, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1029, __pyx_L5_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_5;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1029, __pyx_L5_error)
            #endif
            if (__pyx_t_5 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5));
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5);
          #endif
          ++__pyx_t_5;
        }
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L5_error)
      } else {
        __pyx_t_3 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1029, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_device, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_7 = __pyx_8genexpr2__pyx_v_device;
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fileno, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_t_3, (PyObject*)__pyx_8genexpr2__pyx_v_device))) __PYX_ERR(0, 1029, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_device); __pyx_8genexpr2__pyx_v_device = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_device); __pyx_8genexpr2__pyx_v_device = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_v_fd_map = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1030
 *         ecodes = evdev.ecodes
 *         fd_map = {device.fileno(): device for device in self._linux_open_devices}
 *         if not fd_map:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_fd_map); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1030, __pyx_L1_error)
  __pyx_t_10 = (!__pyx_t_9);
  if (__pyx_t_10) {

    /* "ws_package/utils/hardware_event_validator.py":1031
 *         fd_map = {device.fileno(): device for device in self._linux_open_devices}
 *         if not fd_map:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         logger.info("Linux evdev background reader started (%s devices)", len(fd_map))
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1030
 *         ecodes = evdev.ecodes
 *         fd_map = {device.fileno(): device for device in self._linux_open_devices}
 *         if not fd_map:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1033
 *             return
 * 
 *         logger.info("Linux evdev background reader started (%s devices)", len(fd_map))             # <<<<<<<<<<<<<<
 * 
 *         while not self._stop_hooks:
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_info); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = PyDict_Size(__pyx_v_fd_map); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1033, __pyx_L1_error)
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Linux_evdev_background_reader_st, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1035
 *         logger.info("Linux evdev background reader started (%s devices)", len(fd_map))
 * 
 *         while not self._stop_hooks:             # <<<<<<<<<<<<<<
 *             try:
 *                 readable, _, _ = select.select(list(fd_map.keys()), [], [], 0.5)
*/
  while (1) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_stop_hooks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1035, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = (!__pyx_t_10);
    if (!__pyx_t_9) break;

    /* "ws_package/utils/hardware_event_validator.py":1036
 * 
 *         while not self._stop_hooks:
 *             try:             # <<<<<<<<<<<<<<
 *                 readable, _, _ = select.select(list(fd_map.keys()), [], [], 0.5)
 *                 now = time.time()
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_11, &__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":1037
 *         while not self._stop_hooks:
 *             try:
 *                 readable, _, _ = select.select(list(fd_map.keys()), [], [], 0.5)             # <<<<<<<<<<<<<<
 *                 now = time.time()
 *                 for fd in readable:
*/
        __pyx_t_7 = __pyx_v_select;
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_3 = __Pyx_PyDict_Keys(__pyx_v_fd_map); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1037, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1037, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1037, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_8 = 0;
        {
          PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_t_4, __pyx_t_3, __pyx_t_13, __pyx_mstate_global->__pyx_float_0_5};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_select, __pyx_callargs+__pyx_t_8, (5-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1037, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
          PyObject* sequence = __pyx_t_1;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 3)) {
            if (size > 3) __Pyx_RaiseTooManyValuesError(3);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 1037, __pyx_L13_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0);
            __Pyx_INCREF(__pyx_t_13);
            __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_3);
            __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
            __Pyx_INCREF(__pyx_t_4);
          } else {
            __pyx_t_13 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
            if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1037, __pyx_L13_error)
            __Pyx_XGOTREF(__pyx_t_13);
            __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1037, __pyx_L13_error)
            __Pyx_XGOTREF(__pyx_t_3);
            __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L13_error)
            __Pyx_XGOTREF(__pyx_t_4);
          }
          #else
          __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1037, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1037, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1037, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
          index = 0; __pyx_t_13 = __pyx_t_14(__pyx_t_7); if (unlikely(!__pyx_t_13)) goto __pyx_L21_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_13);
          index = 1; __pyx_t_3 = __pyx_t_14(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L21_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_3);
          index = 2; __pyx_t_4 = __pyx_t_14(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L21_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_4);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_7), 3) < (0)) __PYX_ERR(0, 1037, __pyx_L13_error)
          __pyx_t_14 = NULL;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L22_unpacking_done;
          __pyx_L21_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_14 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 1037, __pyx_L13_error)
          __pyx_L22_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_readable, __pyx_t_13);
        __pyx_t_13 = 0;
        __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_3);
        __pyx_t_3 = 0;
        __Pyx_DECREF_SET(__pyx_v__, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "ws_package/utils/hardware_event_validator.py":1038
 *             try:
 *                 readable, _, _ = select.select(list(fd_map.keys()), [], [], 0.5)
 *                 now = time.time()             # <<<<<<<<<<<<<<
 *                 for fd in readable:
 *                     for event in fd_map[fd].read():
*/
        __pyx_t_4 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1038, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1038, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_8 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
          assert(__pyx_t_4);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
          __pyx_t_8 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_XDECREF_SET(__pyx_v_now, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":1039
 *                 readable, _, _ = select.select(list(fd_map.keys()), [], [], 0.5)
 *                 now = time.time()
 *                 for fd in readable:             # <<<<<<<<<<<<<<
 *                     for event in fd_map[fd].read():
 *                         with self._linux_lock:
*/
        if (likely(PyList_CheckExact(__pyx_v_readable)) || PyTuple_CheckExact(__pyx_v_readable)) {
          __pyx_t_1 = __pyx_v_readable; __Pyx_INCREF(__pyx_t_1);
          __pyx_t_5 = 0;
          __pyx_t_6 = NULL;
        } else {
          __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_readable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L13_error)
        }
        for (;;) {
          if (likely(!__pyx_t_6)) {
            if (likely(PyList_CheckExact(__pyx_t_1))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1039, __pyx_L13_error)
                #endif
                if (__pyx_t_5 >= __pyx_temp) break;
              }
              __pyx_t_13 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference);
              ++__pyx_t_5;
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1039, __pyx_L13_error)
                #endif
                if (__pyx_t_5 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_13 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5));
              #else
              __pyx_t_13 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5);
              #endif
              ++__pyx_t_5;
            }
            if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1039, __pyx_L13_error)
          } else {
            __pyx_t_13 = __pyx_t_6(__pyx_t_1);
            if (unlikely(!__pyx_t_13)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1039, __pyx_L13_error)
                PyErr_Clear();
              }
              break;
            }
          }
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_XDECREF_SET(__pyx_v_fd, __pyx_t_13);
          __pyx_t_13 = 0;

          /* "ws_package/utils/hardware_event_validator.py":1040
 *                 now = time.time()
 *                 for fd in readable:
 *                     for event in fd_map[fd].read():             # <<<<<<<<<<<<<<
 *                         with self._linux_lock:
 *                             if event.type == ecodes.EV_KEY:
*/
          __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_fd_map, __pyx_v_fd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1040, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = __pyx_t_3;
          __Pyx_INCREF(__pyx_t_4);
          __pyx_t_8 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
            __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_read, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1040, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_13);
          }
          if (likely(PyList_CheckExact(__pyx_t_13)) || PyTuple_CheckExact(__pyx_t_13)) {
            __pyx_t_3 = __pyx_t_13; __Pyx_INCREF(__pyx_t_3);
            __pyx_t_15 = 0;
            __pyx_t_16 = NULL;
          } else {
            __pyx_t_15 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1040, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1040, __pyx_L13_error)
          }
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          for (;;) {
            if (likely(!__pyx_t_16)) {
              if (likely(PyList_CheckExact(__pyx_t_3))) {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1040, __pyx_L13_error)
                  #endif
                  if (__pyx_t_15 >= __pyx_temp) break;
                }
                __pyx_t_13 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_15, __Pyx_ReferenceSharing_OwnStrongReference);
                ++__pyx_t_15;
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1040, __pyx_L13_error)
                  #endif
                  if (__pyx_t_15 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_13 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_15));
                #else
                __pyx_t_13 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_15);
                #endif
                ++__pyx_t_15;
              }
              if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1040, __pyx_L13_error)
            } else {
              __pyx_t_13 = __pyx_t_16(__pyx_t_3);
              if (unlikely(!__pyx_t_13)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1040, __pyx_L13_error)
                  PyErr_Clear();
                }
                break;
              }
            }
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_XDECREF_SET(__pyx_v_event, __pyx_t_13);
            __pyx_t_13 = 0;

            /* "ws_package/utils/hardware_event_validator.py":1041
 *                 for fd in readable:
 *                     for event in fd_map[fd].read():
 *                         with self._linux_lock:             # <<<<<<<<<<<<<<
 *                             if event.type == ecodes.EV_KEY:
 *                                 self._linux_last_evdev_keyboard_ts = now
*/
            /*with:*/ {
              __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_lock); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1041, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_13);
              __pyx_t_17 = __Pyx_PyObject_LookupSpecial(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1041, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_17);
              __pyx_t_7 = NULL;
              __pyx_t_18 = __Pyx_PyObject_LookupSpecial(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1041, __pyx_L27_error)
              __Pyx_GOTREF(__pyx_t_18);
              __pyx_t_8 = 1;
              #if CYTHON_UNPACK_METHODS
              if (likely(PyMethod_Check(__pyx_t_18))) {
                __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_18);
                assert(__pyx_t_7);
                PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18);
                __Pyx_INCREF(__pyx_t_7);
                __Pyx_INCREF(__pyx__function);
                __Pyx_DECREF_SET(__pyx_t_18, __pyx__function);
                __pyx_t_8 = 0;
              }
              #endif
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
                __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_18, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1041, __pyx_L27_error)
                __Pyx_GOTREF(__pyx_t_4);
              }
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              /*try:*/ {
                {
                  __Pyx_PyThreadState_declare
                  __Pyx_PyThreadState_assign
                  __Pyx_ExceptionSave(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
                  __Pyx_XGOTREF(__pyx_t_19);
                  __Pyx_XGOTREF(__pyx_t_20);
                  __Pyx_XGOTREF(__pyx_t_21);
                  /*try:*/ {

                    /* "ws_package/utils/hardware_event_validator.py":1042
 *                     for event in fd_map[fd].read():
 *                         with self._linux_lock:
 *                             if event.type == ecodes.EV_KEY:             # <<<<<<<<<<<<<<
 *                                 self._linux_last_evdev_keyboard_ts = now
 *                             elif event.type in (ecodes.EV_REL, ecodes.EV_ABS):
*/
                    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_mstate_global->__pyx_n_u_type); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1042, __pyx_L33_error)
                    __Pyx_GOTREF(__pyx_t_13);
                    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ecodes, __pyx_mstate_global->__pyx_n_u_EV_KEY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1042, __pyx_L33_error)
                    __Pyx_GOTREF(__pyx_t_4);
                    __pyx_t_18 = PyObject_RichCompare(__pyx_t_13, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1042, __pyx_L33_error)
                    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1042, __pyx_L33_error)
                    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                    if (__pyx_t_9) {

                      /* "ws_package/utils/hardware_event_validator.py":1043
 *                         with self._linux_lock:
 *                             if event.type == ecodes.EV_KEY:
 *                                 self._linux_last_evdev_keyboard_ts = now             # <<<<<<<<<<<<<<
 *                             elif event.type in (ecodes.EV_REL, ecodes.EV_ABS):
 *                                 self._linux_last_evdev_mouse_ts = now
*/
                      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_evdev_keyboard_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 1043, __pyx_L33_error)

                      /* "ws_package/utils/hardware_event_validator.py":1042
 *                     for event in fd_map[fd].read():
 *                         with self._linux_lock:
 *                             if event.type == ecodes.EV_KEY:             # <<<<<<<<<<<<<<
 *                                 self._linux_last_evdev_keyboard_ts = now
 *                             elif event.type in (ecodes.EV_REL, ecodes.EV_ABS):
*/
                      goto __pyx_L41;
                    }

                    /* "ws_package/utils/hardware_event_validator.py":1044
 *                             if event.type == ecodes.EV_KEY:
 *                                 self._linux_last_evdev_keyboard_ts = now
 *                             elif event.type in (ecodes.EV_REL, ecodes.EV_ABS):             # <<<<<<<<<<<<<<
 *                                 self._linux_last_evdev_mouse_ts = now
 *             except Exception as e:
*/
                    __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_mstate_global->__pyx_n_u_type); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1044, __pyx_L33_error)
                    __Pyx_GOTREF(__pyx_t_18);
                    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ecodes, __pyx_mstate_global->__pyx_n_u_EV_REL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1044, __pyx_L33_error)
                    __Pyx_GOTREF(__pyx_t_4);
                    __pyx_t_13 = PyObject_RichCompare(__pyx_t_18, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1044, __pyx_L33_error)
                    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1044, __pyx_L33_error)
                    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                    if (!__pyx_t_10) {
                    } else {
                      __pyx_t_9 = __pyx_t_10;
                      goto __pyx_L42_bool_binop_done;
                    }
                    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_ecodes, __pyx_mstate_global->__pyx_n_u_EV_ABS); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1044, __pyx_L33_error)
                    __Pyx_GOTREF(__pyx_t_13);
                    __pyx_t_4 = PyObject_RichCompare(__pyx_t_18, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1044, __pyx_L33_error)
                    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1044, __pyx_L33_error)
                    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                    __pyx_t_9 = __pyx_t_10;
                    __pyx_L42_bool_binop_done:;
                    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                    __pyx_t_10 = __pyx_t_9;
                    if (__pyx_t_10) {

                      /* "ws_package/utils/hardware_event_validator.py":1045
 *                                 self._linux_last_evdev_keyboard_ts = now
 *                             elif event.type in (ecodes.EV_REL, ecodes.EV_ABS):
 *                                 self._linux_last_evdev_mouse_ts = now             # <<<<<<<<<<<<<<
 *             except Exception as e:
 *                 logger.debug("Linux evdev reader error: %s", e)
*/
                      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_evdev_mouse_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 1045, __pyx_L33_error)

                      /* "ws_package/utils/hardware_event_validator.py":1044
 *                             if event.type == ecodes.EV_KEY:
 *                                 self._linux_last_evdev_keyboard_ts = now
 *                             elif event.type in (ecodes.EV_REL, ecodes.EV_ABS):             # <<<<<<<<<<<<<<
 *                                 self._linux_last_evdev_mouse_ts = now
 *             except Exception as e:
*/
                    }
                    __pyx_L41:;

                    /* "ws_package/utils/hardware_event_validator.py":1041
 *                 for fd in readable:
 *                     for event in fd_map[fd].read():
 *                         with self._linux_lock:             # <<<<<<<<<<<<<<
 *                             if event.type == ecodes.EV_KEY:
 *                                 self._linux_last_evdev_keyboard_ts = now
*/
                  }
                  __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
                  __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
                  __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
                  goto __pyx_L40_try_end;
                  __pyx_L33_error:;
                  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                  __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
                  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                  /*except:*/ {
                    __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_evdev_reader_thread", __pyx_clineno, __pyx_lineno, __pyx_filename);
                    if (__Pyx_GetException(&__pyx_t_18, &__pyx_t_4, &__pyx_t_13) < 0) __PYX_ERR(0, 1041, __pyx_L35_except_error)
                    __Pyx_XGOTREF(__pyx_t_18);
                    __Pyx_XGOTREF(__pyx_t_4);
                    __Pyx_XGOTREF(__pyx_t_13);
                    __pyx_t_7 = PyTuple_Pack(3, __pyx_t_18, __pyx_t_4, __pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1041, __pyx_L35_except_error)
                    __Pyx_GOTREF(__pyx_t_7);
                    __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_7, NULL);
                    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                    if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1041, __pyx_L35_except_error)
                    __Pyx_GOTREF(__pyx_t_22);
                    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_22);
                    __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
                    if (__pyx_t_10 < (0)) __PYX_ERR(0, 1041, __pyx_L35_except_error)
                    __pyx_t_9 = (!__pyx_t_10);
                    if (unlikely(__pyx_t_9)) {
                      __Pyx_GIVEREF(__pyx_t_18);
                      __Pyx_GIVEREF(__pyx_t_4);
                      __Pyx_XGIVEREF(__pyx_t_13);
                      __Pyx_ErrRestoreWithState(__pyx_t_18, __pyx_t_4, __pyx_t_13);
                      __pyx_t_18 = 0;  __pyx_t_4 = 0;  __pyx_t_13 = 0; 
                      __PYX_ERR(0, 1041, __pyx_L35_except_error)
                    }
                    __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
                    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                    goto __pyx_L34_exception_handled;
                  }
                  __pyx_L35_except_error:;
                  __Pyx_XGIVEREF(__pyx_t_19);
                  __Pyx_XGIVEREF(__pyx_t_20);
                  __Pyx_XGIVEREF(__pyx_t_21);
                  __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
                  goto __pyx_L13_error;
                  __pyx_L34_exception_handled:;
                  __Pyx_XGIVEREF(__pyx_t_19);
                  __Pyx_XGIVEREF(__pyx_t_20);
                  __Pyx_XGIVEREF(__pyx_t_21);
                  __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
                  __pyx_L40_try_end:;
                }
              }
              /*finally:*/ {
                /*normal exit:*/{
                  if (__pyx_t_17) {
                    __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_mstate_global->__pyx_tuple[2], NULL);
                    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                    if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1041, __pyx_L13_error)
                    __Pyx_GOTREF(__pyx_t_21);
                    __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                  }
                  goto __pyx_L32;
                }
                __pyx_L32:;
              }
              goto __pyx_L47;
              __pyx_L27_error:;
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
              goto __pyx_L13_error;
              __pyx_L47:;
            }

            /* "ws_package/utils/hardware_event_validator.py":1040
 *                 now = time.time()
 *                 for fd in readable:
 *                     for event in fd_map[fd].read():             # <<<<<<<<<<<<<<
 *                         with self._linux_lock:
 *                             if event.type == ecodes.EV_KEY:
*/
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "ws_package/utils/hardware_event_validator.py":1039
 *                 readable, _, _ = select.select(list(fd_map.keys()), [], [], 0.5)
 *                 now = time.time()
 *                 for fd in readable:             # <<<<<<<<<<<<<<
 *                     for event in fd_map[fd].read():
 *                         with self._linux_lock:
*/
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":1036
 * 
 *         while not self._stop_hooks:
 *             try:             # <<<<<<<<<<<<<<
 *                 readable, _, _ = select.select(list(fd_map.keys()), [], [], 0.5)
 *                 now = time.time()
*/
      }
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L20_try_end;
      __pyx_L13_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "ws_package/utils/hardware_event_validator.py":1046
 *                             elif event.type in (ecodes.EV_REL, ecodes.EV_ABS):
 *                                 self._linux_last_evdev_mouse_ts = now
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 logger.debug("Linux evdev reader error: %s", e)
 *                 time.sleep(0.5)
*/
      __pyx_t_23 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_23) {
        __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_evdev_reader_thread", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_13) < 0) __PYX_ERR(0, 1046, __pyx_L15_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_v_e = __pyx_t_3;
        /*try:*/ {

          /* "ws_package/utils/hardware_event_validator.py":1047
 *                                 self._linux_last_evdev_mouse_ts = now
 *             except Exception as e:
 *                 logger.debug("Linux evdev reader error: %s", e)             # <<<<<<<<<<<<<<
 *                 time.sleep(0.5)
 * 
*/
          __pyx_t_18 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1047, __pyx_L55_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 1047, __pyx_L55_error)
          __Pyx_GOTREF(__pyx_t_24);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_8 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_24))) {
            __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_24);
            assert(__pyx_t_18);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_24);
            __Pyx_INCREF(__pyx_t_18);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_24, __pyx__function);
            __pyx_t_8 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_18, __pyx_mstate_global->__pyx_kp_u_Linux_evdev_reader_error_s, __pyx_v_e};
            __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_24, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
            __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1047, __pyx_L55_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "ws_package/utils/hardware_event_validator.py":1048
 *             except Exception as e:
 *                 logger.debug("Linux evdev reader error: %s", e)
 *                 time.sleep(0.5)             # <<<<<<<<<<<<<<
 * 
 *     def _start_linux_xinput_monitor(self):
*/
          __pyx_t_24 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1048, __pyx_L55_error)
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_sleep); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1048, __pyx_L55_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          __pyx_t_8 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_7);
            assert(__pyx_t_24);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_24);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
            __pyx_t_8 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_24, __pyx_mstate_global->__pyx_float_0_5};
            __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1048, __pyx_L55_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }

        /* "ws_package/utils/hardware_event_validator.py":1046
 *                             elif event.type in (ecodes.EV_REL, ecodes.EV_ABS):
 *                                 self._linux_last_evdev_mouse_ts = now
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 logger.debug("Linux evdev reader error: %s", e)
 *                 time.sleep(0.5)
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            goto __pyx_L56;
          }
          __pyx_L55_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_17 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_22 = 0; __pyx_t_27 = 0;
            __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
            __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_22, &__pyx_t_27);
            if ( unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_21, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_21, &__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_27);
            __pyx_t_23 = __pyx_lineno; __pyx_t_25 = __pyx_clineno; __pyx_t_26 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_27);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_22, __pyx_t_27);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ErrRestore(__pyx_t_17, __pyx_t_21, __pyx_t_20);
            __pyx_t_17 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_22 = 0; __pyx_t_27 = 0;
            __pyx_lineno = __pyx_t_23; __pyx_clineno = __pyx_t_25; __pyx_filename = __pyx_t_26;
            goto __pyx_L15_except_error;
          }
          __pyx_L56:;
        }
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L14_exception_handled;
      }
      goto __pyx_L15_except_error;

      /* "ws_package/utils/hardware_event_validator.py":1036
 * 
 *         while not self._stop_hooks:
 *             try:             # <<<<<<<<<<<<<<
 *                 readable, _, _ = select.select(list(fd_map.keys()), [], [], 0.5)
 *                 now = time.time()
*/
      __pyx_L15_except_error:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_11, __pyx_t_12);
      goto __pyx_L1_error;
      __pyx_L14_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_11, __pyx_t_12);
      __pyx_L20_try_end:;
    }
  }

  /* "ws_package/utils/hardware_event_validator.py":1023
 *         self._linux_evdev_thread.start()
 * 
 *     def _linux_evdev_reader_thread(self):             # <<<<<<<<<<<<<<
 *         """Continuously timestamp physical keyboard/mouse evdev events."""
 *         import select
*/

  /* 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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_24);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_evdev_reader_thread", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_select);
  __Pyx_XDECREF(__pyx_v_evdev);
  __Pyx_XDECREF(__pyx_v_ecodes);
  __Pyx_XDECREF(__pyx_v_fd_map);
  __Pyx_XDECREF(__pyx_v_readable);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_now);
  __Pyx_XDECREF(__pyx_v_fd);
  __Pyx_XDECREF(__pyx_v_event);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_device);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1050
 *                 time.sleep(0.5)
 * 
 *     def _start_linux_xinput_monitor(self):             # <<<<<<<<<<<<<<
 *         """Monitor XI2 events on the X11 root window for XTEST slave devices."""
 *         if self._linux_xinput_thread and self._linux_xinput_thread.is_alive():
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_43_start_linux_xinput_monitor(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_42_start_linux_xinput_monitor, "Monitor XI2 events on the X11 root window for XTEST slave devices.");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_43_start_linux_xinput_monitor = {"_start_linux_xinput_monitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_43_start_linux_xinput_monitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_42_start_linux_xinput_monitor};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_43_start_linux_xinput_monitor(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_start_linux_xinput_monitor (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1050, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1050, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_start_linux_xinput_monitor", 0) < (0)) __PYX_ERR(0, 1050, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_start_linux_xinput_monitor", 1, 1, 1, i); __PYX_ERR(0, 1050, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1050, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_start_linux_xinput_monitor", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1050, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._start_linux_xinput_monitor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_42_start_linux_xinput_monitor(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_42_start_linux_xinput_monitor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_start_linux_xinput_monitor", 0);

  /* "ws_package/utils/hardware_event_validator.py":1052
 *     def _start_linux_xinput_monitor(self):
 *         """Monitor XI2 events on the X11 root window for XTEST slave devices."""
 *         if self._linux_xinput_thread and self._linux_xinput_thread.is_alive():             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_thread); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1052, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_thread); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_alive, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1052, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "ws_package/utils/hardware_event_validator.py":1053
 *         """Monitor XI2 events on the X11 root window for XTEST slave devices."""
 *         if self._linux_xinput_thread and self._linux_xinput_thread.is_alive():
 *             return             # <<<<<<<<<<<<<<
 * 
 *         self._linux_xinput_thread = threading.Thread(
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1052
 *     def _start_linux_xinput_monitor(self):
 *         """Monitor XI2 events on the X11 root window for XTEST slave devices."""
 *         if self._linux_xinput_thread and self._linux_xinput_thread.is_alive():             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1055
 *             return
 * 
 *         self._linux_xinput_thread = threading.Thread(             # <<<<<<<<<<<<<<
 *             target=self._linux_xinput_monitor_thread,
 *             daemon=True,
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_threading); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Thread); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1056
 * 
 *         self._linux_xinput_thread = threading.Thread(
 *             target=self._linux_xinput_monitor_thread,             # <<<<<<<<<<<<<<
 *             daemon=True,
 *             name="LinuxX11XTESTMonitor",
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_monitor_thread); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "ws_package/utils/hardware_event_validator.py":1057
 *         self._linux_xinput_thread = threading.Thread(
 *             target=self._linux_xinput_monitor_thread,
 *             daemon=True,             # <<<<<<<<<<<<<<
 *             name="LinuxX11XTESTMonitor",
 *         )
*/
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_5, NULL};
    __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_target, __pyx_t_4, __pyx_t_8, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 1055, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_daemon, Py_True, __pyx_t_8, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 1055, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_LinuxX11XTESTMonitor, __pyx_t_8, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 1055, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }

  /* "ws_package/utils/hardware_event_validator.py":1055
 *             return
 * 
 *         self._linux_xinput_thread = threading.Thread(             # <<<<<<<<<<<<<<
 *             target=self._linux_xinput_monitor_thread,
 *             daemon=True,
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_thread, __pyx_t_2) < (0)) __PYX_ERR(0, 1055, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1060
 *             name="LinuxX11XTESTMonitor",
 *         )
 *         self._linux_xinput_thread.start()             # <<<<<<<<<<<<<<
 *         time.sleep(0.3)
 * 
*/
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_thread); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __pyx_t_8;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_start, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1060, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1061
 *         )
 *         self._linux_xinput_thread.start()
 *         time.sleep(0.3)             # <<<<<<<<<<<<<<
 * 
 *     def _linux_xinput_monitor_thread(self):
*/
  __pyx_t_8 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_sleep); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_8);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_float_0_3};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1050
 *                 time.sleep(0.5)
 * 
 *     def _start_linux_xinput_monitor(self):             # <<<<<<<<<<<<<<
 *         """Monitor XI2 events on the X11 root window for XTEST slave devices."""
 *         if self._linux_xinput_thread and self._linux_xinput_thread.is_alive():
*/

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._start_linux_xinput_monitor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1063
 *         time.sleep(0.3)
 * 
 *     def _linux_xinput_monitor_thread(self):             # <<<<<<<<<<<<<<
 *         """
 *         Parse `xinput test-xi2 --root` to classify XI2 events as hardware vs XTEST.
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_45_linux_xinput_monitor_thread(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_44_linux_xinput_monitor_thread, "\n        Parse `xinput test-xi2 --root` to classify XI2 events as hardware vs XTEST.\n\n        pyautogui injects through Virtual core XTEST devices (e.g. ids 4/5).\n        Real keyboards/mice appear as physical slave devices (e.g. ids 8/11).\n        ");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_45_linux_xinput_monitor_thread = {"_linux_xinput_monitor_thread", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_45_linux_xinput_monitor_thread, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_44_linux_xinput_monitor_thread};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_45_linux_xinput_monitor_thread(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_linux_xinput_monitor_thread (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1063, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1063, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_linux_xinput_monitor_thread", 0) < (0)) __PYX_ERR(0, 1063, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_linux_xinput_monitor_thread", 1, 1, 1, i); __PYX_ERR(0, 1063, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1063, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_linux_xinput_monitor_thread", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1063, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_xinput_monitor_thread", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_44_linux_xinput_monitor_thread(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_44_linux_xinput_monitor_thread(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_keyboard_events = NULL;
  PyObject *__pyx_v_mouse_events = NULL;
  PyObject *__pyx_v_xinput_bin = NULL;
  PyObject *__pyx_v_current_event_type = NULL;
  PyObject *__pyx_v_proc = NULL;
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_v_stripped = NULL;
  PyObject *__pyx_v_event_match = NULL;
  PyObject *__pyx_v_device_match = NULL;
  PyObject *__pyx_v_slave_id = NULL;
  PyObject *__pyx_v_now = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  Py_ssize_t __pyx_t_17;
  PyObject *(*__pyx_t_18)(PyObject *);
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  int __pyx_t_24;
  int __pyx_t_25;
  char const *__pyx_t_26;
  PyObject *__pyx_t_27 = NULL;
  char const *__pyx_t_28;
  int __pyx_t_29;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_linux_xinput_monitor_thread", 0);

  /* "ws_package/utils/hardware_event_validator.py":1070
 *         Real keyboards/mice appear as physical slave devices (e.g. ids 8/11).
 *         """
 *         keyboard_events = {2, 3, 13, 14}             # <<<<<<<<<<<<<<
 *         mouse_events = {4, 5, 6, 15, 16, 17}
 *         xinput_bin = self._linux_xinput_binary()
*/
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PySet_Add(__pyx_t_1, __pyx_mstate_global->__pyx_int_2) < (0)) __PYX_ERR(0, 1070, __pyx_L1_error)
  if (PySet_Add(__pyx_t_1, __pyx_mstate_global->__pyx_int_3) < (0)) __PYX_ERR(0, 1070, __pyx_L1_error)
  if (PySet_Add(__pyx_t_1, __pyx_mstate_global->__pyx_int_13) < (0)) __PYX_ERR(0, 1070, __pyx_L1_error)
  if (PySet_Add(__pyx_t_1, __pyx_mstate_global->__pyx_int_14) < (0)) __PYX_ERR(0, 1070, __pyx_L1_error)
  __pyx_v_keyboard_events = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1071
 *         """
 *         keyboard_events = {2, 3, 13, 14}
 *         mouse_events = {4, 5, 6, 15, 16, 17}             # <<<<<<<<<<<<<<
 *         xinput_bin = self._linux_xinput_binary()
 *         if not xinput_bin:
*/
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PySet_Add(__pyx_t_1, __pyx_mstate_global->__pyx_int_4) < (0)) __PYX_ERR(0, 1071, __pyx_L1_error)
  if (PySet_Add(__pyx_t_1, __pyx_mstate_global->__pyx_int_5) < (0)) __PYX_ERR(0, 1071, __pyx_L1_error)
  if (PySet_Add(__pyx_t_1, __pyx_mstate_global->__pyx_int_6) < (0)) __PYX_ERR(0, 1071, __pyx_L1_error)
  if (PySet_Add(__pyx_t_1, __pyx_mstate_global->__pyx_int_15) < (0)) __PYX_ERR(0, 1071, __pyx_L1_error)
  if (PySet_Add(__pyx_t_1, __pyx_mstate_global->__pyx_int_16) < (0)) __PYX_ERR(0, 1071, __pyx_L1_error)
  if (PySet_Add(__pyx_t_1, __pyx_mstate_global->__pyx_int_17) < (0)) __PYX_ERR(0, 1071, __pyx_L1_error)
  __pyx_v_mouse_events = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1072
 *         keyboard_events = {2, 3, 13, 14}
 *         mouse_events = {4, 5, 6, 15, 16, 17}
 *         xinput_bin = self._linux_xinput_binary()             # <<<<<<<<<<<<<<
 *         if not xinput_bin:
 *             logger.warning("xinput binary not found - XTEST path detection disabled")
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_linux_xinput_binary, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_xinput_bin = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1073
 *         mouse_events = {4, 5, 6, 15, 16, 17}
 *         xinput_bin = self._linux_xinput_binary()
 *         if not xinput_bin:             # <<<<<<<<<<<<<<
 *             logger.warning("xinput binary not found - XTEST path detection disabled")
 *             return
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_xinput_bin); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1073, __pyx_L1_error)
  __pyx_t_5 = (!__pyx_t_4);
  if (__pyx_t_5) {

    /* "ws_package/utils/hardware_event_validator.py":1074
 *         xinput_bin = self._linux_xinput_binary()
 *         if not xinput_bin:
 *             logger.warning("xinput binary not found - XTEST path detection disabled")             # <<<<<<<<<<<<<<
 *             return
 * 
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1074, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1074, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_xinput_binary_not_found_XTEST_pa};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1074, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1075
 *         if not xinput_bin:
 *             logger.warning("xinput binary not found - XTEST path detection disabled")
 *             return             # <<<<<<<<<<<<<<
 * 
 *         while not self._stop_hooks:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1073
 *         mouse_events = {4, 5, 6, 15, 16, 17}
 *         xinput_bin = self._linux_xinput_binary()
 *         if not xinput_bin:             # <<<<<<<<<<<<<<
 *             logger.warning("xinput binary not found - XTEST path detection disabled")
 *             return
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1077
 *             return
 * 
 *         while not self._stop_hooks:             # <<<<<<<<<<<<<<
 *             current_event_type = None
 *             proc = None
*/
  while (1) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_stop_hooks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1077, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1077, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = (!__pyx_t_5);
    if (!__pyx_t_4) break;

    /* "ws_package/utils/hardware_event_validator.py":1078
 * 
 *         while not self._stop_hooks:
 *             current_event_type = None             # <<<<<<<<<<<<<<
 *             proc = None
 *             try:
*/
    __Pyx_INCREF(Py_None);
    __Pyx_XDECREF_SET(__pyx_v_current_event_type, ((PyObject*)Py_None));

    /* "ws_package/utils/hardware_event_validator.py":1079
 *         while not self._stop_hooks:
 *             current_event_type = None
 *             proc = None             # <<<<<<<<<<<<<<
 *             try:
 *                 proc = subprocess.Popen(
*/
    __Pyx_INCREF(Py_None);
    __Pyx_XDECREF_SET(__pyx_v_proc, Py_None);

    /* "ws_package/utils/hardware_event_validator.py":1080
 *             current_event_type = None
 *             proc = None
 *             try:             # <<<<<<<<<<<<<<
 *                 proc = subprocess.Popen(
 *                     [xinput_bin, 'test-xi2', '--root'],
*/
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {

          /* "ws_package/utils/hardware_event_validator.py":1081
 *             proc = None
 *             try:
 *                 proc = subprocess.Popen(             # <<<<<<<<<<<<<<
 *                     [xinput_bin, 'test-xi2', '--root'],
 *                     stdout=subprocess.PIPE,
*/
          __pyx_t_7 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_subprocess); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1081, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Popen); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1081, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "ws_package/utils/hardware_event_validator.py":1082
 *             try:
 *                 proc = subprocess.Popen(
 *                     [xinput_bin, 'test-xi2', '--root'],             # <<<<<<<<<<<<<<
 *                     stdout=subprocess.PIPE,
 *                     stderr=subprocess.STDOUT,
*/
          __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1082, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_xinput_bin);
          __Pyx_GIVEREF(__pyx_v_xinput_bin);
          if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_xinput_bin) != (0)) __PYX_ERR(0, 1082, __pyx_L11_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_test_xi2);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_test_xi2);
          if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_kp_u_test_xi2) != (0)) __PYX_ERR(0, 1082, __pyx_L11_error);
          __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_root);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_root);
          if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_mstate_global->__pyx_kp_u_root) != (0)) __PYX_ERR(0, 1082, __pyx_L11_error);

          /* "ws_package/utils/hardware_event_validator.py":1083
 *                 proc = subprocess.Popen(
 *                     [xinput_bin, 'test-xi2', '--root'],
 *                     stdout=subprocess.PIPE,             # <<<<<<<<<<<<<<
 *                     stderr=subprocess.STDOUT,
 *                     text=True,
*/
          __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_subprocess); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1083, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_PIPE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1083, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

          /* "ws_package/utils/hardware_event_validator.py":1084
 *                     [xinput_bin, 'test-xi2', '--root'],
 *                     stdout=subprocess.PIPE,
 *                     stderr=subprocess.STDOUT,             # <<<<<<<<<<<<<<
 *                     text=True,
 *                     bufsize=1,
*/
          __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_subprocess); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1084, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_STDOUT); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1084, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

          /* "ws_package/utils/hardware_event_validator.py":1087
 *                     text=True,
 *                     bufsize=1,
 *                     env=os.environ.copy(),             # <<<<<<<<<<<<<<
 *                 )
 *                 self._linux_xinput_process = proc
*/
          __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1087, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_environ); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1087, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __pyx_t_14 = __pyx_t_16;
          __Pyx_INCREF(__pyx_t_14);
          __pyx_t_3 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL};
            __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1087, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_11);
          }
          __pyx_t_3 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
            assert(__pyx_t_7);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
            __pyx_t_3 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 5 : 0)] = {__pyx_t_7, __pyx_t_2};
            __pyx_t_16 = __Pyx_MakeVectorcallBuilderKwds(5); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1081, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_16);
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_stdout, __pyx_t_12, __pyx_t_16, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1081, __pyx_L11_error)
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_stderr, __pyx_t_13, __pyx_t_16, __pyx_callargs+2, 1) < (0)) __PYX_ERR(0, 1081, __pyx_L11_error)
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_text, Py_True, __pyx_t_16, __pyx_callargs+2, 2) < (0)) __PYX_ERR(0, 1081, __pyx_L11_error)
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_bufsize, __pyx_mstate_global->__pyx_int_1, __pyx_t_16, __pyx_callargs+2, 3) < (0)) __PYX_ERR(0, 1081, __pyx_L11_error)
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_env, __pyx_t_11, __pyx_t_16, __pyx_callargs+2, 4) < (0)) __PYX_ERR(0, 1081, __pyx_L11_error)
            __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_16);
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1081, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_1);
          }
          __Pyx_DECREF_SET(__pyx_v_proc, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "ws_package/utils/hardware_event_validator.py":1089
 *                     env=os.environ.copy(),
 *                 )
 *                 self._linux_xinput_process = proc             # <<<<<<<<<<<<<<
 *                 self._linux_xinput_monitor_active = True
 *                 logger.info(
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_process, __pyx_v_proc) < (0)) __PYX_ERR(0, 1089, __pyx_L11_error)

          /* "ws_package/utils/hardware_event_validator.py":1090
 *                 )
 *                 self._linux_xinput_process = proc
 *                 self._linux_xinput_monitor_active = True             # <<<<<<<<<<<<<<
 *                 logger.info(
 *                     "Linux X11 input monitor started (xtest ids %s)",
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_monitor_active, Py_True) < (0)) __PYX_ERR(0, 1090, __pyx_L11_error)

          /* "ws_package/utils/hardware_event_validator.py":1091
 *                 self._linux_xinput_process = proc
 *                 self._linux_xinput_monitor_active = True
 *                 logger.info(             # <<<<<<<<<<<<<<
 *                     "Linux X11 input monitor started (xtest ids %s)",
 *                     sorted(self._linux_xtest_device_ids),
*/
          __pyx_t_6 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1091, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_info); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1091, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

          /* "ws_package/utils/hardware_event_validator.py":1093
 *                 logger.info(
 *                     "Linux X11 input monitor started (xtest ids %s)",
 *                     sorted(self._linux_xtest_device_ids),             # <<<<<<<<<<<<<<
 *                 )
 * 
*/
          __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xtest_device_ids); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1093, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_13 = PySequence_List(__pyx_t_16); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1093, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          if (unlikely((PyList_Sort(__pyx_t_13) < 0))) __PYX_ERR(0, 1093, __pyx_L11_error)
          __pyx_t_3 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_11))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11);
            assert(__pyx_t_6);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
            __pyx_t_3 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_Linux_X11_input_monitor_started, __pyx_t_13};
            __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1091, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_1);
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "ws_package/utils/hardware_event_validator.py":1096
 *                 )
 * 
 *                 assert proc.stdout is not None             # <<<<<<<<<<<<<<
 *                 for line in proc.stdout:
 *                     if self._stop_hooks:
*/
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_mstate_global->__pyx_n_u_stdout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_4 = (__pyx_t_1 != Py_None);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_4)) {
              __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
              __PYX_ERR(0, 1096, __pyx_L11_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 1096, __pyx_L11_error)
          #endif

          /* "ws_package/utils/hardware_event_validator.py":1097
 * 
 *                 assert proc.stdout is not None
 *                 for line in proc.stdout:             # <<<<<<<<<<<<<<
 *                     if self._stop_hooks:
 *                         break
*/
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_proc, __pyx_mstate_global->__pyx_n_u_stdout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1097, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
            __pyx_t_11 = __pyx_t_1; __Pyx_INCREF(__pyx_t_11);
            __pyx_t_17 = 0;
            __pyx_t_18 = NULL;
          } else {
            __pyx_t_17 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1097, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_18 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1097, __pyx_L11_error)
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          for (;;) {
            if (likely(!__pyx_t_18)) {
              if (likely(PyList_CheckExact(__pyx_t_11))) {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1097, __pyx_L11_error)
                  #endif
                  if (__pyx_t_17 >= __pyx_temp) break;
                }
                __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_11, __pyx_t_17, __Pyx_ReferenceSharing_OwnStrongReference);
                ++__pyx_t_17;
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1097, __pyx_L11_error)
                  #endif
                  if (__pyx_t_17 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_17));
                #else
                __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_17);
                #endif
                ++__pyx_t_17;
              }
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1097, __pyx_L11_error)
            } else {
              __pyx_t_1 = __pyx_t_18(__pyx_t_11);
              if (unlikely(!__pyx_t_1)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1097, __pyx_L11_error)
                  PyErr_Clear();
                }
                break;
              }
            }
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_1);
            __pyx_t_1 = 0;

            /* "ws_package/utils/hardware_event_validator.py":1098
 *                 assert proc.stdout is not None
 *                 for line in proc.stdout:
 *                     if self._stop_hooks:             # <<<<<<<<<<<<<<
 *                         break
 * 
*/
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_stop_hooks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1098, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1098, __pyx_L11_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_4) {

              /* "ws_package/utils/hardware_event_validator.py":1099
 *                 for line in proc.stdout:
 *                     if self._stop_hooks:
 *                         break             # <<<<<<<<<<<<<<
 * 
 *                     stripped = line.strip()
*/
              goto __pyx_L20_break;

              /* "ws_package/utils/hardware_event_validator.py":1098
 *                 assert proc.stdout is not None
 *                 for line in proc.stdout:
 *                     if self._stop_hooks:             # <<<<<<<<<<<<<<
 *                         break
 * 
*/
            }

            /* "ws_package/utils/hardware_event_validator.py":1101
 *                         break
 * 
 *                     stripped = line.strip()             # <<<<<<<<<<<<<<
 *                     event_match = re.match(r'EVENT type (\d+)', stripped)
 *                     if event_match:
*/
            __pyx_t_13 = __pyx_v_line;
            __Pyx_INCREF(__pyx_t_13);
            __pyx_t_3 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
              __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __pyx_L11_error)
              __Pyx_GOTREF(__pyx_t_1);
            }
            __Pyx_XDECREF_SET(__pyx_v_stripped, __pyx_t_1);
            __pyx_t_1 = 0;

            /* "ws_package/utils/hardware_event_validator.py":1102
 * 
 *                     stripped = line.strip()
 *                     event_match = re.match(r'EVENT type (\d+)', stripped)             # <<<<<<<<<<<<<<
 *                     if event_match:
 *                         current_event_type = int(event_match.group(1))
*/
            __pyx_t_13 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1102, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_match); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1102, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_3 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_16))) {
              __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_16);
              assert(__pyx_t_13);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
              __pyx_t_3 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_mstate_global->__pyx_kp_u_EVENT_type_d, __pyx_v_stripped};
              __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L11_error)
              __Pyx_GOTREF(__pyx_t_1);
            }
            __Pyx_XDECREF_SET(__pyx_v_event_match, __pyx_t_1);
            __pyx_t_1 = 0;

            /* "ws_package/utils/hardware_event_validator.py":1103
 *                     stripped = line.strip()
 *                     event_match = re.match(r'EVENT type (\d+)', stripped)
 *                     if event_match:             # <<<<<<<<<<<<<<
 *                         current_event_type = int(event_match.group(1))
 *                         continue
*/
            __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_event_match); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1103, __pyx_L11_error)
            if (__pyx_t_4) {

              /* "ws_package/utils/hardware_event_validator.py":1104
 *                     event_match = re.match(r'EVENT type (\d+)', stripped)
 *                     if event_match:
 *                         current_event_type = int(event_match.group(1))             # <<<<<<<<<<<<<<
 *                         continue
 * 
*/
              __pyx_t_16 = __pyx_v_event_match;
              __Pyx_INCREF(__pyx_t_16);
              __pyx_t_3 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_mstate_global->__pyx_int_1};
                __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L11_error)
                __Pyx_GOTREF(__pyx_t_1);
              }
              __pyx_t_16 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1104, __pyx_L11_error)
              __Pyx_GOTREF(__pyx_t_16);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_DECREF_SET(__pyx_v_current_event_type, ((PyObject*)__pyx_t_16));
              __pyx_t_16 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1105
 *                     if event_match:
 *                         current_event_type = int(event_match.group(1))
 *                         continue             # <<<<<<<<<<<<<<
 * 
 *                     device_match = re.match(r'device: \d+ \((\d+)\)', stripped)
*/
              goto __pyx_L19_continue;

              /* "ws_package/utils/hardware_event_validator.py":1103
 *                     stripped = line.strip()
 *                     event_match = re.match(r'EVENT type (\d+)', stripped)
 *                     if event_match:             # <<<<<<<<<<<<<<
 *                         current_event_type = int(event_match.group(1))
 *                         continue
*/
            }

            /* "ws_package/utils/hardware_event_validator.py":1107
 *                         continue
 * 
 *                     device_match = re.match(r'device: \d+ \((\d+)\)', stripped)             # <<<<<<<<<<<<<<
 *                     if device_match and current_event_type is not None:
 *                         slave_id = int(device_match.group(1))
*/
            __pyx_t_1 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1107, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_match); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1107, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_3 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_6))) {
              __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
              assert(__pyx_t_1);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
              __pyx_t_3 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_device_d_d, __pyx_v_stripped};
              __pyx_t_16 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1107, __pyx_L11_error)
              __Pyx_GOTREF(__pyx_t_16);
            }
            __Pyx_XDECREF_SET(__pyx_v_device_match, __pyx_t_16);
            __pyx_t_16 = 0;

            /* "ws_package/utils/hardware_event_validator.py":1108
 * 
 *                     device_match = re.match(r'device: \d+ \((\d+)\)', stripped)
 *                     if device_match and current_event_type is not None:             # <<<<<<<<<<<<<<
 *                         slave_id = int(device_match.group(1))
 *                         now = time.time()
*/
            __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_device_match); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1108, __pyx_L11_error)
            if (__pyx_t_5) {
            } else {
              __pyx_t_4 = __pyx_t_5;
              goto __pyx_L24_bool_binop_done;
            }
            __pyx_t_5 = (__pyx_v_current_event_type != ((PyObject*)Py_None));
            __pyx_t_4 = __pyx_t_5;
            __pyx_L24_bool_binop_done:;
            if (__pyx_t_4) {

              /* "ws_package/utils/hardware_event_validator.py":1109
 *                     device_match = re.match(r'device: \d+ \((\d+)\)', stripped)
 *                     if device_match and current_event_type is not None:
 *                         slave_id = int(device_match.group(1))             # <<<<<<<<<<<<<<
 *                         now = time.time()
 *                         with self._linux_lock:
*/
              __pyx_t_6 = __pyx_v_device_match;
              __Pyx_INCREF(__pyx_t_6);
              __pyx_t_3 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_int_1};
                __pyx_t_16 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1109, __pyx_L11_error)
                __Pyx_GOTREF(__pyx_t_16);
              }
              __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1109, __pyx_L11_error)
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_XDECREF_SET(__pyx_v_slave_id, ((PyObject*)__pyx_t_6));
              __pyx_t_6 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1110
 *                     if device_match and current_event_type is not None:
 *                         slave_id = int(device_match.group(1))
 *                         now = time.time()             # <<<<<<<<<<<<<<
 *                         with self._linux_lock:
 *                             if slave_id in self._linux_xtest_device_ids:
*/
              __pyx_t_16 = NULL;
              __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1110, __pyx_L11_error)
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1110, __pyx_L11_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_3 = 1;
              #if CYTHON_UNPACK_METHODS
              if (unlikely(PyMethod_Check(__pyx_t_13))) {
                __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_13);
                assert(__pyx_t_16);
                PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
                __Pyx_INCREF(__pyx_t_16);
                __Pyx_INCREF(__pyx__function);
                __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
                __pyx_t_3 = 0;
              }
              #endif
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_16, NULL};
                __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1110, __pyx_L11_error)
                __Pyx_GOTREF(__pyx_t_6);
              }
              __Pyx_XDECREF_SET(__pyx_v_now, __pyx_t_6);
              __pyx_t_6 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1111
 *                         slave_id = int(device_match.group(1))
 *                         now = time.time()
 *                         with self._linux_lock:             # <<<<<<<<<<<<<<
 *                             if slave_id in self._linux_xtest_device_ids:
 *                                 if current_event_type in keyboard_events:
*/
              /*with:*/ {
                __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_lock); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1111, __pyx_L11_error)
                __Pyx_GOTREF(__pyx_t_6);
                __pyx_t_19 = __Pyx_PyObject_LookupSpecial(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1111, __pyx_L11_error)
                __Pyx_GOTREF(__pyx_t_19);
                __pyx_t_16 = NULL;
                __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1111, __pyx_L26_error)
                __Pyx_GOTREF(__pyx_t_1);
                __pyx_t_3 = 1;
                #if CYTHON_UNPACK_METHODS
                if (likely(PyMethod_Check(__pyx_t_1))) {
                  __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_1);
                  assert(__pyx_t_16);
                  PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
                  __Pyx_INCREF(__pyx_t_16);
                  __Pyx_INCREF(__pyx__function);
                  __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
                  __pyx_t_3 = 0;
                }
                #endif
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_16, NULL};
                  __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1111, __pyx_L26_error)
                  __Pyx_GOTREF(__pyx_t_13);
                }
                __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                /*try:*/ {
                  {
                    __Pyx_PyThreadState_declare
                    __Pyx_PyThreadState_assign
                    __Pyx_ExceptionSave(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
                    __Pyx_XGOTREF(__pyx_t_20);
                    __Pyx_XGOTREF(__pyx_t_21);
                    __Pyx_XGOTREF(__pyx_t_22);
                    /*try:*/ {

                      /* "ws_package/utils/hardware_event_validator.py":1112
 *                         now = time.time()
 *                         with self._linux_lock:
 *                             if slave_id in self._linux_xtest_device_ids:             # <<<<<<<<<<<<<<
 *                                 if current_event_type in keyboard_events:
 *                                     self._linux_last_xtest_keyboard_ts = now
*/
                      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xtest_device_ids); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1112, __pyx_L32_error)
                      __Pyx_GOTREF(__pyx_t_6);
                      __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_slave_id, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1112, __pyx_L32_error)
                      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                      if (__pyx_t_4) {

                        /* "ws_package/utils/hardware_event_validator.py":1113
 *                         with self._linux_lock:
 *                             if slave_id in self._linux_xtest_device_ids:
 *                                 if current_event_type in keyboard_events:             # <<<<<<<<<<<<<<
 *                                     self._linux_last_xtest_keyboard_ts = now
 *                                 elif current_event_type in mouse_events:
*/
                        __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_v_current_event_type, __pyx_v_keyboard_events, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1113, __pyx_L32_error)
                        if (__pyx_t_4) {

                          /* "ws_package/utils/hardware_event_validator.py":1114
 *                             if slave_id in self._linux_xtest_device_ids:
 *                                 if current_event_type in keyboard_events:
 *                                     self._linux_last_xtest_keyboard_ts = now             # <<<<<<<<<<<<<<
 *                                 elif current_event_type in mouse_events:
 *                                     self._linux_last_xtest_mouse_ts = now
*/
                          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_xtest_keyboard_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 1114, __pyx_L32_error)

                          /* "ws_package/utils/hardware_event_validator.py":1113
 *                         with self._linux_lock:
 *                             if slave_id in self._linux_xtest_device_ids:
 *                                 if current_event_type in keyboard_events:             # <<<<<<<<<<<<<<
 *                                     self._linux_last_xtest_keyboard_ts = now
 *                                 elif current_event_type in mouse_events:
*/
                          goto __pyx_L41;
                        }

                        /* "ws_package/utils/hardware_event_validator.py":1115
 *                                 if current_event_type in keyboard_events:
 *                                     self._linux_last_xtest_keyboard_ts = now
 *                                 elif current_event_type in mouse_events:             # <<<<<<<<<<<<<<
 *                                     self._linux_last_xtest_mouse_ts = now
 *                             else:
*/
                        __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_v_current_event_type, __pyx_v_mouse_events, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1115, __pyx_L32_error)
                        if (__pyx_t_4) {

                          /* "ws_package/utils/hardware_event_validator.py":1116
 *                                     self._linux_last_xtest_keyboard_ts = now
 *                                 elif current_event_type in mouse_events:
 *                                     self._linux_last_xtest_mouse_ts = now             # <<<<<<<<<<<<<<
 *                             else:
 *                                 if current_event_type in keyboard_events:
*/
                          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_xtest_mouse_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 1116, __pyx_L32_error)

                          /* "ws_package/utils/hardware_event_validator.py":1115
 *                                 if current_event_type in keyboard_events:
 *                                     self._linux_last_xtest_keyboard_ts = now
 *                                 elif current_event_type in mouse_events:             # <<<<<<<<<<<<<<
 *                                     self._linux_last_xtest_mouse_ts = now
 *                             else:
*/
                        }
                        __pyx_L41:;

                        /* "ws_package/utils/hardware_event_validator.py":1112
 *                         now = time.time()
 *                         with self._linux_lock:
 *                             if slave_id in self._linux_xtest_device_ids:             # <<<<<<<<<<<<<<
 *                                 if current_event_type in keyboard_events:
 *                                     self._linux_last_xtest_keyboard_ts = now
*/
                        goto __pyx_L40;
                      }

                      /* "ws_package/utils/hardware_event_validator.py":1118
 *                                     self._linux_last_xtest_mouse_ts = now
 *                             else:
 *                                 if current_event_type in keyboard_events:             # <<<<<<<<<<<<<<
 *                                     self._linux_last_hw_keyboard_ts = now
 *                                 elif current_event_type in mouse_events:
*/
                      /*else*/ {
                        __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_v_current_event_type, __pyx_v_keyboard_events, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1118, __pyx_L32_error)
                        if (__pyx_t_4) {

                          /* "ws_package/utils/hardware_event_validator.py":1119
 *                             else:
 *                                 if current_event_type in keyboard_events:
 *                                     self._linux_last_hw_keyboard_ts = now             # <<<<<<<<<<<<<<
 *                                 elif current_event_type in mouse_events:
 *                                     self._linux_last_hw_mouse_ts = now
*/
                          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_hw_keyboard_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 1119, __pyx_L32_error)

                          /* "ws_package/utils/hardware_event_validator.py":1118
 *                                     self._linux_last_xtest_mouse_ts = now
 *                             else:
 *                                 if current_event_type in keyboard_events:             # <<<<<<<<<<<<<<
 *                                     self._linux_last_hw_keyboard_ts = now
 *                                 elif current_event_type in mouse_events:
*/
                          goto __pyx_L42;
                        }

                        /* "ws_package/utils/hardware_event_validator.py":1120
 *                                 if current_event_type in keyboard_events:
 *                                     self._linux_last_hw_keyboard_ts = now
 *                                 elif current_event_type in mouse_events:             # <<<<<<<<<<<<<<
 *                                     self._linux_last_hw_mouse_ts = now
 *                         current_event_type = None
*/
                        __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_v_current_event_type, __pyx_v_mouse_events, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1120, __pyx_L32_error)
                        if (__pyx_t_4) {

                          /* "ws_package/utils/hardware_event_validator.py":1121
 *                                     self._linux_last_hw_keyboard_ts = now
 *                                 elif current_event_type in mouse_events:
 *                                     self._linux_last_hw_mouse_ts = now             # <<<<<<<<<<<<<<
 *                         current_event_type = None
 *             except FileNotFoundError:
*/
                          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_hw_mouse_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 1121, __pyx_L32_error)

                          /* "ws_package/utils/hardware_event_validator.py":1120
 *                                 if current_event_type in keyboard_events:
 *                                     self._linux_last_hw_keyboard_ts = now
 *                                 elif current_event_type in mouse_events:             # <<<<<<<<<<<<<<
 *                                     self._linux_last_hw_mouse_ts = now
 *                         current_event_type = None
*/
                        }
                        __pyx_L42:;
                      }
                      __pyx_L40:;

                      /* "ws_package/utils/hardware_event_validator.py":1111
 *                         slave_id = int(device_match.group(1))
 *                         now = time.time()
 *                         with self._linux_lock:             # <<<<<<<<<<<<<<
 *                             if slave_id in self._linux_xtest_device_ids:
 *                                 if current_event_type in keyboard_events:
*/
                    }
                    __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
                    __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
                    __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
                    goto __pyx_L39_try_end;
                    __pyx_L32_error:;
                    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                    /*except:*/ {
                      __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_xinput_monitor_thread", __pyx_clineno, __pyx_lineno, __pyx_filename);
                      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_13, &__pyx_t_1) < 0) __PYX_ERR(0, 1111, __pyx_L34_except_error)
                      __Pyx_XGOTREF(__pyx_t_6);
                      __Pyx_XGOTREF(__pyx_t_13);
                      __Pyx_XGOTREF(__pyx_t_1);
                      __pyx_t_16 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_13, __pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1111, __pyx_L34_except_error)
                      __Pyx_GOTREF(__pyx_t_16);
                      __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_16, NULL);
                      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
                      if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1111, __pyx_L34_except_error)
                      __Pyx_GOTREF(__pyx_t_23);
                      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_23);
                      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
                      if (__pyx_t_4 < (0)) __PYX_ERR(0, 1111, __pyx_L34_except_error)
                      __pyx_t_5 = (!__pyx_t_4);
                      if (unlikely(__pyx_t_5)) {
                        __Pyx_GIVEREF(__pyx_t_6);
                        __Pyx_GIVEREF(__pyx_t_13);
                        __Pyx_XGIVEREF(__pyx_t_1);
                        __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_13, __pyx_t_1);
                        __pyx_t_6 = 0;  __pyx_t_13 = 0;  __pyx_t_1 = 0; 
                        __PYX_ERR(0, 1111, __pyx_L34_except_error)
                      }
                      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                      goto __pyx_L33_exception_handled;
                    }
                    __pyx_L34_except_error:;
                    __Pyx_XGIVEREF(__pyx_t_20);
                    __Pyx_XGIVEREF(__pyx_t_21);
                    __Pyx_XGIVEREF(__pyx_t_22);
                    __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
                    goto __pyx_L11_error;
                    __pyx_L33_exception_handled:;
                    __Pyx_XGIVEREF(__pyx_t_20);
                    __Pyx_XGIVEREF(__pyx_t_21);
                    __Pyx_XGIVEREF(__pyx_t_22);
                    __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
                    __pyx_L39_try_end:;
                  }
                }
                /*finally:*/ {
                  /*normal exit:*/{
                    if (__pyx_t_19) {
                      __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_mstate_global->__pyx_tuple[2], NULL);
                      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                      if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1111, __pyx_L11_error)
                      __Pyx_GOTREF(__pyx_t_22);
                      __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
                    }
                    goto __pyx_L31;
                  }
                  __pyx_L31:;
                }
                goto __pyx_L46;
                __pyx_L26_error:;
                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                goto __pyx_L11_error;
                __pyx_L46:;
              }

              /* "ws_package/utils/hardware_event_validator.py":1122
 *                                 elif current_event_type in mouse_events:
 *                                     self._linux_last_hw_mouse_ts = now
 *                         current_event_type = None             # <<<<<<<<<<<<<<
 *             except FileNotFoundError:
 *                 logger.warning("xinput not found - XTEST path detection disabled")
*/
              __Pyx_INCREF(Py_None);
              __Pyx_DECREF_SET(__pyx_v_current_event_type, ((PyObject*)Py_None));

              /* "ws_package/utils/hardware_event_validator.py":1108
 * 
 *                     device_match = re.match(r'device: \d+ \((\d+)\)', stripped)
 *                     if device_match and current_event_type is not None:             # <<<<<<<<<<<<<<
 *                         slave_id = int(device_match.group(1))
 *                         now = time.time()
*/
            }

            /* "ws_package/utils/hardware_event_validator.py":1097
 * 
 *                 assert proc.stdout is not None
 *                 for line in proc.stdout:             # <<<<<<<<<<<<<<
 *                     if self._stop_hooks:
 *                         break
*/
            __pyx_L19_continue:;
          }
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L47_for_end;
          __pyx_L20_break:;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L47_for_end;
          __pyx_L47_for_end:;

          /* "ws_package/utils/hardware_event_validator.py":1080
 *             current_event_type = None
 *             proc = None
 *             try:             # <<<<<<<<<<<<<<
 *                 proc = subprocess.Popen(
 *                     [xinput_bin, 'test-xi2', '--root'],
*/
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L18_try_end;
        __pyx_L11_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "ws_package/utils/hardware_event_validator.py":1123
 *                                     self._linux_last_hw_mouse_ts = now
 *                         current_event_type = None
 *             except FileNotFoundError:             # <<<<<<<<<<<<<<
 *                 logger.warning("xinput not found - XTEST path detection disabled")
 *                 return
*/
        __pyx_t_24 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_FileNotFoundError))));
        if (__pyx_t_24) {
          __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_xinput_monitor_thread", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_1, &__pyx_t_13) < 0) __PYX_ERR(0, 1123, __pyx_L13_except_error)
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_13);

          /* "ws_package/utils/hardware_event_validator.py":1124
 *                         current_event_type = None
 *             except FileNotFoundError:
 *                 logger.warning("xinput not found - XTEST path detection disabled")             # <<<<<<<<<<<<<<
 *                 return
 *             except Exception as e:
*/
          __pyx_t_16 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1124, __pyx_L13_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1124, __pyx_L13_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_3 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_2);
            assert(__pyx_t_16);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_16);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
            __pyx_t_3 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_mstate_global->__pyx_kp_u_xinput_not_found_XTEST_path_dete};
            __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1124, __pyx_L13_except_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "ws_package/utils/hardware_event_validator.py":1125
 *             except FileNotFoundError:
 *                 logger.warning("xinput not found - XTEST path detection disabled")
 *                 return             # <<<<<<<<<<<<<<
 *             except Exception as e:
 *                 logger.warning("Linux X11 input monitor error: %s", e)
*/
          __Pyx_XDECREF(__pyx_r);
          __pyx_r = Py_None; __Pyx_INCREF(Py_None);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          goto __pyx_L14_except_return;
        }

        /* "ws_package/utils/hardware_event_validator.py":1126
 *                 logger.warning("xinput not found - XTEST path detection disabled")
 *                 return
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 logger.warning("Linux X11 input monitor error: %s", e)
 *             finally:
*/
        __pyx_t_24 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
        if (__pyx_t_24) {
          __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_xinput_monitor_thread", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_1, &__pyx_t_11) < 0) __PYX_ERR(0, 1126, __pyx_L13_except_error)
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_1);
          __pyx_v_e = __pyx_t_1;
          /*try:*/ {

            /* "ws_package/utils/hardware_event_validator.py":1127
 *                 return
 *             except Exception as e:
 *                 logger.warning("Linux X11 input monitor error: %s", e)             # <<<<<<<<<<<<<<
 *             finally:
 *                 self._linux_xinput_monitor_active = False
*/
            __pyx_t_2 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1127, __pyx_L55_error)
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1127, __pyx_L55_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __pyx_t_3 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_12))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_12);
              assert(__pyx_t_2);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
              __pyx_t_3 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Linux_X11_input_monitor_error_s, __pyx_v_e};
              __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1127, __pyx_L55_error)
              __Pyx_GOTREF(__pyx_t_6);
            }
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          }

          /* "ws_package/utils/hardware_event_validator.py":1126
 *                 logger.warning("xinput not found - XTEST path detection disabled")
 *                 return
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 logger.warning("Linux X11 input monitor error: %s", e)
 *             finally:
*/
          /*finally:*/ {
            /*normal exit:*/{
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              goto __pyx_L56;
            }
            __pyx_L55_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_19 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_23 = 0; __pyx_t_27 = 0;
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
               __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_23, &__pyx_t_27);
              if ( unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_22, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_22, &__pyx_t_21);
              __Pyx_XGOTREF(__pyx_t_19);
              __Pyx_XGOTREF(__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_21);
              __Pyx_XGOTREF(__pyx_t_20);
              __Pyx_XGOTREF(__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_27);
              __pyx_t_24 = __pyx_lineno; __pyx_t_25 = __pyx_clineno; __pyx_t_26 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              }
              __Pyx_XGIVEREF(__pyx_t_20);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_XGIVEREF(__pyx_t_27);
              __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_23, __pyx_t_27);
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_ErrRestore(__pyx_t_19, __pyx_t_22, __pyx_t_21);
              __pyx_t_19 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_23 = 0; __pyx_t_27 = 0;
              __pyx_lineno = __pyx_t_24; __pyx_clineno = __pyx_t_25; __pyx_filename = __pyx_t_26;
              goto __pyx_L13_except_error;
            }
            __pyx_L56:;
          }
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L12_exception_handled;
        }
        goto __pyx_L13_except_error;

        /* "ws_package/utils/hardware_event_validator.py":1080
 *             current_event_type = None
 *             proc = None
 *             try:             # <<<<<<<<<<<<<<
 *                 proc = subprocess.Popen(
 *                     [xinput_bin, 'test-xi2', '--root'],
*/
        __pyx_L13_except_error:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L9_error;
        __pyx_L14_except_return:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L8_return;
        __pyx_L12_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L18_try_end:;
      }
    }

    /* "ws_package/utils/hardware_event_validator.py":1129
 *                 logger.warning("Linux X11 input monitor error: %s", e)
 *             finally:
 *                 self._linux_xinput_monitor_active = False             # <<<<<<<<<<<<<<
 *                 if proc is not None and proc.poll() is None:
 *                     try:
*/
    /*finally:*/ {
      /*normal exit:*/{
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_monitor_active, Py_False) < (0)) __PYX_ERR(0, 1129, __pyx_L1_error)

        /* "ws_package/utils/hardware_event_validator.py":1130
 *             finally:
 *                 self._linux_xinput_monitor_active = False
 *                 if proc is not None and proc.poll() is None:             # <<<<<<<<<<<<<<
 *                     try:
 *                         proc.terminate()
*/
        __pyx_t_4 = (__pyx_v_proc != Py_None);
        if (__pyx_t_4) {
        } else {
          __pyx_t_5 = __pyx_t_4;
          goto __pyx_L62_bool_binop_done;
        }
        __pyx_t_1 = __pyx_v_proc;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
          __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_poll, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1130, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __pyx_t_4 = (__pyx_t_11 == Py_None);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_5 = __pyx_t_4;
        __pyx_L62_bool_binop_done:;
        if (__pyx_t_5) {

          /* "ws_package/utils/hardware_event_validator.py":1131
 *                 self._linux_xinput_monitor_active = False
 *                 if proc is not None and proc.poll() is None:
 *                     try:             # <<<<<<<<<<<<<<
 *                         proc.terminate()
 *                     except Exception:
*/
          {
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
            __Pyx_XGOTREF(__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_9);
            __Pyx_XGOTREF(__pyx_t_8);
            /*try:*/ {

              /* "ws_package/utils/hardware_event_validator.py":1132
 *                 if proc is not None and proc.poll() is None:
 *                     try:
 *                         proc.terminate()             # <<<<<<<<<<<<<<
 *                     except Exception:
 *                         pass
*/
              __pyx_t_1 = __pyx_v_proc;
              __Pyx_INCREF(__pyx_t_1);
              __pyx_t_3 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
                __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_terminate, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1132, __pyx_L64_error)
                __Pyx_GOTREF(__pyx_t_11);
              }
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1131
 *                 self._linux_xinput_monitor_active = False
 *                 if proc is not None and proc.poll() is None:
 *                     try:             # <<<<<<<<<<<<<<
 *                         proc.terminate()
 *                     except Exception:
*/
            }
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            goto __pyx_L71_try_end;
            __pyx_L64_error:;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

            /* "ws_package/utils/hardware_event_validator.py":1133
 *                     try:
 *                         proc.terminate()
 *                     except Exception:             # <<<<<<<<<<<<<<
 *                         pass
 *                 self._linux_xinput_process = None
*/
            __pyx_t_25 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
            if (__pyx_t_25) {
              __Pyx_ErrRestore(0,0,0);
              goto __pyx_L65_exception_handled;
            }
            goto __pyx_L66_except_error;

            /* "ws_package/utils/hardware_event_validator.py":1131
 *                 self._linux_xinput_monitor_active = False
 *                 if proc is not None and proc.poll() is None:
 *                     try:             # <<<<<<<<<<<<<<
 *                         proc.terminate()
 *                     except Exception:
*/
            __pyx_L66_except_error:;
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_8);
            __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
            goto __pyx_L1_error;
            __pyx_L65_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_8);
            __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
            __pyx_L71_try_end:;
          }

          /* "ws_package/utils/hardware_event_validator.py":1130
 *             finally:
 *                 self._linux_xinput_monitor_active = False
 *                 if proc is not None and proc.poll() is None:             # <<<<<<<<<<<<<<
 *                     try:
 *                         proc.terminate()
*/
        }

        /* "ws_package/utils/hardware_event_validator.py":1135
 *                     except Exception:
 *                         pass
 *                 self._linux_xinput_process = None             # <<<<<<<<<<<<<<
 * 
 *             if not self._stop_hooks:
*/
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_process, Py_None) < (0)) __PYX_ERR(0, 1135, __pyx_L1_error)
        goto __pyx_L10;
      }
      __pyx_L9_error:;
      /*exception exit:*/{
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_27 = 0; __pyx_t_23 = 0; __pyx_t_20 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_ExceptionSwap(&__pyx_t_27, &__pyx_t_23, &__pyx_t_20);
        if ( unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_27);
        __Pyx_XGOTREF(__pyx_t_23);
        __Pyx_XGOTREF(__pyx_t_20);
        __pyx_t_25 = __pyx_lineno; __pyx_t_24 = __pyx_clineno; __pyx_t_28 = __pyx_filename;
        {

          /* "ws_package/utils/hardware_event_validator.py":1129
 *                 logger.warning("Linux X11 input monitor error: %s", e)
 *             finally:
 *                 self._linux_xinput_monitor_active = False             # <<<<<<<<<<<<<<
 *                 if proc is not None and proc.poll() is None:
 *                     try:
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_monitor_active, Py_False) < (0)) __PYX_ERR(0, 1129, __pyx_L77_error)

          /* "ws_package/utils/hardware_event_validator.py":1130
 *             finally:
 *                 self._linux_xinput_monitor_active = False
 *                 if proc is not None and proc.poll() is None:             # <<<<<<<<<<<<<<
 *                     try:
 *                         proc.terminate()
*/
          __pyx_t_4 = (__pyx_v_proc != Py_None);
          if (__pyx_t_4) {
          } else {
            __pyx_t_5 = __pyx_t_4;
            goto __pyx_L79_bool_binop_done;
          }
          __pyx_t_1 = __pyx_v_proc;
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_3 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
            __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_poll, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1130, __pyx_L77_error)
            __Pyx_GOTREF(__pyx_t_11);
          }
          __pyx_t_4 = (__pyx_t_11 == Py_None);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_5 = __pyx_t_4;
          __pyx_L79_bool_binop_done:;
          if (__pyx_t_5) {

            /* "ws_package/utils/hardware_event_validator.py":1131
 *                 self._linux_xinput_monitor_active = False
 *                 if proc is not None and proc.poll() is None:
 *                     try:             # <<<<<<<<<<<<<<
 *                         proc.terminate()
 *                     except Exception:
*/
            {
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __Pyx_ExceptionSave(&__pyx_t_21, &__pyx_t_22, &__pyx_t_19);
              __Pyx_XGOTREF(__pyx_t_21);
              __Pyx_XGOTREF(__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_19);
              /*try:*/ {

                /* "ws_package/utils/hardware_event_validator.py":1132
 *                 if proc is not None and proc.poll() is None:
 *                     try:
 *                         proc.terminate()             # <<<<<<<<<<<<<<
 *                     except Exception:
 *                         pass
*/
                __pyx_t_1 = __pyx_v_proc;
                __Pyx_INCREF(__pyx_t_1);
                __pyx_t_3 = 0;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
                  __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_terminate, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1132, __pyx_L81_error)
                  __Pyx_GOTREF(__pyx_t_11);
                }
                __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

                /* "ws_package/utils/hardware_event_validator.py":1131
 *                 self._linux_xinput_monitor_active = False
 *                 if proc is not None and proc.poll() is None:
 *                     try:             # <<<<<<<<<<<<<<
 *                         proc.terminate()
 *                     except Exception:
*/
              }
              __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
              __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
              __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
              goto __pyx_L88_try_end;
              __pyx_L81_error:;
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1133
 *                     try:
 *                         proc.terminate()
 *                     except Exception:             # <<<<<<<<<<<<<<
 *                         pass
 *                 self._linux_xinput_process = None
*/
              __pyx_t_29 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
              if (__pyx_t_29) {
                __Pyx_ErrRestore(0,0,0);
                goto __pyx_L82_exception_handled;
              }
              goto __pyx_L83_except_error;

              /* "ws_package/utils/hardware_event_validator.py":1131
 *                 self._linux_xinput_monitor_active = False
 *                 if proc is not None and proc.poll() is None:
 *                     try:             # <<<<<<<<<<<<<<
 *                         proc.terminate()
 *                     except Exception:
*/
              __pyx_L83_except_error:;
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_19);
              goto __pyx_L77_error;
              __pyx_L82_exception_handled:;
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_19);
              __pyx_L88_try_end:;
            }

            /* "ws_package/utils/hardware_event_validator.py":1130
 *             finally:
 *                 self._linux_xinput_monitor_active = False
 *                 if proc is not None and proc.poll() is None:             # <<<<<<<<<<<<<<
 *                     try:
 *                         proc.terminate()
*/
          }

          /* "ws_package/utils/hardware_event_validator.py":1135
 *                     except Exception:
 *                         pass
 *                 self._linux_xinput_process = None             # <<<<<<<<<<<<<<
 * 
 *             if not self._stop_hooks:
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_process, Py_None) < (0)) __PYX_ERR(0, 1135, __pyx_L77_error)
        }
        __Pyx_XGIVEREF(__pyx_t_27);
        __Pyx_XGIVEREF(__pyx_t_23);
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_23, __pyx_t_20);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_27 = 0; __pyx_t_23 = 0; __pyx_t_20 = 0;
        __pyx_lineno = __pyx_t_25; __pyx_clineno = __pyx_t_24; __pyx_filename = __pyx_t_28;
        goto __pyx_L1_error;
        __pyx_L77_error:;
        __Pyx_XGIVEREF(__pyx_t_27);
        __Pyx_XGIVEREF(__pyx_t_23);
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_23, __pyx_t_20);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_27 = 0; __pyx_t_23 = 0; __pyx_t_20 = 0;
        goto __pyx_L1_error;
      }
      __pyx_L8_return: {
        __pyx_t_20 = __pyx_r;
        __pyx_r = 0;

        /* "ws_package/utils/hardware_event_validator.py":1129
 *                 logger.warning("Linux X11 input monitor error: %s", e)
 *             finally:
 *                 self._linux_xinput_monitor_active = False             # <<<<<<<<<<<<<<
 *                 if proc is not None and proc.poll() is None:
 *                     try:
*/
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_monitor_active, Py_False) < (0)) __PYX_ERR(0, 1129, __pyx_L1_error)

        /* "ws_package/utils/hardware_event_validator.py":1130
 *             finally:
 *                 self._linux_xinput_monitor_active = False
 *                 if proc is not None and proc.poll() is None:             # <<<<<<<<<<<<<<
 *                     try:
 *                         proc.terminate()
*/
        __pyx_t_4 = (__pyx_v_proc != Py_None);
        if (__pyx_t_4) {
        } else {
          __pyx_t_5 = __pyx_t_4;
          goto __pyx_L92_bool_binop_done;
        }
        __pyx_t_1 = __pyx_v_proc;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
          __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_poll, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1130, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __pyx_t_4 = (__pyx_t_11 == Py_None);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_5 = __pyx_t_4;
        __pyx_L92_bool_binop_done:;
        if (__pyx_t_5) {

          /* "ws_package/utils/hardware_event_validator.py":1131
 *                 self._linux_xinput_monitor_active = False
 *                 if proc is not None and proc.poll() is None:
 *                     try:             # <<<<<<<<<<<<<<
 *                         proc.terminate()
 *                     except Exception:
*/
          {
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __Pyx_ExceptionSave(&__pyx_t_23, &__pyx_t_27, &__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_23);
            __Pyx_XGOTREF(__pyx_t_27);
            __Pyx_XGOTREF(__pyx_t_10);
            /*try:*/ {

              /* "ws_package/utils/hardware_event_validator.py":1132
 *                 if proc is not None and proc.poll() is None:
 *                     try:
 *                         proc.terminate()             # <<<<<<<<<<<<<<
 *                     except Exception:
 *                         pass
*/
              __pyx_t_1 = __pyx_v_proc;
              __Pyx_INCREF(__pyx_t_1);
              __pyx_t_3 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
                __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_terminate, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1132, __pyx_L94_error)
                __Pyx_GOTREF(__pyx_t_11);
              }
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1131
 *                 self._linux_xinput_monitor_active = False
 *                 if proc is not None and proc.poll() is None:
 *                     try:             # <<<<<<<<<<<<<<
 *                         proc.terminate()
 *                     except Exception:
*/
            }
            __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
            __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            goto __pyx_L101_try_end;
            __pyx_L94_error:;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

            /* "ws_package/utils/hardware_event_validator.py":1133
 *                     try:
 *                         proc.terminate()
 *                     except Exception:             # <<<<<<<<<<<<<<
 *                         pass
 *                 self._linux_xinput_process = None
*/
            __pyx_t_24 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
            if (__pyx_t_24) {
              __Pyx_ErrRestore(0,0,0);
              goto __pyx_L95_exception_handled;
            }
            goto __pyx_L96_except_error;

            /* "ws_package/utils/hardware_event_validator.py":1131
 *                 self._linux_xinput_monitor_active = False
 *                 if proc is not None and proc.poll() is None:
 *                     try:             # <<<<<<<<<<<<<<
 *                         proc.terminate()
 *                     except Exception:
*/
            __pyx_L96_except_error:;
            __Pyx_XGIVEREF(__pyx_t_23);
            __Pyx_XGIVEREF(__pyx_t_27);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_27, __pyx_t_10);
            goto __pyx_L1_error;
            __pyx_L95_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_23);
            __Pyx_XGIVEREF(__pyx_t_27);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_27, __pyx_t_10);
            __pyx_L101_try_end:;
          }

          /* "ws_package/utils/hardware_event_validator.py":1130
 *             finally:
 *                 self._linux_xinput_monitor_active = False
 *                 if proc is not None and proc.poll() is None:             # <<<<<<<<<<<<<<
 *                     try:
 *                         proc.terminate()
*/
        }

        /* "ws_package/utils/hardware_event_validator.py":1135
 *                     except Exception:
 *                         pass
 *                 self._linux_xinput_process = None             # <<<<<<<<<<<<<<
 * 
 *             if not self._stop_hooks:
*/
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_xinput_process, Py_None) < (0)) __PYX_ERR(0, 1135, __pyx_L1_error)
        __pyx_r = __pyx_t_20;
        __pyx_t_20 = 0;
        goto __pyx_L0;
      }
      __pyx_L10:;
    }

    /* "ws_package/utils/hardware_event_validator.py":1137
 *                 self._linux_xinput_process = None
 * 
 *             if not self._stop_hooks:             # <<<<<<<<<<<<<<
 *                 logger.warning("Linux X11 input monitor stopped  restarting in 2s")
 *                 time.sleep(2.0)
*/
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_stop_hooks); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1137, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_4 = (!__pyx_t_5);
    if (__pyx_t_4) {

      /* "ws_package/utils/hardware_event_validator.py":1138
 * 
 *             if not self._stop_hooks:
 *                 logger.warning("Linux X11 input monitor stopped  restarting in 2s")             # <<<<<<<<<<<<<<
 *                 time.sleep(2.0)
 * 
*/
      __pyx_t_1 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1138, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1138, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_3 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
        assert(__pyx_t_1);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
        __pyx_t_3 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Linux_X11_input_monitor_stopped};
        __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1138, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "ws_package/utils/hardware_event_validator.py":1139
 *             if not self._stop_hooks:
 *                 logger.warning("Linux X11 input monitor stopped  restarting in 2s")
 *                 time.sleep(2.0)             # <<<<<<<<<<<<<<
 * 
 *     def _linux_drain_evdev(self) -> Tuple[bool, bool]:
*/
      __pyx_t_6 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1139, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_sleep); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1139, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_3 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_13);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
        __pyx_t_3 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_float_2_0};
        __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1139, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "ws_package/utils/hardware_event_validator.py":1137
 *                 self._linux_xinput_process = None
 * 
 *             if not self._stop_hooks:             # <<<<<<<<<<<<<<
 *                 logger.warning("Linux X11 input monitor stopped  restarting in 2s")
 *                 time.sleep(2.0)
*/
    }
  }

  /* "ws_package/utils/hardware_event_validator.py":1063
 *         time.sleep(0.3)
 * 
 *     def _linux_xinput_monitor_thread(self):             # <<<<<<<<<<<<<<
 *         """
 *         Parse `xinput test-xi2 --root` to classify XI2 events as hardware vs XTEST.
*/

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_xinput_monitor_thread", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_keyboard_events);
  __Pyx_XDECREF(__pyx_v_mouse_events);
  __Pyx_XDECREF(__pyx_v_xinput_bin);
  __Pyx_XDECREF(__pyx_v_current_event_type);
  __Pyx_XDECREF(__pyx_v_proc);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_v_stripped);
  __Pyx_XDECREF(__pyx_v_event_match);
  __Pyx_XDECREF(__pyx_v_device_match);
  __Pyx_XDECREF(__pyx_v_slave_id);
  __Pyx_XDECREF(__pyx_v_now);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1141
 *                 time.sleep(2.0)
 * 
 *     def _linux_drain_evdev(self) -> Tuple[bool, bool]:             # <<<<<<<<<<<<<<
 *         """Synchronously drain pending evdev events (called when pynput fires)."""
 *         if not self._linux_open_devices:
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_47_linux_drain_evdev(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_46_linux_drain_evdev, "Synchronously drain pending evdev events (called when pynput fires).");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_47_linux_drain_evdev = {"_linux_drain_evdev", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_47_linux_drain_evdev, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_46_linux_drain_evdev};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_47_linux_drain_evdev(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_linux_drain_evdev (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1141, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1141, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_linux_drain_evdev", 0) < (0)) __PYX_ERR(0, 1141, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_linux_drain_evdev", 1, 1, 1, i); __PYX_ERR(0, 1141, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1141, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_linux_drain_evdev", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1141, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_drain_evdev", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_46_linux_drain_evdev(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_46_linux_drain_evdev(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_evdev = NULL;
  PyObject *__pyx_v_ecodes = NULL;
  int __pyx_v_found_keyboard;
  int __pyx_v_found_mouse;
  PyObject *__pyx_v_now = NULL;
  PyObject *__pyx_v_device = NULL;
  PyObject *__pyx_v_event = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  int __pyx_t_22;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  int __pyx_t_25;
  char const *__pyx_t_26;
  PyObject *__pyx_t_27 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_linux_drain_evdev", 0);

  /* "ws_package/utils/hardware_event_validator.py":1143
 *     def _linux_drain_evdev(self) -> Tuple[bool, bool]:
 *         """Synchronously drain pending evdev events (called when pynput fires)."""
 *         if not self._linux_open_devices:             # <<<<<<<<<<<<<<
 *             return False, False
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_open_devices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {

    /* "ws_package/utils/hardware_event_validator.py":1144
 *         """Synchronously drain pending evdev events (called when pynput fires)."""
 *         if not self._linux_open_devices:
 *             return False, False             # <<<<<<<<<<<<<<
 * 
 *         evdev = self._evdev_module
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[6]);
    __pyx_r = __pyx_mstate_global->__pyx_tuple[6];
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1143
 *     def _linux_drain_evdev(self) -> Tuple[bool, bool]:
 *         """Synchronously drain pending evdev events (called when pynput fires)."""
 *         if not self._linux_open_devices:             # <<<<<<<<<<<<<<
 *             return False, False
 * 
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1146
 *             return False, False
 * 
 *         evdev = self._evdev_module             # <<<<<<<<<<<<<<
 *         ecodes = evdev.ecodes
 *         found_keyboard = False
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_evdev_module); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_evdev = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1147
 * 
 *         evdev = self._evdev_module
 *         ecodes = evdev.ecodes             # <<<<<<<<<<<<<<
 *         found_keyboard = False
 *         found_mouse = False
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_evdev, __pyx_mstate_global->__pyx_n_u_ecodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ecodes = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1148
 *         evdev = self._evdev_module
 *         ecodes = evdev.ecodes
 *         found_keyboard = False             # <<<<<<<<<<<<<<
 *         found_mouse = False
 *         now = time.time()
*/
  __pyx_v_found_keyboard = 0;

  /* "ws_package/utils/hardware_event_validator.py":1149
 *         ecodes = evdev.ecodes
 *         found_keyboard = False
 *         found_mouse = False             # <<<<<<<<<<<<<<
 *         now = time.time()
 * 
*/
  __pyx_v_found_mouse = 0;

  /* "ws_package/utils/hardware_event_validator.py":1150
 *         found_keyboard = False
 *         found_mouse = False
 *         now = time.time()             # <<<<<<<<<<<<<<
 * 
 *         for device in self._linux_open_devices:
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_now = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1152
 *         now = time.time()
 * 
 *         for device in self._linux_open_devices:             # <<<<<<<<<<<<<<
 *             try:
 *                 for event in device.read():
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_open_devices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6);
    __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1152, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1152, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_8;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1152, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8));
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8);
        #endif
        ++__pyx_t_8;
      }
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1152, __pyx_L1_error)
    } else {
      __pyx_t_1 = __pyx_t_9(__pyx_t_6);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1152, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_device, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1153
 * 
 *         for device in self._linux_open_devices:
 *             try:             # <<<<<<<<<<<<<<
 *                 for event in device.read():
 *                     with self._linux_lock:
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":1154
 *         for device in self._linux_open_devices:
 *             try:
 *                 for event in device.read():             # <<<<<<<<<<<<<<
 *                     with self._linux_lock:
 *                         if event.type == ecodes.EV_KEY:
*/
        __pyx_t_4 = __pyx_v_device;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_7 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_read, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1154, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4);
          __pyx_t_13 = 0;
          __pyx_t_14 = NULL;
        } else {
          __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1154, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1154, __pyx_L6_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_14)) {
            if (likely(PyList_CheckExact(__pyx_t_4))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1154, __pyx_L6_error)
                #endif
                if (__pyx_t_13 >= __pyx_temp) break;
              }
              __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference);
              ++__pyx_t_13;
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1154, __pyx_L6_error)
                #endif
                if (__pyx_t_13 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13));
              #else
              __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13);
              #endif
              ++__pyx_t_13;
            }
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1154, __pyx_L6_error)
          } else {
            __pyx_t_1 = __pyx_t_14(__pyx_t_4);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1154, __pyx_L6_error)
                PyErr_Clear();
              }
              break;
            }
          }
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_XDECREF_SET(__pyx_v_event, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "ws_package/utils/hardware_event_validator.py":1155
 *             try:
 *                 for event in device.read():
 *                     with self._linux_lock:             # <<<<<<<<<<<<<<
 *                         if event.type == ecodes.EV_KEY:
 *                             found_keyboard = True
*/
          /*with:*/ {
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1155, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_15 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1155, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_15);
            __pyx_t_16 = NULL;
            __pyx_t_17 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1155, __pyx_L16_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_7 = 1;
            #if CYTHON_UNPACK_METHODS
            if (likely(PyMethod_Check(__pyx_t_17))) {
              __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17);
              assert(__pyx_t_16);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_17);
              __Pyx_INCREF(__pyx_t_16);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_17, __pyx__function);
              __pyx_t_7 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_16, NULL};
              __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_17, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
              if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1155, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_5);
            }
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            /*try:*/ {
              {
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
                __Pyx_XGOTREF(__pyx_t_18);
                __Pyx_XGOTREF(__pyx_t_19);
                __Pyx_XGOTREF(__pyx_t_20);
                /*try:*/ {

                  /* "ws_package/utils/hardware_event_validator.py":1156
 *                 for event in device.read():
 *                     with self._linux_lock:
 *                         if event.type == ecodes.EV_KEY:             # <<<<<<<<<<<<<<
 *                             found_keyboard = True
 *                             self._linux_last_evdev_keyboard_ts = now
*/
                  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_mstate_global->__pyx_n_u_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1156, __pyx_L22_error)
                  __Pyx_GOTREF(__pyx_t_1);
                  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ecodes, __pyx_mstate_global->__pyx_n_u_EV_KEY); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1156, __pyx_L22_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  __pyx_t_17 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1156, __pyx_L22_error)
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1156, __pyx_L22_error)
                  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                  if (__pyx_t_3) {

                    /* "ws_package/utils/hardware_event_validator.py":1157
 *                     with self._linux_lock:
 *                         if event.type == ecodes.EV_KEY:
 *                             found_keyboard = True             # <<<<<<<<<<<<<<
 *                             self._linux_last_evdev_keyboard_ts = now
 *                         elif event.type in (ecodes.EV_REL, ecodes.EV_ABS):
*/
                    __pyx_v_found_keyboard = 1;

                    /* "ws_package/utils/hardware_event_validator.py":1158
 *                         if event.type == ecodes.EV_KEY:
 *                             found_keyboard = True
 *                             self._linux_last_evdev_keyboard_ts = now             # <<<<<<<<<<<<<<
 *                         elif event.type in (ecodes.EV_REL, ecodes.EV_ABS):
 *                             found_mouse = True
*/
                    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_evdev_keyboard_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 1158, __pyx_L22_error)

                    /* "ws_package/utils/hardware_event_validator.py":1156
 *                 for event in device.read():
 *                     with self._linux_lock:
 *                         if event.type == ecodes.EV_KEY:             # <<<<<<<<<<<<<<
 *                             found_keyboard = True
 *                             self._linux_last_evdev_keyboard_ts = now
*/
                    goto __pyx_L30;
                  }

                  /* "ws_package/utils/hardware_event_validator.py":1159
 *                             found_keyboard = True
 *                             self._linux_last_evdev_keyboard_ts = now
 *                         elif event.type in (ecodes.EV_REL, ecodes.EV_ABS):             # <<<<<<<<<<<<<<
 *                             found_mouse = True
 *                             self._linux_last_evdev_mouse_ts = now
*/
                  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_mstate_global->__pyx_n_u_type); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1159, __pyx_L22_error)
                  __Pyx_GOTREF(__pyx_t_17);
                  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ecodes, __pyx_mstate_global->__pyx_n_u_EV_REL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L22_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  __pyx_t_1 = PyObject_RichCompare(__pyx_t_17, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1159, __pyx_L22_error)
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1159, __pyx_L22_error)
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  if (!__pyx_t_2) {
                  } else {
                    __pyx_t_3 = __pyx_t_2;
                    goto __pyx_L31_bool_binop_done;
                  }
                  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ecodes, __pyx_mstate_global->__pyx_n_u_EV_ABS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1159, __pyx_L22_error)
                  __Pyx_GOTREF(__pyx_t_1);
                  __pyx_t_5 = PyObject_RichCompare(__pyx_t_17, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L22_error)
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1159, __pyx_L22_error)
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                  __pyx_t_3 = __pyx_t_2;
                  __pyx_L31_bool_binop_done:;
                  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                  __pyx_t_2 = __pyx_t_3;
                  if (__pyx_t_2) {

                    /* "ws_package/utils/hardware_event_validator.py":1160
 *                             self._linux_last_evdev_keyboard_ts = now
 *                         elif event.type in (ecodes.EV_REL, ecodes.EV_ABS):
 *                             found_mouse = True             # <<<<<<<<<<<<<<
 *                             self._linux_last_evdev_mouse_ts = now
 *             except BlockingIOError:
*/
                    __pyx_v_found_mouse = 1;

                    /* "ws_package/utils/hardware_event_validator.py":1161
 *                         elif event.type in (ecodes.EV_REL, ecodes.EV_ABS):
 *                             found_mouse = True
 *                             self._linux_last_evdev_mouse_ts = now             # <<<<<<<<<<<<<<
 *             except BlockingIOError:
 *                 pass
*/
                    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_evdev_mouse_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 1161, __pyx_L22_error)

                    /* "ws_package/utils/hardware_event_validator.py":1159
 *                             found_keyboard = True
 *                             self._linux_last_evdev_keyboard_ts = now
 *                         elif event.type in (ecodes.EV_REL, ecodes.EV_ABS):             # <<<<<<<<<<<<<<
 *                             found_mouse = True
 *                             self._linux_last_evdev_mouse_ts = now
*/
                  }
                  __pyx_L30:;

                  /* "ws_package/utils/hardware_event_validator.py":1155
 *             try:
 *                 for event in device.read():
 *                     with self._linux_lock:             # <<<<<<<<<<<<<<
 *                         if event.type == ecodes.EV_KEY:
 *                             found_keyboard = True
*/
                }
                __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
                __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
                __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
                goto __pyx_L29_try_end;
                __pyx_L22_error:;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
                __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                /*except:*/ {
                  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_drain_evdev", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_17, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 1155, __pyx_L24_except_error)
                  __Pyx_XGOTREF(__pyx_t_17);
                  __Pyx_XGOTREF(__pyx_t_5);
                  __Pyx_XGOTREF(__pyx_t_1);
                  __pyx_t_16 = PyTuple_Pack(3, __pyx_t_17, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1155, __pyx_L24_except_error)
                  __Pyx_GOTREF(__pyx_t_16);
                  __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_16, NULL);
                  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
                  if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1155, __pyx_L24_except_error)
                  __Pyx_GOTREF(__pyx_t_21);
                  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_21);
                  __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                  if (__pyx_t_2 < (0)) __PYX_ERR(0, 1155, __pyx_L24_except_error)
                  __pyx_t_3 = (!__pyx_t_2);
                  if (unlikely(__pyx_t_3)) {
                    __Pyx_GIVEREF(__pyx_t_17);
                    __Pyx_GIVEREF(__pyx_t_5);
                    __Pyx_XGIVEREF(__pyx_t_1);
                    __Pyx_ErrRestoreWithState(__pyx_t_17, __pyx_t_5, __pyx_t_1);
                    __pyx_t_17 = 0;  __pyx_t_5 = 0;  __pyx_t_1 = 0; 
                    __PYX_ERR(0, 1155, __pyx_L24_except_error)
                  }
                  __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
                  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                  goto __pyx_L23_exception_handled;
                }
                __pyx_L24_except_error:;
                __Pyx_XGIVEREF(__pyx_t_18);
                __Pyx_XGIVEREF(__pyx_t_19);
                __Pyx_XGIVEREF(__pyx_t_20);
                __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
                goto __pyx_L6_error;
                __pyx_L23_exception_handled:;
                __Pyx_XGIVEREF(__pyx_t_18);
                __Pyx_XGIVEREF(__pyx_t_19);
                __Pyx_XGIVEREF(__pyx_t_20);
                __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
                __pyx_L29_try_end:;
              }
            }
            /*finally:*/ {
              /*normal exit:*/{
                if (__pyx_t_15) {
                  __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_mstate_global->__pyx_tuple[2], NULL);
                  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                  if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1155, __pyx_L6_error)
                  __Pyx_GOTREF(__pyx_t_20);
                  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
                }
                goto __pyx_L21;
              }
              __pyx_L21:;
            }
            goto __pyx_L36;
            __pyx_L16_error:;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            goto __pyx_L6_error;
            __pyx_L36:;
          }

          /* "ws_package/utils/hardware_event_validator.py":1154
 *         for device in self._linux_open_devices:
 *             try:
 *                 for event in device.read():             # <<<<<<<<<<<<<<
 *                     with self._linux_lock:
 *                         if event.type == ecodes.EV_KEY:
*/
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "ws_package/utils/hardware_event_validator.py":1153
 * 
 *         for device in self._linux_open_devices:
 *             try:             # <<<<<<<<<<<<<<
 *                 for event in device.read():
 *                     with self._linux_lock:
*/
      }
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L13_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "ws_package/utils/hardware_event_validator.py":1162
 *                             found_mouse = True
 *                             self._linux_last_evdev_mouse_ts = now
 *             except BlockingIOError:             # <<<<<<<<<<<<<<
 *                 pass
 *             except OSError as e:
*/
      __pyx_t_22 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_BlockingIOError))));
      if (__pyx_t_22) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L7_exception_handled;
      }

      /* "ws_package/utils/hardware_event_validator.py":1164
 *             except BlockingIOError:
 *                 pass
 *             except OSError as e:             # <<<<<<<<<<<<<<
 *                 logger.debug("Linux evdev read error on %s: %s", device.path, e)
 * 
*/
      __pyx_t_22 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_OSError))));
      if (__pyx_t_22) {
        __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_drain_evdev", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_5) < 0) __PYX_ERR(0, 1164, __pyx_L8_except_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_v_e = __pyx_t_1;
        /*try:*/ {

          /* "ws_package/utils/hardware_event_validator.py":1165
 *                 pass
 *             except OSError as e:
 *                 logger.debug("Linux evdev read error on %s: %s", device.path, e)             # <<<<<<<<<<<<<<
 * 
 *         return found_keyboard, found_mouse
*/
          __pyx_t_16 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_23, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1165, __pyx_L45_error)
          __Pyx_GOTREF(__pyx_t_23);
          __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_23, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 1165, __pyx_L45_error)
          __Pyx_GOTREF(__pyx_t_24);
          __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
          __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_v_device, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1165, __pyx_L45_error)
          __Pyx_GOTREF(__pyx_t_23);
          __pyx_t_7 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_24))) {
            __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_24);
            assert(__pyx_t_16);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_24);
            __Pyx_INCREF(__pyx_t_16);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_24, __pyx__function);
            __pyx_t_7 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[4] = {__pyx_t_16, __pyx_mstate_global->__pyx_kp_u_Linux_evdev_read_error_on_s_s, __pyx_t_23, __pyx_v_e};
            __pyx_t_17 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_24, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
            __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
            if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1165, __pyx_L45_error)
            __Pyx_GOTREF(__pyx_t_17);
          }
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        }

        /* "ws_package/utils/hardware_event_validator.py":1164
 *             except BlockingIOError:
 *                 pass
 *             except OSError as e:             # <<<<<<<<<<<<<<
 *                 logger.debug("Linux evdev read error on %s: %s", device.path, e)
 * 
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            goto __pyx_L46;
          }
          __pyx_L45_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_15 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_21 = 0; __pyx_t_27 = 0;
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
            __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_21, &__pyx_t_27);
            if ( unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_20, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_20, &__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_15);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_27);
            __pyx_t_22 = __pyx_lineno; __pyx_t_25 = __pyx_clineno; __pyx_t_26 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_27);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_21, __pyx_t_27);
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ErrRestore(__pyx_t_15, __pyx_t_20, __pyx_t_19);
            __pyx_t_15 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_21 = 0; __pyx_t_27 = 0;
            __pyx_lineno = __pyx_t_22; __pyx_clineno = __pyx_t_25; __pyx_filename = __pyx_t_26;
            goto __pyx_L8_except_error;
          }
          __pyx_L46:;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L7_exception_handled;
      }
      goto __pyx_L8_except_error;

      /* "ws_package/utils/hardware_event_validator.py":1153
 * 
 *         for device in self._linux_open_devices:
 *             try:             # <<<<<<<<<<<<<<
 *                 for event in device.read():
 *                     with self._linux_lock:
*/
      __pyx_L8_except_error:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      goto __pyx_L1_error;
      __pyx_L7_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      __pyx_L13_try_end:;
    }

    /* "ws_package/utils/hardware_event_validator.py":1152
 *         now = time.time()
 * 
 *         for device in self._linux_open_devices:             # <<<<<<<<<<<<<<
 *             try:
 *                 for event in device.read():
*/
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1167
 *                 logger.debug("Linux evdev read error on %s: %s", device.path, e)
 * 
 *         return found_keyboard, found_mouse             # <<<<<<<<<<<<<<
 * 
 *     def is_enabled(self) -> bool:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_found_keyboard); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_found_mouse); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1167, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 1167, __pyx_L1_error);
  __pyx_t_6 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":1141
 *                 time.sleep(2.0)
 * 
 *     def _linux_drain_evdev(self) -> Tuple[bool, bool]:             # <<<<<<<<<<<<<<
 *         """Synchronously drain pending evdev events (called when pynput fires)."""
 *         if not self._linux_open_devices:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_23);
  __Pyx_XDECREF(__pyx_t_24);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_drain_evdev", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_evdev);
  __Pyx_XDECREF(__pyx_v_ecodes);
  __Pyx_XDECREF(__pyx_v_now);
  __Pyx_XDECREF(__pyx_v_device);
  __Pyx_XDECREF(__pyx_v_event);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1169
 *         return found_keyboard, found_mouse
 * 
 *     def is_enabled(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Returns True if validation is enabled and initialized successfully"""
 *         return self._enabled and self._initialized
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_49is_enabled(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_48is_enabled, "Returns True if validation is enabled and initialized successfully");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_49is_enabled = {"is_enabled", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_49is_enabled, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_48is_enabled};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_49is_enabled(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_enabled (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1169, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "is_enabled", 0) < (0)) __PYX_ERR(0, 1169, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("is_enabled", 1, 1, 1, i); __PYX_ERR(0, 1169, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1169, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_enabled", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1169, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.is_enabled", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_48is_enabled(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_48is_enabled(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_enabled", 0);

  /* "ws_package/utils/hardware_event_validator.py":1171
 *     def is_enabled(self) -> bool:
 *         """Returns True if validation is enabled and initialized successfully"""
 *         return self._enabled and self._initialized             # <<<<<<<<<<<<<<
 * 
 *     def classify_macos_cg_event(self, event) -> Optional[bool]:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_enabled); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1171, __pyx_L1_error)
  if (__pyx_t_3) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":1169
 *         return found_keyboard, found_mouse
 * 
 *     def is_enabled(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Returns True if validation is enabled and initialized successfully"""
 *         return self._enabled and self._initialized
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.is_enabled", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1173
 *         return self._enabled and self._initialized
 * 
 *     def classify_macos_cg_event(self, event) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Classify a macOS Quartz CGEvent as hardware or synthetic.
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_51classify_macos_cg_event(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_50classify_macos_cg_event, "\n        Classify a macOS Quartz CGEvent as hardware or synthetic.\n\n        Returns:\n            True: physical HID (kCGEventSourceStateHIDSystemState)\n            False: software-posted (pyautogui, CGEventPost, automation)\n            None: classification unavailable\n        ");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_51classify_macos_cg_event = {"classify_macos_cg_event", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_51classify_macos_cg_event, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_50classify_macos_cg_event};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_51classify_macos_cg_event(PyObject *__pyx_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_self = 0;
  PyObject *__pyx_v_event = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("classify_macos_cg_event (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_event,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1173, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1173, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1173, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "classify_macos_cg_event", 0) < (0)) __PYX_ERR(0, 1173, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("classify_macos_cg_event", 1, 2, 2, i); __PYX_ERR(0, 1173, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1173, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1173, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("classify_macos_cg_event", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1173, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.classify_macos_cg_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_50classify_macos_cg_event(__pyx_self, __pyx_v_self, __pyx_v_event);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_50classify_macos_cg_event(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event) {
  PyObject *__pyx_v_quartz = NULL;
  PyObject *__pyx_v_source_id = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("classify_macos_cg_event", 0);

  /* "ws_package/utils/hardware_event_validator.py":1182
 *             None: classification unavailable
 *         """
 *         if self._platform != "Darwin":             # <<<<<<<<<<<<<<
 *             return None
 *         try:
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Darwin, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1182, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "ws_package/utils/hardware_event_validator.py":1183
 *         """
 *         if self._platform != "Darwin":
 *             return None             # <<<<<<<<<<<<<<
 *         try:
 *             quartz = self._macos_quartz_module
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1182
 *             None: classification unavailable
 *         """
 *         if self._platform != "Darwin":             # <<<<<<<<<<<<<<
 *             return None
 *         try:
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1184
 *         if self._platform != "Darwin":
 *             return None
 *         try:             # <<<<<<<<<<<<<<
 *             quartz = self._macos_quartz_module
 *             if quartz is None:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":1185
 *             return None
 *         try:
 *             quartz = self._macos_quartz_module             # <<<<<<<<<<<<<<
 *             if quartz is None:
 *                 import Quartz as quartz
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_quartz_module); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_quartz = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "ws_package/utils/hardware_event_validator.py":1186
 *         try:
 *             quartz = self._macos_quartz_module
 *             if quartz is None:             # <<<<<<<<<<<<<<
 *                 import Quartz as quartz
 *             source_id = int(
*/
      __pyx_t_2 = (__pyx_v_quartz == Py_None);
      if (__pyx_t_2) {

        /* "ws_package/utils/hardware_event_validator.py":1187
 *             quartz = self._macos_quartz_module
 *             if quartz is None:
 *                 import Quartz as quartz             # <<<<<<<<<<<<<<
 *             source_id = int(
 *                 quartz.CGEventGetIntegerValueField(
*/
        __pyx_t_6 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_Quartz, 0, 0, NULL, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1187, __pyx_L4_error)
        __pyx_t_1 = __pyx_t_6;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_quartz, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":1186
 *         try:
 *             quartz = self._macos_quartz_module
 *             if quartz is None:             # <<<<<<<<<<<<<<
 *                 import Quartz as quartz
 *             source_id = int(
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1189
 *                 import Quartz as quartz
 *             source_id = int(
 *                 quartz.CGEventGetIntegerValueField(             # <<<<<<<<<<<<<<
 *                     event, quartz.kCGEventSourceStateID
 *                 )
*/
      __pyx_t_7 = __pyx_v_quartz;
      __Pyx_INCREF(__pyx_t_7);

      /* "ws_package/utils/hardware_event_validator.py":1190
 *             source_id = int(
 *                 quartz.CGEventGetIntegerValueField(
 *                     event, quartz.kCGEventSourceStateID             # <<<<<<<<<<<<<<
 *                 )
 *             )
*/
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_quartz, __pyx_mstate_global->__pyx_n_u_kCGEventSourceStateID); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1190, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_event, __pyx_t_8};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_CGEventGetIntegerValueField, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1189, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_1);
      }

      /* "ws_package/utils/hardware_event_validator.py":1188
 *             if quartz is None:
 *                 import Quartz as quartz
 *             source_id = int(             # <<<<<<<<<<<<<<
 *                 quartz.CGEventGetIntegerValueField(
 *                     event, quartz.kCGEventSourceStateID
*/
      __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1188, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_source_id = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;

      /* "ws_package/utils/hardware_event_validator.py":1193
 *                 )
 *             )
 *             if source_id == quartz.kCGEventSourceStateHIDSystemState:             # <<<<<<<<<<<<<<
 *                 return True
 *             return False
*/
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_quartz, __pyx_mstate_global->__pyx_n_u_kCGEventSourceStateHIDSystemStat); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1193, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_source_id, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1193, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1193, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_2) {

        /* "ws_package/utils/hardware_event_validator.py":1194
 *             )
 *             if source_id == quartz.kCGEventSourceStateHIDSystemState:
 *                 return True             # <<<<<<<<<<<<<<
 *             return False
 *         except Exception as e:
*/
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_True);
        __pyx_r = Py_True;
        goto __pyx_L8_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1193
 *                 )
 *             )
 *             if source_id == quartz.kCGEventSourceStateHIDSystemState:             # <<<<<<<<<<<<<<
 *                 return True
 *             return False
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1195
 *             if source_id == quartz.kCGEventSourceStateHIDSystemState:
 *                 return True
 *             return False             # <<<<<<<<<<<<<<
 *         except Exception as e:
 *             logger.debug("macOS CGEvent classification failed: %s", e)
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      goto __pyx_L8_try_return;

      /* "ws_package/utils/hardware_event_validator.py":1184
 *         if self._platform != "Darwin":
 *             return None
 *         try:             # <<<<<<<<<<<<<<
 *             quartz = self._macos_quartz_module
 *             if quartz is None:
*/
    }
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1196
 *                 return True
 *             return False
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.debug("macOS CGEvent classification failed: %s", e)
 *             return None
*/
    __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_10) {
      __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.classify_macos_cg_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_7) < 0) __PYX_ERR(0, 1196, __pyx_L6_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_v_e = __pyx_t_8;
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":1197
 *             return False
 *         except Exception as e:
 *             logger.debug("macOS CGEvent classification failed: %s", e)             # <<<<<<<<<<<<<<
 *             return None
 * 
*/
        __pyx_t_12 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1197, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1197, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_9 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_14);
          assert(__pyx_t_12);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
          __pyx_t_9 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_mstate_global->__pyx_kp_u_macOS_CGEvent_classification_fai, __pyx_v_e};
          __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1197, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "ws_package/utils/hardware_event_validator.py":1198
 *         except Exception as e:
 *             logger.debug("macOS CGEvent classification failed: %s", e)
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def should_count_activity(
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L16_return;
      }

      /* "ws_package/utils/hardware_event_validator.py":1196
 *                 return True
 *             return False
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.debug("macOS CGEvent classification failed: %s", e)
 *             return None
*/
      /*finally:*/ {
        __pyx_L17_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_6 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_10 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_6, __pyx_t_17, __pyx_t_18);
          __pyx_t_6 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L6_except_error;
        }
        __pyx_L16_return: {
          __pyx_t_22 = __pyx_r;
          __pyx_r = 0;
          __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          __pyx_r = __pyx_t_22;
          __pyx_t_22 = 0;
          goto __pyx_L7_except_return;
        }
      }
    }
    goto __pyx_L6_except_error;

    /* "ws_package/utils/hardware_event_validator.py":1184
 *         if self._platform != "Darwin":
 *             return None
 *         try:             # <<<<<<<<<<<<<<
 *             quartz = self._macos_quartz_module
 *             if quartz is None:
*/
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L8_try_return:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L0;
    __pyx_L7_except_return:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L0;
  }

  /* "ws_package/utils/hardware_event_validator.py":1173
 *         return self._enabled and self._initialized
 * 
 *     def classify_macos_cg_event(self, event) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Classify a macOS Quartz CGEvent as hardware or synthetic.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.classify_macos_cg_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_quartz);
  __Pyx_XDECREF(__pyx_v_source_id);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1200
 *             return None
 * 
 *     def should_count_activity(             # <<<<<<<<<<<<<<
 *         self,
 *         is_hardware: Optional[bool],
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_53should_count_activity(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_52should_count_activity, "\n        Decide whether an input event should count as user activity.\n\n        Only confirmed synthetic events (is_hardware is False) are filtered.\n        ");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_53should_count_activity = {"should_count_activity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_53should_count_activity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_52should_count_activity};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_53should_count_activity(PyObject *__pyx_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_self = 0;
  PyObject *__pyx_v_is_hardware = 0;
  PyObject *__pyx_v_input_kind = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("should_count_activity (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_is_hardware,&__pyx_mstate_global->__pyx_n_u_input_kind,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1200, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1200, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1200, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1200, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "should_count_activity", 0) < (0)) __PYX_ERR(0, 1200, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_n_u_input)));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("should_count_activity", 0, 2, 3, i); __PYX_ERR(0, 1200, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1200, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1200, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1200, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_n_u_input)));
    }
    __pyx_v_self = values[0];
    __pyx_v_is_hardware = ((PyObject*)values[1]);
    __pyx_v_input_kind = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("should_count_activity", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1200, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.should_count_activity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_is_hardware), (&PyBool_Type), 1, "is_hardware", 2))) __PYX_ERR(0, 1202, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input_kind), (&PyUnicode_Type), 0, "input_kind", 2))) __PYX_ERR(0, 1203, __pyx_L1_error)
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_52should_count_activity(__pyx_self, __pyx_v_self, __pyx_v_is_hardware, __pyx_v_input_kind);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_52should_count_activity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_is_hardware, PyObject *__pyx_v_input_kind) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("should_count_activity", 0);

  /* "ws_package/utils/hardware_event_validator.py":1210
 *         Only confirmed synthetic events (is_hardware is False) are filtered.
 *         """
 *         if not self.is_enabled():             # <<<<<<<<<<<<<<
 *             return True
 *         if is_hardware is False:
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_enabled, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1210, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (__pyx_t_5) {

    /* "ws_package/utils/hardware_event_validator.py":1211
 *         """
 *         if not self.is_enabled():
 *             return True             # <<<<<<<<<<<<<<
 *         if is_hardware is False:
 *             self.synthetic_events_filtered += 1
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1210
 *         Only confirmed synthetic events (is_hardware is False) are filtered.
 *         """
 *         if not self.is_enabled():             # <<<<<<<<<<<<<<
 *             return True
 *         if is_hardware is False:
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1212
 *         if not self.is_enabled():
 *             return True
 *         if is_hardware is False:             # <<<<<<<<<<<<<<
 *             self.synthetic_events_filtered += 1
 *             logger.info(
*/
  __pyx_t_5 = (__pyx_v_is_hardware == Py_False);
  if (__pyx_t_5) {

    /* "ws_package/utils/hardware_event_validator.py":1213
 *             return True
 *         if is_hardware is False:
 *             self.synthetic_events_filtered += 1             # <<<<<<<<<<<<<<
 *             logger.info(
 *                 "Fake activity ignored: %s input blocked (not counted)",
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_synthetic_events_filtered); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_synthetic_events_filtered, __pyx_t_2) < (0)) __PYX_ERR(0, 1213, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1214
 *         if is_hardware is False:
 *             self.synthetic_events_filtered += 1
 *             logger.info(             # <<<<<<<<<<<<<<
 *                 "Fake activity ignored: %s input blocked (not counted)",
 *                 input_kind,
*/
    __pyx_t_1 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_info); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1216
 *             logger.info(
 *                 "Fake activity ignored: %s input blocked (not counted)",
 *                 input_kind,             # <<<<<<<<<<<<<<
 *             )
 *             self._notify_synthetic_input_filtered(input_kind)
*/
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Fake_activity_ignored_s_input_bl, __pyx_v_input_kind};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1218
 *                 input_kind,
 *             )
 *             self._notify_synthetic_input_filtered(input_kind)             # <<<<<<<<<<<<<<
 *             return False
 *         return True
*/
    __pyx_t_7 = __pyx_v_self;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_input_kind};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_notify_synthetic_input_filtered, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1219
 *             )
 *             self._notify_synthetic_input_filtered(input_kind)
 *             return False             # <<<<<<<<<<<<<<
 *         return True
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1212
 *         if not self.is_enabled():
 *             return True
 *         if is_hardware is False:             # <<<<<<<<<<<<<<
 *             self.synthetic_events_filtered += 1
 *             logger.info(
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1220
 *             self._notify_synthetic_input_filtered(input_kind)
 *             return False
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def should_count_macos_cg_event(self, event, input_kind: str = 'input') -> bool:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":1200
 *             return None
 * 
 *     def should_count_activity(             # <<<<<<<<<<<<<<
 *         self,
 *         is_hardware: Optional[bool],
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.should_count_activity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1222
 *         return True
 * 
 *     def should_count_macos_cg_event(self, event, input_kind: str = 'input') -> bool:             # <<<<<<<<<<<<<<
 *         """Return True when a macOS CGEvent should count toward activity."""
 *         if not self.is_enabled() or not self._macos_direct_validation:
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_55should_count_macos_cg_event(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_54should_count_macos_cg_event, "Return True when a macOS CGEvent should count toward activity.");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_55should_count_macos_cg_event = {"should_count_macos_cg_event", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_55should_count_macos_cg_event, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_54should_count_macos_cg_event};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_55should_count_macos_cg_event(PyObject *__pyx_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_self = 0;
  PyObject *__pyx_v_event = 0;
  PyObject *__pyx_v_input_kind = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("should_count_macos_cg_event (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_event,&__pyx_mstate_global->__pyx_n_u_input_kind,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1222, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1222, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1222, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1222, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "should_count_macos_cg_event", 0) < (0)) __PYX_ERR(0, 1222, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_n_u_input)));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("should_count_macos_cg_event", 0, 2, 3, i); __PYX_ERR(0, 1222, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1222, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1222, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1222, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_n_u_input)));
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
    __pyx_v_input_kind = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("should_count_macos_cg_event", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1222, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.should_count_macos_cg_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input_kind), (&PyUnicode_Type), 0, "input_kind", 2))) __PYX_ERR(0, 1222, __pyx_L1_error)
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_54should_count_macos_cg_event(__pyx_self, __pyx_v_self, __pyx_v_event, __pyx_v_input_kind);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_54should_count_macos_cg_event(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_input_kind) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("should_count_macos_cg_event", 0);

  /* "ws_package/utils/hardware_event_validator.py":1224
 *     def should_count_macos_cg_event(self, event, input_kind: str = 'input') -> bool:
 *         """Return True when a macOS CGEvent should count toward activity."""
 *         if not self.is_enabled() or not self._macos_direct_validation:             # <<<<<<<<<<<<<<
 *             return True
 *         return self.should_count_activity(
*/
  __pyx_t_3 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_enabled, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = (!__pyx_t_5);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_direct_validation); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = (!__pyx_t_6);
  __pyx_t_1 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "ws_package/utils/hardware_event_validator.py":1225
 *         """Return True when a macOS CGEvent should count toward activity."""
 *         if not self.is_enabled() or not self._macos_direct_validation:
 *             return True             # <<<<<<<<<<<<<<
 *         return self.should_count_activity(
 *             self.classify_macos_cg_event(event),
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1224
 *     def should_count_macos_cg_event(self, event, input_kind: str = 'input') -> bool:
 *         """Return True when a macOS CGEvent should count toward activity."""
 *         if not self.is_enabled() or not self._macos_direct_validation:             # <<<<<<<<<<<<<<
 *             return True
 *         return self.should_count_activity(
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1226
 *         if not self.is_enabled() or not self._macos_direct_validation:
 *             return True
 *         return self.should_count_activity(             # <<<<<<<<<<<<<<
 *             self.classify_macos_cg_event(event),
 *             input_kind=input_kind,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_3);

  /* "ws_package/utils/hardware_event_validator.py":1227
 *             return True
 *         return self.should_count_activity(
 *             self.classify_macos_cg_event(event),             # <<<<<<<<<<<<<<
 *             input_kind=input_kind,
 *         )
*/
  __pyx_t_8 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_event};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_classify_macos_cg_event, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }

  /* "ws_package/utils/hardware_event_validator.py":1228
 *         return self.should_count_activity(
 *             self.classify_macos_cg_event(event),
 *             input_kind=input_kind,             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_7};
    __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_input_kind, __pyx_v_input_kind, __pyx_t_8, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1226, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_should_count_activity, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":1222
 *         return True
 * 
 *     def should_count_macos_cg_event(self, event, input_kind: str = 'input') -> bool:             # <<<<<<<<<<<<<<
 *         """Return True when a macOS CGEvent should count toward activity."""
 *         if not self.is_enabled() or not self._macos_direct_validation:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.should_count_macos_cg_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1231
 *         )
 * 
 *     def _notify_synthetic_input_filtered(self, input_kind: str) -> None:             # <<<<<<<<<<<<<<
 *         """Log when fake/scripted input is blocked (throttled)."""
 *         now = time.time()
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_57_notify_synthetic_input_filtered(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_56_notify_synthetic_input_filtered, "Log when fake/scripted input is blocked (throttled).");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_57_notify_synthetic_input_filtered = {"_notify_synthetic_input_filtered", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_57_notify_synthetic_input_filtered, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_56_notify_synthetic_input_filtered};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_57_notify_synthetic_input_filtered(PyObject *__pyx_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_self = 0;
  PyObject *__pyx_v_input_kind = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_notify_synthetic_input_filtered (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_input_kind,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1231, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1231, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1231, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_notify_synthetic_input_filtered", 0) < (0)) __PYX_ERR(0, 1231, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_notify_synthetic_input_filtered", 1, 2, 2, i); __PYX_ERR(0, 1231, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1231, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1231, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_input_kind = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_notify_synthetic_input_filtered", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1231, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._notify_synthetic_input_filtered", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input_kind), (&PyUnicode_Type), 0, "input_kind", 2))) __PYX_ERR(0, 1231, __pyx_L1_error)
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_56_notify_synthetic_input_filtered(__pyx_self, __pyx_v_self, __pyx_v_input_kind);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_56_notify_synthetic_input_filtered(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_kind) {
  PyObject *__pyx_v_now = NULL;
  PyObject *__pyx_v_platform_hint = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_notify_synthetic_input_filtered", 0);

  /* "ws_package/utils/hardware_event_validator.py":1233
 *     def _notify_synthetic_input_filtered(self, input_kind: str) -> None:
 *         """Log when fake/scripted input is blocked (throttled)."""
 *         now = time.time()             # <<<<<<<<<<<<<<
 *         if (now - self._last_synthetic_warning_ts) < self._synthetic_warning_interval:
 *             return
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_now = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1234
 *         """Log when fake/scripted input is blocked (throttled)."""
 *         now = time.time()
 *         if (now - self._last_synthetic_warning_ts) < self._synthetic_warning_interval:             # <<<<<<<<<<<<<<
 *             return
 *         self._last_synthetic_warning_ts = now
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_last_synthetic_warning_ts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyNumber_Subtract(__pyx_v_now, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_synthetic_warning_interval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_6) {

    /* "ws_package/utils/hardware_event_validator.py":1235
 *         now = time.time()
 *         if (now - self._last_synthetic_warning_ts) < self._synthetic_warning_interval:
 *             return             # <<<<<<<<<<<<<<
 *         self._last_synthetic_warning_ts = now
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1234
 *         """Log when fake/scripted input is blocked (throttled)."""
 *         now = time.time()
 *         if (now - self._last_synthetic_warning_ts) < self._synthetic_warning_interval:             # <<<<<<<<<<<<<<
 *             return
 *         self._last_synthetic_warning_ts = now
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1236
 *         if (now - self._last_synthetic_warning_ts) < self._synthetic_warning_interval:
 *             return
 *         self._last_synthetic_warning_ts = now             # <<<<<<<<<<<<<<
 * 
 *         platform_hint = {
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_last_synthetic_warning_ts, __pyx_v_now) < (0)) __PYX_ERR(0, 1236, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":1239
 * 
 *         platform_hint = {
 *             "Darwin": "pyautogui/CGEventPost on macOS",             # <<<<<<<<<<<<<<
 *             "Linux": "pyautogui/xdotool on Linux",
 *             "Windows": "SendInput/AutoHotkey on Windows",
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Darwin, __pyx_mstate_global->__pyx_kp_u_pyautogui_CGEventPost_on_macOS) < (0)) __PYX_ERR(0, 1239, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Linux, __pyx_mstate_global->__pyx_kp_u_pyautogui_xdotool_on_Linux) < (0)) __PYX_ERR(0, 1239, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Windows, __pyx_mstate_global->__pyx_kp_u_SendInput_AutoHotkey_on_Windows) < (0)) __PYX_ERR(0, 1239, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":1242
 *             "Linux": "pyautogui/xdotool on Linux",
 *             "Windows": "SendInput/AutoHotkey on Windows",
 *         }.get(self._platform, "automation tools")             # <<<<<<<<<<<<<<
 * 
 *         logger.warning(
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_t_2, __pyx_t_1, __pyx_mstate_global->__pyx_kp_u_automation_tools); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_platform_hint = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1244
 *         }.get(self._platform, "automation tools")
 * 
 *         logger.warning(             # <<<<<<<<<<<<<<
 *             "Fake activity detected: %s input blocked (not counted). "
 *             "Excluded sources include %s.",
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1248
 *             "Excluded sources include %s.",
 *             input_kind,
 *             platform_hint,             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Fake_activity_detected_s_input_b, __pyx_v_input_kind, __pyx_v_platform_hint};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1231
 *         )
 * 
 *     def _notify_synthetic_input_filtered(self, input_kind: str) -> None:             # <<<<<<<<<<<<<<
 *         """Log when fake/scripted input is blocked (throttled)."""
 *         now = time.time()
*/

  /* 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("ws_package.utils.hardware_event_validator.HardwareEventValidator._notify_synthetic_input_filtered", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_now);
  __Pyx_XDECREF(__pyx_v_platform_hint);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1251
 *         )
 * 
 *     def is_hardware_keyboard_event(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Check if keyboard event is from hardware.
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_59is_hardware_keyboard_event(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_58is_hardware_keyboard_event, "\n        Check if keyboard event is from hardware.\n        \n        Returns:\n            True: Confirmed hardware event (count it)\n            False: Confirmed synthetic event (filter it)\n            None: Unknown/unavailable (ACCEPT and count it - fail-safe)\n        ");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_59is_hardware_keyboard_event = {"is_hardware_keyboard_event", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_59is_hardware_keyboard_event, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_58is_hardware_keyboard_event};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_59is_hardware_keyboard_event(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_hardware_keyboard_event (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1251, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1251, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "is_hardware_keyboard_event", 0) < (0)) __PYX_ERR(0, 1251, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("is_hardware_keyboard_event", 1, 1, 1, i); __PYX_ERR(0, 1251, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1251, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_hardware_keyboard_event", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1251, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.is_hardware_keyboard_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_58is_hardware_keyboard_event(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_58is_hardware_keyboard_event(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_hardware_keyboard_event", 0);

  /* "ws_package/utils/hardware_event_validator.py":1260
 *             None: Unknown/unavailable (ACCEPT and count it - fail-safe)
 *         """
 *         if not self.is_enabled():             # <<<<<<<<<<<<<<
 *             return None  # Fail-safe: accept event
 * 
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_enabled, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1260, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (__pyx_t_5) {

    /* "ws_package/utils/hardware_event_validator.py":1261
 *         """
 *         if not self.is_enabled():
 *             return None  # Fail-safe: accept event             # <<<<<<<<<<<<<<
 * 
 *         try:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1260
 *             None: Unknown/unavailable (ACCEPT and count it - fail-safe)
 *         """
 *         if not self.is_enabled():             # <<<<<<<<<<<<<<
 *             return None  # Fail-safe: accept event
 * 
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1263
 *             return None  # Fail-safe: accept event
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self._platform == "Windows":
 *                 return self._check_windows_keyboard()
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":1264
 * 
 *         try:
 *             if self._platform == "Windows":             # <<<<<<<<<<<<<<
 *                 return self._check_windows_keyboard()
 *             elif self._platform == "Darwin":
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1264, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Windows, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1264, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_5) {

        /* "ws_package/utils/hardware_event_validator.py":1265
 *         try:
 *             if self._platform == "Windows":
 *                 return self._check_windows_keyboard()             # <<<<<<<<<<<<<<
 *             elif self._platform == "Darwin":
 *                 return self._check_macos_keyboard()
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __pyx_v_self;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_check_windows_keyboard, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        if (!(likely(PyBool_Check(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bool", __pyx_t_1))) __PYX_ERR(0, 1265, __pyx_L4_error)
        __pyx_r = ((PyObject*)__pyx_t_1);
        __pyx_t_1 = 0;
        goto __pyx_L8_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1264
 * 
 *         try:
 *             if self._platform == "Windows":             # <<<<<<<<<<<<<<
 *                 return self._check_windows_keyboard()
 *             elif self._platform == "Darwin":
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1266
 *             if self._platform == "Windows":
 *                 return self._check_windows_keyboard()
 *             elif self._platform == "Darwin":             # <<<<<<<<<<<<<<
 *                 return self._check_macos_keyboard()
 *             elif self._platform == "Linux":
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1266, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Darwin, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1266, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_5) {

        /* "ws_package/utils/hardware_event_validator.py":1267
 *                 return self._check_windows_keyboard()
 *             elif self._platform == "Darwin":
 *                 return self._check_macos_keyboard()             # <<<<<<<<<<<<<<
 *             elif self._platform == "Linux":
 *                 return self._check_linux_keyboard()
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __pyx_v_self;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_check_macos_keyboard, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1267, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        if (!(likely(PyBool_Check(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bool", __pyx_t_1))) __PYX_ERR(0, 1267, __pyx_L4_error)
        __pyx_r = ((PyObject*)__pyx_t_1);
        __pyx_t_1 = 0;
        goto __pyx_L8_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1266
 *             if self._platform == "Windows":
 *                 return self._check_windows_keyboard()
 *             elif self._platform == "Darwin":             # <<<<<<<<<<<<<<
 *                 return self._check_macos_keyboard()
 *             elif self._platform == "Linux":
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1268
 *             elif self._platform == "Darwin":
 *                 return self._check_macos_keyboard()
 *             elif self._platform == "Linux":             # <<<<<<<<<<<<<<
 *                 return self._check_linux_keyboard()
 *         except Exception as e:
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1268, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Linux, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1268, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_5) {

        /* "ws_package/utils/hardware_event_validator.py":1269
 *                 return self._check_macos_keyboard()
 *             elif self._platform == "Linux":
 *                 return self._check_linux_keyboard()             # <<<<<<<<<<<<<<
 *         except Exception as e:
 *             logger.debug("Hardware validation error (accepting event): %s", e)
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __pyx_v_self;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_check_linux_keyboard, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1269, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        if (!(likely(PyBool_Check(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bool", __pyx_t_1))) __PYX_ERR(0, 1269, __pyx_L4_error)
        __pyx_r = ((PyObject*)__pyx_t_1);
        __pyx_t_1 = 0;
        goto __pyx_L8_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1268
 *             elif self._platform == "Darwin":
 *                 return self._check_macos_keyboard()
 *             elif self._platform == "Linux":             # <<<<<<<<<<<<<<
 *                 return self._check_linux_keyboard()
 *         except Exception as e:
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1263
 *             return None  # Fail-safe: accept event
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self._platform == "Windows":
 *                 return self._check_windows_keyboard()
*/
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1270
 *             elif self._platform == "Linux":
 *                 return self._check_linux_keyboard()
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.debug("Hardware validation error (accepting event): %s", e)
 *             return None  # Fail-safe: accept event
*/
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_9) {
      __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.is_hardware_keyboard_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_10) < 0) __PYX_ERR(0, 1270, __pyx_L6_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_v_e = __pyx_t_2;
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":1271
 *                 return self._check_linux_keyboard()
 *         except Exception as e:
 *             logger.debug("Hardware validation error (accepting event): %s", e)             # <<<<<<<<<<<<<<
 *             return None  # Fail-safe: accept event
 * 
*/
        __pyx_t_12 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1271, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1271, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_3 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_14);
          assert(__pyx_t_12);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
          __pyx_t_3 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_mstate_global->__pyx_kp_u_Hardware_validation_error_accept, __pyx_v_e};
          __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1271, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "ws_package/utils/hardware_event_validator.py":1272
 *         except Exception as e:
 *             logger.debug("Hardware validation error (accepting event): %s", e)
 *             return None  # Fail-safe: accept event             # <<<<<<<<<<<<<<
 * 
 *         return None  # Unknown platform or error
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L15_return;
      }

      /* "ws_package/utils/hardware_event_validator.py":1270
 *             elif self._platform == "Linux":
 *                 return self._check_linux_keyboard()
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.debug("Hardware validation error (accepting event): %s", e)
 *             return None  # Fail-safe: accept event
*/
      /*finally:*/ {
        __pyx_L16_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ( unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_9 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L6_except_error;
        }
        __pyx_L15_return: {
          __pyx_t_23 = __pyx_r;
          __pyx_r = 0;
          __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          __pyx_r = __pyx_t_23;
          __pyx_t_23 = 0;
          goto __pyx_L7_except_return;
        }
      }
    }
    goto __pyx_L6_except_error;

    /* "ws_package/utils/hardware_event_validator.py":1263
 *             return None  # Fail-safe: accept event
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self._platform == "Windows":
 *                 return self._check_windows_keyboard()
*/
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L8_try_return:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L0;
    __pyx_L7_except_return:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L0;
    __pyx_L9_try_end:;
  }

  /* "ws_package/utils/hardware_event_validator.py":1274
 *             return None  # Fail-safe: accept event
 * 
 *         return None  # Unknown platform or error             # <<<<<<<<<<<<<<
 * 
 *     def drain_windows_keyboard_events(self) -> list:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":1251
 *         )
 * 
 *     def is_hardware_keyboard_event(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Check if keyboard event is from hardware.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.is_hardware_keyboard_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1276
 *         return None  # Unknown platform or error
 * 
 *     def drain_windows_keyboard_events(self) -> list:             # <<<<<<<<<<<<<<
 *         """
 *         Return and clear queued Windows keyboard edges.
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_61drain_windows_keyboard_events(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_60drain_windows_keyboard_events, "\n        Return and clear queued Windows keyboard edges.\n\n        Each event contains vk_code, is_down/is_up, injected and timestamp.\n        The consumer must ignore repeated key-down messages until the matching\n        key-up; Windows emits repeated WM_KEYDOWN while a key is held.\n        ");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_61drain_windows_keyboard_events = {"drain_windows_keyboard_events", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_61drain_windows_keyboard_events, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_60drain_windows_keyboard_events};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_61drain_windows_keyboard_events(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("drain_windows_keyboard_events (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1276, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1276, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "drain_windows_keyboard_events", 0) < (0)) __PYX_ERR(0, 1276, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("drain_windows_keyboard_events", 1, 1, 1, i); __PYX_ERR(0, 1276, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1276, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("drain_windows_keyboard_events", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1276, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.drain_windows_keyboard_events", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_60drain_windows_keyboard_events(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_60drain_windows_keyboard_events(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_events = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_t_21;
  char const *__pyx_t_22;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("drain_windows_keyboard_events", 0);

  /* "ws_package/utils/hardware_event_validator.py":1285
 *         """
 *         if (
 *             not self.is_enabled()             # <<<<<<<<<<<<<<
 *             or self._platform != "Windows"
 *             or not hasattr(self, "_windows_lock")
*/
  __pyx_t_3 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_enabled, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1285, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = (!__pyx_t_5);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }

  /* "ws_package/utils/hardware_event_validator.py":1286
 *         if (
 *             not self.is_enabled()
 *             or self._platform != "Windows"             # <<<<<<<<<<<<<<
 *             or not hasattr(self, "_windows_lock")
 *         ):
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Windows, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }

  /* "ws_package/utils/hardware_event_validator.py":1287
 *             not self.is_enabled()
 *             or self._platform != "Windows"
 *             or not hasattr(self, "_windows_lock")             # <<<<<<<<<<<<<<
 *         ):
 *             return []
*/
  __pyx_t_6 = __Pyx_HasAttr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_lock); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1287, __pyx_L1_error)
  __pyx_t_5 = (!__pyx_t_6);
  __pyx_t_1 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;

  /* "ws_package/utils/hardware_event_validator.py":1284
 *         key-up; Windows emits repeated WM_KEYDOWN while a key is held.
 *         """
 *         if (             # <<<<<<<<<<<<<<
 *             not self.is_enabled()
 *             or self._platform != "Windows"
*/
  if (__pyx_t_1) {

    /* "ws_package/utils/hardware_event_validator.py":1289
 *             or not hasattr(self, "_windows_lock")
 *         ):
 *             return []             # <<<<<<<<<<<<<<
 *         try:
 *             with self._windows_lock:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1284
 *         key-up; Windows emits repeated WM_KEYDOWN while a key is held.
 *         """
 *         if (             # <<<<<<<<<<<<<<
 *             not self.is_enabled()
 *             or self._platform != "Windows"
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1290
 *         ):
 *             return []
 *         try:             # <<<<<<<<<<<<<<
 *             with self._windows_lock:
 *                 events = list(self._windows_keyboard_events)
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":1291
 *             return []
 *         try:
 *             with self._windows_lock:             # <<<<<<<<<<<<<<
 *                 events = list(self._windows_keyboard_events)
 *                 self._windows_keyboard_events.clear()
*/
      /*with:*/ {
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1291, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1291, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = NULL;
        __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1291, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_4 = 1;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
          assert(__pyx_t_11);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
          __pyx_t_4 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
          __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        /*try:*/ {
          {
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
            __Pyx_XGOTREF(__pyx_t_13);
            __Pyx_XGOTREF(__pyx_t_14);
            __Pyx_XGOTREF(__pyx_t_15);
            /*try:*/ {

              /* "ws_package/utils/hardware_event_validator.py":1292
 *         try:
 *             with self._windows_lock:
 *                 events = list(self._windows_keyboard_events)             # <<<<<<<<<<<<<<
 *                 self._windows_keyboard_events.clear()
 *             return events
*/
              __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_keyboard_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1292, __pyx_L17_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_3 = __Pyx_PySequence_ListKeepNew(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1292, __pyx_L17_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_v_events = ((PyObject*)__pyx_t_3);
              __pyx_t_3 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1293
 *             with self._windows_lock:
 *                 events = list(self._windows_keyboard_events)
 *                 self._windows_keyboard_events.clear()             # <<<<<<<<<<<<<<
 *             return events
 *         except Exception as e:
*/
              __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_keyboard_events); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1293, __pyx_L17_error)
              __Pyx_GOTREF(__pyx_t_12);
              __pyx_t_2 = __pyx_t_12;
              __Pyx_INCREF(__pyx_t_2);
              __pyx_t_4 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
                __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1293, __pyx_L17_error)
                __Pyx_GOTREF(__pyx_t_3);
              }
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1291
 *             return []
 *         try:
 *             with self._windows_lock:             # <<<<<<<<<<<<<<
 *                 events = list(self._windows_keyboard_events)
 *                 self._windows_keyboard_events.clear()
*/
            }
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            goto __pyx_L22_try_end;
            __pyx_L17_error:;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            /*except:*/ {
              __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.drain_windows_keyboard_events", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_12, &__pyx_t_2) < 0) __PYX_ERR(0, 1291, __pyx_L19_except_error)
              __Pyx_XGOTREF(__pyx_t_3);
              __Pyx_XGOTREF(__pyx_t_12);
              __Pyx_XGOTREF(__pyx_t_2);
              __pyx_t_11 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_12, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1291, __pyx_L19_except_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1291, __pyx_L19_except_error)
              __Pyx_GOTREF(__pyx_t_16);
              __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_16);
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
              if (__pyx_t_1 < (0)) __PYX_ERR(0, 1291, __pyx_L19_except_error)
              __pyx_t_5 = (!__pyx_t_1);
              if (unlikely(__pyx_t_5)) {
                __Pyx_GIVEREF(__pyx_t_3);
                __Pyx_GIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_2);
                __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_12, __pyx_t_2);
                __pyx_t_3 = 0;  __pyx_t_12 = 0;  __pyx_t_2 = 0; 
                __PYX_ERR(0, 1291, __pyx_L19_except_error)
              }
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              goto __pyx_L18_exception_handled;
            }
            __pyx_L19_except_error:;
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
            goto __pyx_L7_error;
            __pyx_L18_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
            __pyx_L22_try_end:;
          }
        }
        /*finally:*/ {
          /*normal exit:*/{
            if (__pyx_t_10) {
              __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[2], NULL);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1291, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_15);
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            }
            goto __pyx_L16;
          }
          __pyx_L16:;
        }
        goto __pyx_L26;
        __pyx_L13_error:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L7_error;
        __pyx_L26:;
      }

      /* "ws_package/utils/hardware_event_validator.py":1294
 *                 events = list(self._windows_keyboard_events)
 *                 self._windows_keyboard_events.clear()
 *             return events             # <<<<<<<<<<<<<<
 *         except Exception as e:
 *             logger.debug("Could not drain Windows keyboard events: %s", e)
*/
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_events)) { __Pyx_RaiseUnboundLocalError("events"); __PYX_ERR(0, 1294, __pyx_L7_error) }
      __Pyx_INCREF(__pyx_v_events);
      __pyx_r = __pyx_v_events;
      goto __pyx_L11_try_return;

      /* "ws_package/utils/hardware_event_validator.py":1290
 *         ):
 *             return []
 *         try:             # <<<<<<<<<<<<<<
 *             with self._windows_lock:
 *                 events = list(self._windows_keyboard_events)
*/
    }
    __pyx_L7_error:;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1295
 *                 self._windows_keyboard_events.clear()
 *             return events
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.debug("Could not drain Windows keyboard events: %s", e)
 *             return []
*/
    __pyx_t_17 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_17) {
      __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.drain_windows_keyboard_events", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_12, &__pyx_t_3) < 0) __PYX_ERR(0, 1295, __pyx_L9_except_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_12);
      __pyx_v_e = __pyx_t_12;
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":1296
 *             return events
 *         except Exception as e:
 *             logger.debug("Could not drain Windows keyboard events: %s", e)             # <<<<<<<<<<<<<<
 *             return []
 * 
*/
        __pyx_t_18 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1296, __pyx_L32_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1296, __pyx_L32_error)
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_4 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_20))) {
          __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_20);
          assert(__pyx_t_18);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_20);
          __Pyx_INCREF(__pyx_t_18);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_20, __pyx__function);
          __pyx_t_4 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_18, __pyx_mstate_global->__pyx_kp_u_Could_not_drain_Windows_keyboard, __pyx_v_e};
          __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_20, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1296, __pyx_L32_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "ws_package/utils/hardware_event_validator.py":1297
 *         except Exception as e:
 *             logger.debug("Could not drain Windows keyboard events: %s", e)
 *             return []             # <<<<<<<<<<<<<<
 * 
 *     def is_hardware_scroll_event(self) -> Optional[bool]:
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1297, __pyx_L32_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_r = ((PyObject*)__pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L31_return;
      }

      /* "ws_package/utils/hardware_event_validator.py":1295
 *                 self._windows_keyboard_events.clear()
 *             return events
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.debug("Could not drain Windows keyboard events: %s", e)
 *             return []
*/
      /*finally:*/ {
        __pyx_L32_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_10 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_16 = 0; __pyx_t_23 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_16, &__pyx_t_23);
          if ( unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_15, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_15, &__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_23);
          __pyx_t_17 = __pyx_lineno; __pyx_t_21 = __pyx_clineno; __pyx_t_22 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_23);
          __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_16, __pyx_t_23);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_ErrRestore(__pyx_t_10, __pyx_t_15, __pyx_t_14);
          __pyx_t_10 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_16 = 0; __pyx_t_23 = 0;
          __pyx_lineno = __pyx_t_17; __pyx_clineno = __pyx_t_21; __pyx_filename = __pyx_t_22;
          goto __pyx_L9_except_error;
        }
        __pyx_L31_return: {
          __pyx_t_24 = __pyx_r;
          __pyx_r = 0;
          __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          __pyx_r = __pyx_t_24;
          __pyx_t_24 = 0;
          goto __pyx_L10_except_return;
        }
      }
    }
    goto __pyx_L9_except_error;

    /* "ws_package/utils/hardware_event_validator.py":1290
 *         ):
 *             return []
 *         try:             # <<<<<<<<<<<<<<
 *             with self._windows_lock:
 *                 events = list(self._windows_keyboard_events)
*/
    __pyx_L9_except_error:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    goto __pyx_L1_error;
    __pyx_L11_try_return:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    goto __pyx_L0;
    __pyx_L10_except_return:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    goto __pyx_L0;
  }

  /* "ws_package/utils/hardware_event_validator.py":1276
 *         return None  # Unknown platform or error
 * 
 *     def drain_windows_keyboard_events(self) -> list:             # <<<<<<<<<<<<<<
 *         """
 *         Return and clear queued Windows keyboard edges.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.drain_windows_keyboard_events", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_events);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1299
 *             return []
 * 
 *     def is_hardware_scroll_event(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """Check if a scroll/wheel event is from hardware (Windows wheel-aware)."""
 *         if not self.is_enabled():
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_63is_hardware_scroll_event(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_62is_hardware_scroll_event, "Check if a scroll/wheel event is from hardware (Windows wheel-aware).");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_63is_hardware_scroll_event = {"is_hardware_scroll_event", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_63is_hardware_scroll_event, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_62is_hardware_scroll_event};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_63is_hardware_scroll_event(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_hardware_scroll_event (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1299, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1299, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "is_hardware_scroll_event", 0) < (0)) __PYX_ERR(0, 1299, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("is_hardware_scroll_event", 1, 1, 1, i); __PYX_ERR(0, 1299, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1299, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_hardware_scroll_event", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1299, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.is_hardware_scroll_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_62is_hardware_scroll_event(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_62is_hardware_scroll_event(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_hardware_scroll_event", 0);

  /* "ws_package/utils/hardware_event_validator.py":1301
 *     def is_hardware_scroll_event(self) -> Optional[bool]:
 *         """Check if a scroll/wheel event is from hardware (Windows wheel-aware)."""
 *         if not self.is_enabled():             # <<<<<<<<<<<<<<
 *             return None
 *         try:
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_enabled, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1301, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (__pyx_t_5) {

    /* "ws_package/utils/hardware_event_validator.py":1302
 *         """Check if a scroll/wheel event is from hardware (Windows wheel-aware)."""
 *         if not self.is_enabled():
 *             return None             # <<<<<<<<<<<<<<
 *         try:
 *             if self._platform == "Windows":
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1301
 *     def is_hardware_scroll_event(self) -> Optional[bool]:
 *         """Check if a scroll/wheel event is from hardware (Windows wheel-aware)."""
 *         if not self.is_enabled():             # <<<<<<<<<<<<<<
 *             return None
 *         try:
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1303
 *         if not self.is_enabled():
 *             return None
 *         try:             # <<<<<<<<<<<<<<
 *             if self._platform == "Windows":
 *                 return self._check_windows_scroll()
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":1304
 *             return None
 *         try:
 *             if self._platform == "Windows":             # <<<<<<<<<<<<<<
 *                 return self._check_windows_scroll()
 *             return self.is_hardware_mouse_event()
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Windows, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1304, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_5) {

        /* "ws_package/utils/hardware_event_validator.py":1305
 *         try:
 *             if self._platform == "Windows":
 *                 return self._check_windows_scroll()             # <<<<<<<<<<<<<<
 *             return self.is_hardware_mouse_event()
 *         except Exception as e:
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __pyx_v_self;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_check_windows_scroll, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1305, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        if (!(likely(PyBool_Check(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bool", __pyx_t_1))) __PYX_ERR(0, 1305, __pyx_L4_error)
        __pyx_r = ((PyObject*)__pyx_t_1);
        __pyx_t_1 = 0;
        goto __pyx_L8_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1304
 *             return None
 *         try:
 *             if self._platform == "Windows":             # <<<<<<<<<<<<<<
 *                 return self._check_windows_scroll()
 *             return self.is_hardware_mouse_event()
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1306
 *             if self._platform == "Windows":
 *                 return self._check_windows_scroll()
 *             return self.is_hardware_mouse_event()             # <<<<<<<<<<<<<<
 *         except Exception as e:
 *             logger.debug("Hardware scroll validation error (accepting event): %s", e)
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __pyx_v_self;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_hardware_mouse_event, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1306, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      if (!(likely(PyBool_Check(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bool", __pyx_t_1))) __PYX_ERR(0, 1306, __pyx_L4_error)
      __pyx_r = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L8_try_return;

      /* "ws_package/utils/hardware_event_validator.py":1303
 *         if not self.is_enabled():
 *             return None
 *         try:             # <<<<<<<<<<<<<<
 *             if self._platform == "Windows":
 *                 return self._check_windows_scroll()
*/
    }
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1307
 *                 return self._check_windows_scroll()
 *             return self.is_hardware_mouse_event()
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.debug("Hardware scroll validation error (accepting event): %s", e)
 *             return None
*/
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_9) {
      __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.is_hardware_scroll_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_10) < 0) __PYX_ERR(0, 1307, __pyx_L6_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_v_e = __pyx_t_2;
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":1308
 *             return self.is_hardware_mouse_event()
 *         except Exception as e:
 *             logger.debug("Hardware scroll validation error (accepting event): %s", e)             # <<<<<<<<<<<<<<
 *             return None
 * 
*/
        __pyx_t_12 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1308, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1308, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_3 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_14);
          assert(__pyx_t_12);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
          __pyx_t_3 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_mstate_global->__pyx_kp_u_Hardware_scroll_validation_error, __pyx_v_e};
          __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1308, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "ws_package/utils/hardware_event_validator.py":1309
 *         except Exception as e:
 *             logger.debug("Hardware scroll validation error (accepting event): %s", e)
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def get_last_hw_scroll_timestamp(self) -> float:
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L15_return;
      }

      /* "ws_package/utils/hardware_event_validator.py":1307
 *                 return self._check_windows_scroll()
 *             return self.is_hardware_mouse_event()
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.debug("Hardware scroll validation error (accepting event): %s", e)
 *             return None
*/
      /*finally:*/ {
        __pyx_L16_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ( unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_9 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L6_except_error;
        }
        __pyx_L15_return: {
          __pyx_t_23 = __pyx_r;
          __pyx_r = 0;
          __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          __pyx_r = __pyx_t_23;
          __pyx_t_23 = 0;
          goto __pyx_L7_except_return;
        }
      }
    }
    goto __pyx_L6_except_error;

    /* "ws_package/utils/hardware_event_validator.py":1303
 *         if not self.is_enabled():
 *             return None
 *         try:             # <<<<<<<<<<<<<<
 *             if self._platform == "Windows":
 *                 return self._check_windows_scroll()
*/
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L8_try_return:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L0;
    __pyx_L7_except_return:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L0;
  }

  /* "ws_package/utils/hardware_event_validator.py":1299
 *             return []
 * 
 *     def is_hardware_scroll_event(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """Check if a scroll/wheel event is from hardware (Windows wheel-aware)."""
 *         if not self.is_enabled():
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.is_hardware_scroll_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1311
 *             return None
 * 
 *     def get_last_hw_scroll_timestamp(self) -> float:             # <<<<<<<<<<<<<<
 *         """Unix timestamp of the last physical scroll Raw Input event (Windows only)."""
 *         if not self.is_enabled() or self._platform != "Windows":
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_65get_last_hw_scroll_timestamp(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_64get_last_hw_scroll_timestamp, "Unix timestamp of the last physical scroll Raw Input event (Windows only).");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_65get_last_hw_scroll_timestamp = {"get_last_hw_scroll_timestamp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_65get_last_hw_scroll_timestamp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_64get_last_hw_scroll_timestamp};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_65get_last_hw_scroll_timestamp(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_last_hw_scroll_timestamp (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1311, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1311, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_last_hw_scroll_timestamp", 0) < (0)) __PYX_ERR(0, 1311, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_last_hw_scroll_timestamp", 1, 1, 1, i); __PYX_ERR(0, 1311, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1311, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_last_hw_scroll_timestamp", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1311, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.get_last_hw_scroll_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_64get_last_hw_scroll_timestamp(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_64get_last_hw_scroll_timestamp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_last_hw_scroll_timestamp", 0);

  /* "ws_package/utils/hardware_event_validator.py":1313
 *     def get_last_hw_scroll_timestamp(self) -> float:
 *         """Unix timestamp of the last physical scroll Raw Input event (Windows only)."""
 *         if not self.is_enabled() or self._platform != "Windows":             # <<<<<<<<<<<<<<
 *             return 0.0
 *         with self._windows_lock:
*/
  __pyx_t_3 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_enabled, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1313, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = (!__pyx_t_5);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Windows, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1313, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "ws_package/utils/hardware_event_validator.py":1314
 *         """Unix timestamp of the last physical scroll Raw Input event (Windows only)."""
 *         if not self.is_enabled() or self._platform != "Windows":
 *             return 0.0             # <<<<<<<<<<<<<<
 *         with self._windows_lock:
 *             return float(self._windows_last_hw_scroll_ts)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_float_0_0);
    __pyx_r = __pyx_mstate_global->__pyx_float_0_0;
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1313
 *     def get_last_hw_scroll_timestamp(self) -> float:
 *         """Unix timestamp of the last physical scroll Raw Input event (Windows only)."""
 *         if not self.is_enabled() or self._platform != "Windows":             # <<<<<<<<<<<<<<
 *             return 0.0
 *         with self._windows_lock:
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1315
 *         if not self.is_enabled() or self._platform != "Windows":
 *             return 0.0
 *         with self._windows_lock:             # <<<<<<<<<<<<<<
 *             return float(self._windows_last_hw_scroll_ts)
 * 
*/
  /*with:*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1315, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
      assert(__pyx_t_8);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1315, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        /*try:*/ {

          /* "ws_package/utils/hardware_event_validator.py":1316
 *             return 0.0
 *         with self._windows_lock:
 *             return float(self._windows_last_hw_scroll_ts)             # <<<<<<<<<<<<<<
 * 
 *     def is_hardware_mouse_event(self) -> Optional[bool]:
*/
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_hw_scroll_ts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1316, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1316, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_r = __pyx_t_3;
          __pyx_t_3 = 0;
          goto __pyx_L14_try_return;

          /* "ws_package/utils/hardware_event_validator.py":1315
 *         if not self.is_enabled() or self._platform != "Windows":
 *             return 0.0
 *         with self._windows_lock:             # <<<<<<<<<<<<<<
 *             return float(self._windows_last_hw_scroll_ts)
 * 
*/
        }
        __pyx_L10_error:;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.get_last_hw_scroll_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_9) < 0) __PYX_ERR(0, 1315, __pyx_L12_except_error)
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_9);
          __pyx_t_8 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1315, __pyx_L12_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1315, __pyx_L12_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (__pyx_t_1 < (0)) __PYX_ERR(0, 1315, __pyx_L12_except_error)
          __pyx_t_6 = (!__pyx_t_1);
          if (unlikely(__pyx_t_6)) {
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_2, __pyx_t_9);
            __pyx_t_3 = 0;  __pyx_t_2 = 0;  __pyx_t_9 = 0; 
            __PYX_ERR(0, 1315, __pyx_L12_except_error)
          }
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L11_exception_handled;
        }
        __pyx_L12_except_error:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        goto __pyx_L1_error;
        __pyx_L14_try_return:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        goto __pyx_L7_return;
        __pyx_L11_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_7) {
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[2], NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1315, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        goto __pyx_L9;
      }
      __pyx_L7_return: {
        __pyx_t_12 = __pyx_r;
        __pyx_r = 0;
        if (__pyx_t_7) {
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[2], NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1315, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        __pyx_r = __pyx_t_12;
        __pyx_t_12 = 0;
        goto __pyx_L0;
      }
      __pyx_L9:;
    }
    goto __pyx_L19;
    __pyx_L6_error:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L1_error;
    __pyx_L19:;
  }

  /* "ws_package/utils/hardware_event_validator.py":1311
 *             return None
 * 
 *     def get_last_hw_scroll_timestamp(self) -> float:             # <<<<<<<<<<<<<<
 *         """Unix timestamp of the last physical scroll Raw Input event (Windows only)."""
 *         if not self.is_enabled() or self._platform != "Windows":
*/

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.get_last_hw_scroll_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1318
 *             return float(self._windows_last_hw_scroll_ts)
 * 
 *     def is_hardware_mouse_event(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Check if mouse event is from hardware.
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_67is_hardware_mouse_event(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_66is_hardware_mouse_event, "\n        Check if mouse event is from hardware.\n        \n        Returns:\n            True: Confirmed hardware event (count it)\n            False: Confirmed synthetic event (filter it)\n            None: Unknown/unavailable (ACCEPT and count it - fail-safe)\n        ");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_67is_hardware_mouse_event = {"is_hardware_mouse_event", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_67is_hardware_mouse_event, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_66is_hardware_mouse_event};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_67is_hardware_mouse_event(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_hardware_mouse_event (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1318, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1318, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "is_hardware_mouse_event", 0) < (0)) __PYX_ERR(0, 1318, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("is_hardware_mouse_event", 1, 1, 1, i); __PYX_ERR(0, 1318, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1318, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_hardware_mouse_event", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1318, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.is_hardware_mouse_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_66is_hardware_mouse_event(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_66is_hardware_mouse_event(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_hardware_mouse_event", 0);

  /* "ws_package/utils/hardware_event_validator.py":1327
 *             None: Unknown/unavailable (ACCEPT and count it - fail-safe)
 *         """
 *         if not self.is_enabled():             # <<<<<<<<<<<<<<
 *             return None  # Fail-safe: accept event
 * 
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_enabled, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (__pyx_t_5) {

    /* "ws_package/utils/hardware_event_validator.py":1328
 *         """
 *         if not self.is_enabled():
 *             return None  # Fail-safe: accept event             # <<<<<<<<<<<<<<
 * 
 *         try:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1327
 *             None: Unknown/unavailable (ACCEPT and count it - fail-safe)
 *         """
 *         if not self.is_enabled():             # <<<<<<<<<<<<<<
 *             return None  # Fail-safe: accept event
 * 
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1330
 *             return None  # Fail-safe: accept event
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self._platform == "Windows":
 *                 return self._check_windows_mouse()
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":1331
 * 
 *         try:
 *             if self._platform == "Windows":             # <<<<<<<<<<<<<<
 *                 return self._check_windows_mouse()
 *             elif self._platform == "Darwin":
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Windows, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1331, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_5) {

        /* "ws_package/utils/hardware_event_validator.py":1332
 *         try:
 *             if self._platform == "Windows":
 *                 return self._check_windows_mouse()             # <<<<<<<<<<<<<<
 *             elif self._platform == "Darwin":
 *                 return self._check_macos_mouse()
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __pyx_v_self;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_check_windows_mouse, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        if (!(likely(PyBool_Check(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bool", __pyx_t_1))) __PYX_ERR(0, 1332, __pyx_L4_error)
        __pyx_r = ((PyObject*)__pyx_t_1);
        __pyx_t_1 = 0;
        goto __pyx_L8_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1331
 * 
 *         try:
 *             if self._platform == "Windows":             # <<<<<<<<<<<<<<
 *                 return self._check_windows_mouse()
 *             elif self._platform == "Darwin":
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1333
 *             if self._platform == "Windows":
 *                 return self._check_windows_mouse()
 *             elif self._platform == "Darwin":             # <<<<<<<<<<<<<<
 *                 return self._check_macos_mouse()
 *             elif self._platform == "Linux":
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Darwin, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1333, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_5) {

        /* "ws_package/utils/hardware_event_validator.py":1334
 *                 return self._check_windows_mouse()
 *             elif self._platform == "Darwin":
 *                 return self._check_macos_mouse()             # <<<<<<<<<<<<<<
 *             elif self._platform == "Linux":
 *                 return self._check_linux_mouse()
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __pyx_v_self;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_check_macos_mouse, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        if (!(likely(PyBool_Check(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bool", __pyx_t_1))) __PYX_ERR(0, 1334, __pyx_L4_error)
        __pyx_r = ((PyObject*)__pyx_t_1);
        __pyx_t_1 = 0;
        goto __pyx_L8_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1333
 *             if self._platform == "Windows":
 *                 return self._check_windows_mouse()
 *             elif self._platform == "Darwin":             # <<<<<<<<<<<<<<
 *                 return self._check_macos_mouse()
 *             elif self._platform == "Linux":
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1335
 *             elif self._platform == "Darwin":
 *                 return self._check_macos_mouse()
 *             elif self._platform == "Linux":             # <<<<<<<<<<<<<<
 *                 return self._check_linux_mouse()
 *         except Exception as e:
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Linux, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1335, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_5) {

        /* "ws_package/utils/hardware_event_validator.py":1336
 *                 return self._check_macos_mouse()
 *             elif self._platform == "Linux":
 *                 return self._check_linux_mouse()             # <<<<<<<<<<<<<<
 *         except Exception as e:
 *             logger.debug("Hardware validation error (accepting event): %s", e)
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __pyx_v_self;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_check_linux_mouse, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1336, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        if (!(likely(PyBool_Check(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bool", __pyx_t_1))) __PYX_ERR(0, 1336, __pyx_L4_error)
        __pyx_r = ((PyObject*)__pyx_t_1);
        __pyx_t_1 = 0;
        goto __pyx_L8_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1335
 *             elif self._platform == "Darwin":
 *                 return self._check_macos_mouse()
 *             elif self._platform == "Linux":             # <<<<<<<<<<<<<<
 *                 return self._check_linux_mouse()
 *         except Exception as e:
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1330
 *             return None  # Fail-safe: accept event
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self._platform == "Windows":
 *                 return self._check_windows_mouse()
*/
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1337
 *             elif self._platform == "Linux":
 *                 return self._check_linux_mouse()
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.debug("Hardware validation error (accepting event): %s", e)
 *             return None  # Fail-safe: accept event
*/
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_9) {
      __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.is_hardware_mouse_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_10) < 0) __PYX_ERR(0, 1337, __pyx_L6_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_v_e = __pyx_t_2;
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":1338
 *                 return self._check_linux_mouse()
 *         except Exception as e:
 *             logger.debug("Hardware validation error (accepting event): %s", e)             # <<<<<<<<<<<<<<
 *             return None  # Fail-safe: accept event
 * 
*/
        __pyx_t_12 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1338, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1338, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_3 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_14);
          assert(__pyx_t_12);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
          __pyx_t_3 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_mstate_global->__pyx_kp_u_Hardware_validation_error_accept, __pyx_v_e};
          __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1338, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "ws_package/utils/hardware_event_validator.py":1339
 *         except Exception as e:
 *             logger.debug("Hardware validation error (accepting event): %s", e)
 *             return None  # Fail-safe: accept event             # <<<<<<<<<<<<<<
 * 
 *         return None  # Unknown platform or error
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L15_return;
      }

      /* "ws_package/utils/hardware_event_validator.py":1337
 *             elif self._platform == "Linux":
 *                 return self._check_linux_mouse()
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.debug("Hardware validation error (accepting event): %s", e)
 *             return None  # Fail-safe: accept event
*/
      /*finally:*/ {
        __pyx_L16_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ( unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_9 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L6_except_error;
        }
        __pyx_L15_return: {
          __pyx_t_23 = __pyx_r;
          __pyx_r = 0;
          __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          __pyx_r = __pyx_t_23;
          __pyx_t_23 = 0;
          goto __pyx_L7_except_return;
        }
      }
    }
    goto __pyx_L6_except_error;

    /* "ws_package/utils/hardware_event_validator.py":1330
 *             return None  # Fail-safe: accept event
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self._platform == "Windows":
 *                 return self._check_windows_mouse()
*/
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L8_try_return:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L0;
    __pyx_L7_except_return:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L0;
    __pyx_L9_try_end:;
  }

  /* "ws_package/utils/hardware_event_validator.py":1341
 *             return None  # Fail-safe: accept event
 * 
 *         return None  # Unknown platform or error             # <<<<<<<<<<<<<<
 * 
 *     def is_hardware_mouse_move_event(self) -> Optional[bool]:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":1318
 *             return float(self._windows_last_hw_scroll_ts)
 * 
 *     def is_hardware_mouse_event(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Check if mouse event is from hardware.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.is_hardware_mouse_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1343
 *         return None  # Unknown platform or error
 * 
 *     def is_hardware_mouse_move_event(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """Check if a mouse-move event is from hardware (Windows SetCursorPos-aware)."""
 *         if not self.is_enabled():
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_69is_hardware_mouse_move_event(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_68is_hardware_mouse_move_event, "Check if a mouse-move event is from hardware (Windows SetCursorPos-aware).");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_69is_hardware_mouse_move_event = {"is_hardware_mouse_move_event", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_69is_hardware_mouse_move_event, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_68is_hardware_mouse_move_event};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_69is_hardware_mouse_move_event(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_hardware_mouse_move_event (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1343, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1343, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "is_hardware_mouse_move_event", 0) < (0)) __PYX_ERR(0, 1343, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("is_hardware_mouse_move_event", 1, 1, 1, i); __PYX_ERR(0, 1343, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1343, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_hardware_mouse_move_event", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1343, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.is_hardware_mouse_move_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_68is_hardware_mouse_move_event(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_68is_hardware_mouse_move_event(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_hardware_mouse_move_event", 0);

  /* "ws_package/utils/hardware_event_validator.py":1345
 *     def is_hardware_mouse_move_event(self) -> Optional[bool]:
 *         """Check if a mouse-move event is from hardware (Windows SetCursorPos-aware)."""
 *         if not self.is_enabled():             # <<<<<<<<<<<<<<
 *             return None
 *         try:
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_enabled, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (__pyx_t_5) {

    /* "ws_package/utils/hardware_event_validator.py":1346
 *         """Check if a mouse-move event is from hardware (Windows SetCursorPos-aware)."""
 *         if not self.is_enabled():
 *             return None             # <<<<<<<<<<<<<<
 *         try:
 *             if self._platform == "Windows":
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1345
 *     def is_hardware_mouse_move_event(self) -> Optional[bool]:
 *         """Check if a mouse-move event is from hardware (Windows SetCursorPos-aware)."""
 *         if not self.is_enabled():             # <<<<<<<<<<<<<<
 *             return None
 *         try:
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1347
 *         if not self.is_enabled():
 *             return None
 *         try:             # <<<<<<<<<<<<<<
 *             if self._platform == "Windows":
 *                 return self._check_windows_mouse_move()
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":1348
 *             return None
 *         try:
 *             if self._platform == "Windows":             # <<<<<<<<<<<<<<
 *                 return self._check_windows_mouse_move()
 *             return self.is_hardware_mouse_event()
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_platform_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1348, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Windows, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1348, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_5) {

        /* "ws_package/utils/hardware_event_validator.py":1349
 *         try:
 *             if self._platform == "Windows":
 *                 return self._check_windows_mouse_move()             # <<<<<<<<<<<<<<
 *             return self.is_hardware_mouse_event()
 *         except Exception as e:
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __pyx_v_self;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_check_windows_mouse_move, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1349, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        if (!(likely(PyBool_Check(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bool", __pyx_t_1))) __PYX_ERR(0, 1349, __pyx_L4_error)
        __pyx_r = ((PyObject*)__pyx_t_1);
        __pyx_t_1 = 0;
        goto __pyx_L8_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1348
 *             return None
 *         try:
 *             if self._platform == "Windows":             # <<<<<<<<<<<<<<
 *                 return self._check_windows_mouse_move()
 *             return self.is_hardware_mouse_event()
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1350
 *             if self._platform == "Windows":
 *                 return self._check_windows_mouse_move()
 *             return self.is_hardware_mouse_event()             # <<<<<<<<<<<<<<
 *         except Exception as e:
 *             logger.debug("Hardware mouse-move validation error (accepting event): %s", e)
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __pyx_v_self;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_hardware_mouse_event, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      if (!(likely(PyBool_Check(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bool", __pyx_t_1))) __PYX_ERR(0, 1350, __pyx_L4_error)
      __pyx_r = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L8_try_return;

      /* "ws_package/utils/hardware_event_validator.py":1347
 *         if not self.is_enabled():
 *             return None
 *         try:             # <<<<<<<<<<<<<<
 *             if self._platform == "Windows":
 *                 return self._check_windows_mouse_move()
*/
    }
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1351
 *                 return self._check_windows_mouse_move()
 *             return self.is_hardware_mouse_event()
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.debug("Hardware mouse-move validation error (accepting event): %s", e)
 *             return None
*/
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_9) {
      __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.is_hardware_mouse_move_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_10) < 0) __PYX_ERR(0, 1351, __pyx_L6_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_v_e = __pyx_t_2;
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":1352
 *             return self.is_hardware_mouse_event()
 *         except Exception as e:
 *             logger.debug("Hardware mouse-move validation error (accepting event): %s", e)             # <<<<<<<<<<<<<<
 *             return None
 * 
*/
        __pyx_t_12 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1352, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1352, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_3 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_14);
          assert(__pyx_t_12);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
          __pyx_t_3 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_mstate_global->__pyx_kp_u_Hardware_mouse_move_validation_e, __pyx_v_e};
          __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1352, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "ws_package/utils/hardware_event_validator.py":1353
 *         except Exception as e:
 *             logger.debug("Hardware mouse-move validation error (accepting event): %s", e)
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def _resolve_windows_input(
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L15_return;
      }

      /* "ws_package/utils/hardware_event_validator.py":1351
 *                 return self._check_windows_mouse_move()
 *             return self.is_hardware_mouse_event()
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.debug("Hardware mouse-move validation error (accepting event): %s", e)
 *             return None
*/
      /*finally:*/ {
        __pyx_L16_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ( unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_9 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L6_except_error;
        }
        __pyx_L15_return: {
          __pyx_t_23 = __pyx_r;
          __pyx_r = 0;
          __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          __pyx_r = __pyx_t_23;
          __pyx_t_23 = 0;
          goto __pyx_L7_except_return;
        }
      }
    }
    goto __pyx_L6_except_error;

    /* "ws_package/utils/hardware_event_validator.py":1347
 *         if not self.is_enabled():
 *             return None
 *         try:             # <<<<<<<<<<<<<<
 *             if self._platform == "Windows":
 *                 return self._check_windows_mouse_move()
*/
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L8_try_return:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L0;
    __pyx_L7_except_return:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L0;
  }

  /* "ws_package/utils/hardware_event_validator.py":1343
 *         return None  # Unknown platform or error
 * 
 *     def is_hardware_mouse_move_event(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """Check if a mouse-move event is from hardware (Windows SetCursorPos-aware)."""
 *         if not self.is_enabled():
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator.is_hardware_mouse_move_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1355
 *             return None
 * 
 *     def _resolve_windows_input(             # <<<<<<<<<<<<<<
 *         self,
 *         hw_ts: float,
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_71_resolve_windows_input(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_70_resolve_windows_input, "\n        Correlate pynput callbacks with LL hook stamps.\n\n        Hardware wins when seen recently \342\200\224 avoids stale synthetic stamps\n        blocking real mouse/keyboard after pyautogui runs.\n        ");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_71_resolve_windows_input = {"_resolve_windows_input", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_71_resolve_windows_input, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_70_resolve_windows_input};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_71_resolve_windows_input(PyObject *__pyx_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_self = 0;
  double __pyx_v_hw_ts;
  double __pyx_v_syn_ts;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_resolve_windows_input (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_hw_ts,&__pyx_mstate_global->__pyx_n_u_syn_ts,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1355, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1355, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1355, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1355, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_resolve_windows_input", 0) < (0)) __PYX_ERR(0, 1355, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_resolve_windows_input", 1, 3, 3, i); __PYX_ERR(0, 1355, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1355, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1355, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1355, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_hw_ts = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_hw_ts == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1357, __pyx_L3_error)
    __pyx_v_syn_ts = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_syn_ts == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1358, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_resolve_windows_input", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1355, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._resolve_windows_input", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_70_resolve_windows_input(__pyx_self, __pyx_v_self, __pyx_v_hw_ts, __pyx_v_syn_ts);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_70_resolve_windows_input(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, double __pyx_v_hw_ts, double __pyx_v_syn_ts) {
  PyObject *__pyx_v_now = NULL;
  PyObject *__pyx_v_hw_age = NULL;
  PyObject *__pyx_v_syn_age = NULL;
  PyObject *__pyx_v_hw_recent = NULL;
  PyObject *__pyx_v_syn_recent = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_resolve_windows_input", 0);

  /* "ws_package/utils/hardware_event_validator.py":1366
 *         blocking real mouse/keyboard after pyautogui runs.
 *         """
 *         now = time.time()             # <<<<<<<<<<<<<<
 *         hw_age = (now - hw_ts) if hw_ts else None
 *         syn_age = (now - syn_ts) if syn_ts else None
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_now = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1367
 *         """
 *         now = time.time()
 *         hw_age = (now - hw_ts) if hw_ts else None             # <<<<<<<<<<<<<<
 *         syn_age = (now - syn_ts) if syn_ts else None
 * 
*/
  __pyx_t_6 = (__pyx_v_hw_ts != 0);
  if (__pyx_t_6) {
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_hw_ts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyNumber_Subtract(__pyx_v_now, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_v_hw_age = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1368
 *         now = time.time()
 *         hw_age = (now - hw_ts) if hw_ts else None
 *         syn_age = (now - syn_ts) if syn_ts else None             # <<<<<<<<<<<<<<
 * 
 *         hw_recent = hw_age is not None and hw_age < WINDOWS_HW_CONFIRM_WINDOW
*/
  __pyx_t_6 = (__pyx_v_syn_ts != 0);
  if (__pyx_t_6) {
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_syn_ts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_now, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_v_syn_age = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1370
 *         syn_age = (now - syn_ts) if syn_ts else None
 * 
 *         hw_recent = hw_age is not None and hw_age < WINDOWS_HW_CONFIRM_WINDOW             # <<<<<<<<<<<<<<
 *         syn_recent = syn_age is not None and syn_age < WINDOWS_SYN_FILTER_WINDOW
 * 
*/
  __pyx_t_6 = (__pyx_v_hw_age != Py_None);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_WINDOWS_HW_CONFIRM_WINDOW); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_hw_age, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1370, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_v_hw_recent = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1371
 * 
 *         hw_recent = hw_age is not None and hw_age < WINDOWS_HW_CONFIRM_WINDOW
 *         syn_recent = syn_age is not None and syn_age < WINDOWS_SYN_FILTER_WINDOW             # <<<<<<<<<<<<<<
 * 
 *         if hw_recent and (not syn_recent or hw_ts >= syn_ts):
*/
  __pyx_t_6 = (__pyx_v_syn_age != Py_None);
  if (__pyx_t_6) {
  } else {
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L5_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_WINDOWS_SYN_FILTER_WINDOW); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_syn_age, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1371, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_1 = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_L5_bool_binop_done:;
  __pyx_v_syn_recent = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1373
 *         syn_recent = syn_age is not None and syn_age < WINDOWS_SYN_FILTER_WINDOW
 * 
 *         if hw_recent and (not syn_recent or hw_ts >= syn_ts):             # <<<<<<<<<<<<<<
 *             return True
 *         if syn_recent and (not hw_recent or syn_ts > hw_ts):
*/
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_hw_recent); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1373, __pyx_L1_error)
  if (__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_syn_recent); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1373, __pyx_L1_error)
  __pyx_t_8 = (!__pyx_t_7);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_6 = __pyx_t_8;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_8 = (__pyx_v_hw_ts >= __pyx_v_syn_ts);
  __pyx_t_6 = __pyx_t_8;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_6) {

    /* "ws_package/utils/hardware_event_validator.py":1374
 * 
 *         if hw_recent and (not syn_recent or hw_ts >= syn_ts):
 *             return True             # <<<<<<<<<<<<<<
 *         if syn_recent and (not hw_recent or syn_ts > hw_ts):
 *             return False
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1373
 *         syn_recent = syn_age is not None and syn_age < WINDOWS_SYN_FILTER_WINDOW
 * 
 *         if hw_recent and (not syn_recent or hw_ts >= syn_ts):             # <<<<<<<<<<<<<<
 *             return True
 *         if syn_recent and (not hw_recent or syn_ts > hw_ts):
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1375
 *         if hw_recent and (not syn_recent or hw_ts >= syn_ts):
 *             return True
 *         if syn_recent and (not hw_recent or syn_ts > hw_ts):             # <<<<<<<<<<<<<<
 *             return False
 *         return None
*/
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_syn_recent); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1375, __pyx_L1_error)
  if (__pyx_t_8) {
  } else {
    __pyx_t_6 = __pyx_t_8;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_hw_recent); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1375, __pyx_L1_error)
  __pyx_t_7 = (!__pyx_t_8);
  if (!__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_syn_ts > __pyx_v_hw_ts);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L12_bool_binop_done:;
  if (__pyx_t_6) {

    /* "ws_package/utils/hardware_event_validator.py":1376
 *             return True
 *         if syn_recent and (not hw_recent or syn_ts > hw_ts):
 *             return False             # <<<<<<<<<<<<<<
 *         return None
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1375
 *         if hw_recent and (not syn_recent or hw_ts >= syn_ts):
 *             return True
 *         if syn_recent and (not hw_recent or syn_ts > hw_ts):             # <<<<<<<<<<<<<<
 *             return False
 *         return None
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1377
 *         if syn_recent and (not hw_recent or syn_ts > hw_ts):
 *             return False
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     def _check_windows_keyboard(self) -> Optional[bool]:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":1355
 *             return None
 * 
 *     def _resolve_windows_input(             # <<<<<<<<<<<<<<
 *         self,
 *         hw_ts: float,
*/

  /* 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("ws_package.utils.hardware_event_validator.HardwareEventValidator._resolve_windows_input", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_now);
  __Pyx_XDECREF(__pyx_v_hw_age);
  __Pyx_XDECREF(__pyx_v_syn_age);
  __Pyx_XDECREF(__pyx_v_hw_recent);
  __Pyx_XDECREF(__pyx_v_syn_recent);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1379
 *         return None
 * 
 *     def _check_windows_keyboard(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Windows: Check if keyboard event is injected using low-level hook data
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_73_check_windows_keyboard(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_72_check_windows_keyboard, "\n        Windows: Check if keyboard event is injected using low-level hook data\n        \n        Returns True if hardware, False if injected, None if unknown\n        ");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_73_check_windows_keyboard = {"_check_windows_keyboard", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_73_check_windows_keyboard, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_72_check_windows_keyboard};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_73_check_windows_keyboard(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_check_windows_keyboard (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1379, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1379, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_check_windows_keyboard", 0) < (0)) __PYX_ERR(0, 1379, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_check_windows_keyboard", 1, 1, 1, i); __PYX_ERR(0, 1379, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1379, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_windows_keyboard", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1379, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_windows_keyboard", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_72_check_windows_keyboard(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_72_check_windows_keyboard(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_hw_ts = NULL;
  PyObject *__pyx_v_syn_ts = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_windows_keyboard", 0);

  /* "ws_package/utils/hardware_event_validator.py":1385
 *         Returns True if hardware, False if injected, None if unknown
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             with self._windows_lock:
 *                 hw_ts = self._windows_last_hw_keyboard_ts
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":1386
 *         """
 *         try:
 *             with self._windows_lock:             # <<<<<<<<<<<<<<
 *                 hw_ts = self._windows_last_hw_keyboard_ts
 *                 syn_ts = self._windows_last_syn_keyboard_ts
*/
      /*with:*/ {
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_lock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1386, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1386, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = NULL;
        __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1386, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = 1;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
          assert(__pyx_t_7);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
          __pyx_t_9 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
          __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1386, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*try:*/ {
          {
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
            __Pyx_XGOTREF(__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_11);
            __Pyx_XGOTREF(__pyx_t_12);
            /*try:*/ {

              /* "ws_package/utils/hardware_event_validator.py":1387
 *         try:
 *             with self._windows_lock:
 *                 hw_ts = self._windows_last_hw_keyboard_ts             # <<<<<<<<<<<<<<
 *                 syn_ts = self._windows_last_syn_keyboard_ts
 *             return self._resolve_windows_input(hw_ts, syn_ts)
*/
              __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_hw_keyboard_ts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1387, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_v_hw_ts = __pyx_t_4;
              __pyx_t_4 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1388
 *             with self._windows_lock:
 *                 hw_ts = self._windows_last_hw_keyboard_ts
 *                 syn_ts = self._windows_last_syn_keyboard_ts             # <<<<<<<<<<<<<<
 *             return self._resolve_windows_input(hw_ts, syn_ts)
 *         except Exception:
*/
              __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_syn_keyboard_ts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1388, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_v_syn_ts = __pyx_t_4;
              __pyx_t_4 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1386
 *         """
 *         try:
 *             with self._windows_lock:             # <<<<<<<<<<<<<<
 *                 hw_ts = self._windows_last_hw_keyboard_ts
 *                 syn_ts = self._windows_last_syn_keyboard_ts
*/
            }
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L18_try_end;
            __pyx_L13_error:;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            /*except:*/ {
              __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_windows_keyboard", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 1386, __pyx_L15_except_error)
              __Pyx_XGOTREF(__pyx_t_4);
              __Pyx_XGOTREF(__pyx_t_6);
              __Pyx_XGOTREF(__pyx_t_8);
              __pyx_t_7 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1386, __pyx_L15_except_error)
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1386, __pyx_L15_except_error)
              __Pyx_GOTREF(__pyx_t_13);
              __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_13);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              if (__pyx_t_14 < (0)) __PYX_ERR(0, 1386, __pyx_L15_except_error)
              __pyx_t_15 = (!__pyx_t_14);
              if (unlikely(__pyx_t_15)) {
                __Pyx_GIVEREF(__pyx_t_4);
                __Pyx_GIVEREF(__pyx_t_6);
                __Pyx_XGIVEREF(__pyx_t_8);
                __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_6, __pyx_t_8);
                __pyx_t_4 = 0;  __pyx_t_6 = 0;  __pyx_t_8 = 0; 
                __PYX_ERR(0, 1386, __pyx_L15_except_error)
              }
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              goto __pyx_L14_exception_handled;
            }
            __pyx_L15_except_error:;
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
            goto __pyx_L3_error;
            __pyx_L14_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
            __pyx_L18_try_end:;
          }
        }
        /*finally:*/ {
          /*normal exit:*/{
            if (__pyx_t_5) {
              __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[2], NULL);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1386, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
            goto __pyx_L12;
          }
          __pyx_L12:;
        }
        goto __pyx_L22;
        __pyx_L9_error:;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L3_error;
        __pyx_L22:;
      }

      /* "ws_package/utils/hardware_event_validator.py":1389
 *                 hw_ts = self._windows_last_hw_keyboard_ts
 *                 syn_ts = self._windows_last_syn_keyboard_ts
 *             return self._resolve_windows_input(hw_ts, syn_ts)             # <<<<<<<<<<<<<<
 *         except Exception:
 *             return None  # Fail-safe: accept event
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = __pyx_v_self;
      __Pyx_INCREF(__pyx_t_6);
      if (unlikely(!__pyx_v_hw_ts)) { __Pyx_RaiseUnboundLocalError("hw_ts"); __PYX_ERR(0, 1389, __pyx_L3_error) }
      if (unlikely(!__pyx_v_syn_ts)) { __Pyx_RaiseUnboundLocalError("syn_ts"); __PYX_ERR(0, 1389, __pyx_L3_error) }
      __pyx_t_9 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_hw_ts, __pyx_v_syn_ts};
        __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_resolve_windows_input, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1389, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      if (!(likely(PyBool_Check(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bool", __pyx_t_8))) __PYX_ERR(0, 1389, __pyx_L3_error)
      __pyx_r = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
      goto __pyx_L7_try_return;

      /* "ws_package/utils/hardware_event_validator.py":1385
 *         Returns True if hardware, False if injected, None if unknown
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             with self._windows_lock:
 *                 hw_ts = self._windows_last_hw_keyboard_ts
*/
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1390
 *                 syn_ts = self._windows_last_syn_keyboard_ts
 *             return self._resolve_windows_input(hw_ts, syn_ts)
 *         except Exception:             # <<<<<<<<<<<<<<
 *             return None  # Fail-safe: accept event
 * 
*/
    __pyx_t_16 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_16) {
      __Pyx_ErrRestore(0,0,0);

      /* "ws_package/utils/hardware_event_validator.py":1391
 *             return self._resolve_windows_input(hw_ts, syn_ts)
 *         except Exception:
 *             return None  # Fail-safe: accept event             # <<<<<<<<<<<<<<
 * 
 *     def _check_windows_mouse(self) -> Optional[bool]:
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;

    /* "ws_package/utils/hardware_event_validator.py":1385
 *         Returns True if hardware, False if injected, None if unknown
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             with self._windows_lock:
 *                 hw_ts = self._windows_last_hw_keyboard_ts
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "ws_package/utils/hardware_event_validator.py":1379
 *         return None
 * 
 *     def _check_windows_keyboard(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Windows: Check if keyboard event is injected using low-level hook data
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_windows_keyboard", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_hw_ts);
  __Pyx_XDECREF(__pyx_v_syn_ts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1393
 *             return None  # Fail-safe: accept event
 * 
 *     def _check_windows_mouse(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Windows: clicks and non-move mouse events via LL hook + raw input.
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_75_check_windows_mouse(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_74_check_windows_mouse, "\n        Windows: clicks and non-move mouse events via LL hook + raw input.\n        \n        Returns True if hardware, False if injected, None if unknown\n        ");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_75_check_windows_mouse = {"_check_windows_mouse", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_75_check_windows_mouse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_74_check_windows_mouse};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_75_check_windows_mouse(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_check_windows_mouse (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1393, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1393, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_check_windows_mouse", 0) < (0)) __PYX_ERR(0, 1393, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_check_windows_mouse", 1, 1, 1, i); __PYX_ERR(0, 1393, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1393, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_windows_mouse", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1393, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_windows_mouse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_74_check_windows_mouse(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_74_check_windows_mouse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_now = NULL;
  PyObject *__pyx_v_hw_ts = NULL;
  PyObject *__pyx_v_syn_ts = NULL;
  PyObject *__pyx_v_raw_ts = NULL;
  PyObject *__pyx_v_resolved = NULL;
  PyObject *__pyx_v_syn_recent = NULL;
  PyObject *__pyx_v_raw_recent = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_windows_mouse", 0);

  /* "ws_package/utils/hardware_event_validator.py":1399
 *         Returns True if hardware, False if injected, None if unknown
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             now = time.time()
 *             with self._windows_lock:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":1400
 *         """
 *         try:
 *             now = time.time()             # <<<<<<<<<<<<<<
 *             with self._windows_lock:
 *                 hw_ts = self._windows_last_hw_mouse_ts
*/
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1400, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1400, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1400, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_v_now = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":1401
 *         try:
 *             now = time.time()
 *             with self._windows_lock:             # <<<<<<<<<<<<<<
 *                 hw_ts = self._windows_last_hw_mouse_ts
 *                 syn_ts = self._windows_last_syn_mouse_ts
*/
      /*with:*/ {
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_lock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1401, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1401, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_5 = NULL;
        __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1401, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = 1;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          assert(__pyx_t_5);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
          __pyx_t_8 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
          __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1401, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*try:*/ {
          {
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
            __Pyx_XGOTREF(__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_11);
            __Pyx_XGOTREF(__pyx_t_12);
            /*try:*/ {

              /* "ws_package/utils/hardware_event_validator.py":1402
 *             now = time.time()
 *             with self._windows_lock:
 *                 hw_ts = self._windows_last_hw_mouse_ts             # <<<<<<<<<<<<<<
 *                 syn_ts = self._windows_last_syn_mouse_ts
 *                 raw_ts = self._windows_last_raw_mouse_ts
*/
              __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_hw_mouse_ts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1402, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_v_hw_ts = __pyx_t_4;
              __pyx_t_4 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1403
 *             with self._windows_lock:
 *                 hw_ts = self._windows_last_hw_mouse_ts
 *                 syn_ts = self._windows_last_syn_mouse_ts             # <<<<<<<<<<<<<<
 *                 raw_ts = self._windows_last_raw_mouse_ts
 * 
*/
              __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_syn_mouse_ts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1403, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_v_syn_ts = __pyx_t_4;
              __pyx_t_4 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1404
 *                 hw_ts = self._windows_last_hw_mouse_ts
 *                 syn_ts = self._windows_last_syn_mouse_ts
 *                 raw_ts = self._windows_last_raw_mouse_ts             # <<<<<<<<<<<<<<
 * 
 *             resolved = self._resolve_windows_input(hw_ts, syn_ts)
*/
              __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_raw_mouse_ts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1404, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_v_raw_ts = __pyx_t_4;
              __pyx_t_4 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1401
 *         try:
 *             now = time.time()
 *             with self._windows_lock:             # <<<<<<<<<<<<<<
 *                 hw_ts = self._windows_last_hw_mouse_ts
 *                 syn_ts = self._windows_last_syn_mouse_ts
*/
            }
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L18_try_end;
            __pyx_L13_error:;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            /*except:*/ {
              __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_windows_mouse", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(0, 1401, __pyx_L15_except_error)
              __Pyx_XGOTREF(__pyx_t_4);
              __Pyx_XGOTREF(__pyx_t_7);
              __Pyx_XGOTREF(__pyx_t_6);
              __pyx_t_5 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1401, __pyx_L15_except_error)
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1401, __pyx_L15_except_error)
              __Pyx_GOTREF(__pyx_t_13);
              __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_13);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              if (__pyx_t_14 < (0)) __PYX_ERR(0, 1401, __pyx_L15_except_error)
              __pyx_t_15 = (!__pyx_t_14);
              if (unlikely(__pyx_t_15)) {
                __Pyx_GIVEREF(__pyx_t_4);
                __Pyx_GIVEREF(__pyx_t_7);
                __Pyx_XGIVEREF(__pyx_t_6);
                __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_7, __pyx_t_6);
                __pyx_t_4 = 0;  __pyx_t_7 = 0;  __pyx_t_6 = 0; 
                __PYX_ERR(0, 1401, __pyx_L15_except_error)
              }
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              goto __pyx_L14_exception_handled;
            }
            __pyx_L15_except_error:;
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
            goto __pyx_L3_error;
            __pyx_L14_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
            __pyx_L18_try_end:;
          }
        }
        /*finally:*/ {
          /*normal exit:*/{
            if (__pyx_t_9) {
              __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_mstate_global->__pyx_tuple[2], NULL);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1401, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
            goto __pyx_L12;
          }
          __pyx_L12:;
        }
        goto __pyx_L22;
        __pyx_L9_error:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L3_error;
        __pyx_L22:;
      }

      /* "ws_package/utils/hardware_event_validator.py":1406
 *                 raw_ts = self._windows_last_raw_mouse_ts
 * 
 *             resolved = self._resolve_windows_input(hw_ts, syn_ts)             # <<<<<<<<<<<<<<
 *             if resolved is False:
 *                 return False
*/
      __pyx_t_7 = __pyx_v_self;
      __Pyx_INCREF(__pyx_t_7);
      if (unlikely(!__pyx_v_hw_ts)) { __Pyx_RaiseUnboundLocalError("hw_ts"); __PYX_ERR(0, 1406, __pyx_L3_error) }
      if (unlikely(!__pyx_v_syn_ts)) { __Pyx_RaiseUnboundLocalError("syn_ts"); __PYX_ERR(0, 1406, __pyx_L3_error) }
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_hw_ts, __pyx_v_syn_ts};
        __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_resolve_windows_input, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1406, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_v_resolved = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "ws_package/utils/hardware_event_validator.py":1407
 * 
 *             resolved = self._resolve_windows_input(hw_ts, syn_ts)
 *             if resolved is False:             # <<<<<<<<<<<<<<
 *                 return False
 * 
*/
      __pyx_t_15 = (__pyx_v_resolved == Py_False);
      if (__pyx_t_15) {

        /* "ws_package/utils/hardware_event_validator.py":1408
 *             resolved = self._resolve_windows_input(hw_ts, syn_ts)
 *             if resolved is False:
 *                 return False             # <<<<<<<<<<<<<<
 * 
 *             syn_recent = syn_ts and (now - syn_ts) < WINDOWS_SYN_FILTER_WINDOW
*/
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_False);
        __pyx_r = Py_False;
        goto __pyx_L7_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1407
 * 
 *             resolved = self._resolve_windows_input(hw_ts, syn_ts)
 *             if resolved is False:             # <<<<<<<<<<<<<<
 *                 return False
 * 
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1410
 *                 return False
 * 
 *             syn_recent = syn_ts and (now - syn_ts) < WINDOWS_SYN_FILTER_WINDOW             # <<<<<<<<<<<<<<
 *             raw_recent = raw_ts and (now - raw_ts) < WINDOWS_RAW_CONFIRM_WINDOW
 * 
*/
      if (unlikely(!__pyx_v_syn_ts)) { __Pyx_RaiseUnboundLocalError("syn_ts"); __PYX_ERR(0, 1410, __pyx_L3_error) }
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_syn_ts); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 1410, __pyx_L3_error)
      if (__pyx_t_15) {
      } else {
        __Pyx_INCREF(__pyx_v_syn_ts);
        __pyx_t_6 = __pyx_v_syn_ts;
        goto __pyx_L24_bool_binop_done;
      }
      if (unlikely(!__pyx_v_syn_ts)) { __Pyx_RaiseUnboundLocalError("syn_ts"); __PYX_ERR(0, 1410, __pyx_L3_error) }
      __pyx_t_7 = PyNumber_Subtract(__pyx_v_now, __pyx_v_syn_ts); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1410, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_WINDOWS_SYN_FILTER_WINDOW); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1410, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1410, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = __pyx_t_5;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_L24_bool_binop_done:;
      __pyx_v_syn_recent = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "ws_package/utils/hardware_event_validator.py":1411
 * 
 *             syn_recent = syn_ts and (now - syn_ts) < WINDOWS_SYN_FILTER_WINDOW
 *             raw_recent = raw_ts and (now - raw_ts) < WINDOWS_RAW_CONFIRM_WINDOW             # <<<<<<<<<<<<<<
 * 
 *             if syn_recent and not (raw_recent and raw_ts >= syn_ts):
*/
      if (unlikely(!__pyx_v_raw_ts)) { __Pyx_RaiseUnboundLocalError("raw_ts"); __PYX_ERR(0, 1411, __pyx_L3_error) }
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_raw_ts); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 1411, __pyx_L3_error)
      if (__pyx_t_15) {
      } else {
        __Pyx_INCREF(__pyx_v_raw_ts);
        __pyx_t_6 = __pyx_v_raw_ts;
        goto __pyx_L26_bool_binop_done;
      }
      if (unlikely(!__pyx_v_raw_ts)) { __Pyx_RaiseUnboundLocalError("raw_ts"); __PYX_ERR(0, 1411, __pyx_L3_error) }
      __pyx_t_5 = PyNumber_Subtract(__pyx_v_now, __pyx_v_raw_ts); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1411, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_WINDOWS_RAW_CONFIRM_WINDOW); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1411, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1411, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_6 = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_L26_bool_binop_done:;
      __pyx_v_raw_recent = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "ws_package/utils/hardware_event_validator.py":1413
 *             raw_recent = raw_ts and (now - raw_ts) < WINDOWS_RAW_CONFIRM_WINDOW
 * 
 *             if syn_recent and not (raw_recent and raw_ts >= syn_ts):             # <<<<<<<<<<<<<<
 *                 return False
 *             if raw_recent:
*/
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_syn_recent); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1413, __pyx_L3_error)
      if (__pyx_t_14) {
      } else {
        __pyx_t_15 = __pyx_t_14;
        goto __pyx_L29_bool_binop_done;
      }
      __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_v_raw_recent); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 1413, __pyx_L3_error)
      if (__pyx_t_16) {
      } else {
        __pyx_t_14 = __pyx_t_16;
        goto __pyx_L31_bool_binop_done;
      }
      if (unlikely(!__pyx_v_raw_ts)) { __Pyx_RaiseUnboundLocalError("raw_ts"); __PYX_ERR(0, 1413, __pyx_L3_error) }
      if (unlikely(!__pyx_v_syn_ts)) { __Pyx_RaiseUnboundLocalError("syn_ts"); __PYX_ERR(0, 1413, __pyx_L3_error) }
      __pyx_t_6 = PyObject_RichCompare(__pyx_v_raw_ts, __pyx_v_syn_ts, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1413, __pyx_L3_error)
      __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 1413, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_14 = __pyx_t_16;
      __pyx_L31_bool_binop_done:;
      __pyx_t_16 = (!__pyx_t_14);
      __pyx_t_15 = __pyx_t_16;
      __pyx_L29_bool_binop_done:;
      if (__pyx_t_15) {

        /* "ws_package/utils/hardware_event_validator.py":1414
 * 
 *             if syn_recent and not (raw_recent and raw_ts >= syn_ts):
 *                 return False             # <<<<<<<<<<<<<<
 *             if raw_recent:
 *                 return True
*/
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_False);
        __pyx_r = Py_False;
        goto __pyx_L7_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1413
 *             raw_recent = raw_ts and (now - raw_ts) < WINDOWS_RAW_CONFIRM_WINDOW
 * 
 *             if syn_recent and not (raw_recent and raw_ts >= syn_ts):             # <<<<<<<<<<<<<<
 *                 return False
 *             if raw_recent:
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1415
 *             if syn_recent and not (raw_recent and raw_ts >= syn_ts):
 *                 return False
 *             if raw_recent:             # <<<<<<<<<<<<<<
 *                 return True
 *             if self._automation_process_active():
*/
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_raw_recent); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 1415, __pyx_L3_error)
      if (__pyx_t_15) {

        /* "ws_package/utils/hardware_event_validator.py":1416
 *                 return False
 *             if raw_recent:
 *                 return True             # <<<<<<<<<<<<<<
 *             if self._automation_process_active():
 *                 return False
*/
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_True);
        __pyx_r = Py_True;
        goto __pyx_L7_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1415
 *             if syn_recent and not (raw_recent and raw_ts >= syn_ts):
 *                 return False
 *             if raw_recent:             # <<<<<<<<<<<<<<
 *                 return True
 *             if self._automation_process_active():
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1417
 *             if raw_recent:
 *                 return True
 *             if self._automation_process_active():             # <<<<<<<<<<<<<<
 *                 return False
 *             if resolved is True:
*/
      __pyx_t_7 = __pyx_v_self;
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
        __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_automation_process_active, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1417, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 1417, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_15) {

        /* "ws_package/utils/hardware_event_validator.py":1418
 *                 return True
 *             if self._automation_process_active():
 *                 return False             # <<<<<<<<<<<<<<
 *             if resolved is True:
 *                 return True
*/
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_False);
        __pyx_r = Py_False;
        goto __pyx_L7_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1417
 *             if raw_recent:
 *                 return True
 *             if self._automation_process_active():             # <<<<<<<<<<<<<<
 *                 return False
 *             if resolved is True:
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1419
 *             if self._automation_process_active():
 *                 return False
 *             if resolved is True:             # <<<<<<<<<<<<<<
 *                 return True
 *             return None
*/
      __pyx_t_15 = (__pyx_v_resolved == Py_True);
      if (__pyx_t_15) {

        /* "ws_package/utils/hardware_event_validator.py":1420
 *                 return False
 *             if resolved is True:
 *                 return True             # <<<<<<<<<<<<<<
 *             return None
 *         except Exception:
*/
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_True);
        __pyx_r = Py_True;
        goto __pyx_L7_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1419
 *             if self._automation_process_active():
 *                 return False
 *             if resolved is True:             # <<<<<<<<<<<<<<
 *                 return True
 *             return None
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1421
 *             if resolved is True:
 *                 return True
 *             return None             # <<<<<<<<<<<<<<
 *         except Exception:
 *             return None  # Fail-safe: accept event
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
      goto __pyx_L7_try_return;

      /* "ws_package/utils/hardware_event_validator.py":1399
 *         Returns True if hardware, False if injected, None if unknown
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             now = time.time()
 *             with self._windows_lock:
*/
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1422
 *                 return True
 *             return None
 *         except Exception:             # <<<<<<<<<<<<<<
 *             return None  # Fail-safe: accept event
 * 
*/
    __pyx_t_17 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_17) {
      __Pyx_ErrRestore(0,0,0);

      /* "ws_package/utils/hardware_event_validator.py":1423
 *             return None
 *         except Exception:
 *             return None  # Fail-safe: accept event             # <<<<<<<<<<<<<<
 * 
 *     def _check_windows_mouse_move(self) -> Optional[bool]:
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;

    /* "ws_package/utils/hardware_event_validator.py":1399
 *         Returns True if hardware, False if injected, None if unknown
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             now = time.time()
 *             with self._windows_lock:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "ws_package/utils/hardware_event_validator.py":1393
 *             return None  # Fail-safe: accept event
 * 
 *     def _check_windows_mouse(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Windows: clicks and non-move mouse events via LL hook + raw input.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_windows_mouse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_now);
  __Pyx_XDECREF(__pyx_v_hw_ts);
  __Pyx_XDECREF(__pyx_v_syn_ts);
  __Pyx_XDECREF(__pyx_v_raw_ts);
  __Pyx_XDECREF(__pyx_v_resolved);
  __Pyx_XDECREF(__pyx_v_syn_recent);
  __Pyx_XDECREF(__pyx_v_raw_recent);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1425
 *             return None  # Fail-safe: accept event
 * 
 *     def _check_windows_mouse_move(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Windows mouse moves: pyautogui.moveTo uses SetCursorPos (no LLMHF_INJECTED).
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_77_check_windows_mouse_move(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_76_check_windows_mouse_move, "\n        Windows mouse moves: pyautogui.moveTo uses SetCursorPos (no LLMHF_INJECTED).\n\n        Physical mice emit WM_INPUT raw events; SetCursorPos does not.\n        ");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_77_check_windows_mouse_move = {"_check_windows_mouse_move", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_77_check_windows_mouse_move, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_76_check_windows_mouse_move};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_77_check_windows_mouse_move(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_check_windows_mouse_move (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1425, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1425, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_check_windows_mouse_move", 0) < (0)) __PYX_ERR(0, 1425, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_check_windows_mouse_move", 1, 1, 1, i); __PYX_ERR(0, 1425, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1425, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_windows_mouse_move", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1425, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_windows_mouse_move", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_76_check_windows_mouse_move(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_76_check_windows_mouse_move(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_now = NULL;
  PyObject *__pyx_v_syn_ts = NULL;
  PyObject *__pyx_v_raw_ts = NULL;
  PyObject *__pyx_v_syn_recent = NULL;
  PyObject *__pyx_v_raw_recent = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_windows_mouse_move", 0);

  /* "ws_package/utils/hardware_event_validator.py":1431
 *         Physical mice emit WM_INPUT raw events; SetCursorPos does not.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             now = time.time()
 *             with self._windows_lock:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":1432
 *         """
 *         try:
 *             now = time.time()             # <<<<<<<<<<<<<<
 *             with self._windows_lock:
 *                 syn_ts = self._windows_last_syn_mouse_ts
*/
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1432, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1432, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1432, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_v_now = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":1433
 *         try:
 *             now = time.time()
 *             with self._windows_lock:             # <<<<<<<<<<<<<<
 *                 syn_ts = self._windows_last_syn_mouse_ts
 *                 raw_ts = self._windows_last_raw_mouse_ts
*/
      /*with:*/ {
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_lock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1433, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1433, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_5 = NULL;
        __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1433, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = 1;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          assert(__pyx_t_5);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
          __pyx_t_8 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
          __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1433, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*try:*/ {
          {
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
            __Pyx_XGOTREF(__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_11);
            __Pyx_XGOTREF(__pyx_t_12);
            /*try:*/ {

              /* "ws_package/utils/hardware_event_validator.py":1434
 *             now = time.time()
 *             with self._windows_lock:
 *                 syn_ts = self._windows_last_syn_mouse_ts             # <<<<<<<<<<<<<<
 *                 raw_ts = self._windows_last_raw_mouse_ts
 * 
*/
              __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_syn_mouse_ts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1434, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_v_syn_ts = __pyx_t_4;
              __pyx_t_4 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1435
 *             with self._windows_lock:
 *                 syn_ts = self._windows_last_syn_mouse_ts
 *                 raw_ts = self._windows_last_raw_mouse_ts             # <<<<<<<<<<<<<<
 * 
 *             syn_recent = syn_ts and (now - syn_ts) < WINDOWS_SYN_FILTER_WINDOW
*/
              __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_raw_mouse_ts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1435, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_v_raw_ts = __pyx_t_4;
              __pyx_t_4 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1433
 *         try:
 *             now = time.time()
 *             with self._windows_lock:             # <<<<<<<<<<<<<<
 *                 syn_ts = self._windows_last_syn_mouse_ts
 *                 raw_ts = self._windows_last_raw_mouse_ts
*/
            }
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L18_try_end;
            __pyx_L13_error:;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            /*except:*/ {
              __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_windows_mouse_move", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(0, 1433, __pyx_L15_except_error)
              __Pyx_XGOTREF(__pyx_t_4);
              __Pyx_XGOTREF(__pyx_t_7);
              __Pyx_XGOTREF(__pyx_t_6);
              __pyx_t_5 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1433, __pyx_L15_except_error)
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1433, __pyx_L15_except_error)
              __Pyx_GOTREF(__pyx_t_13);
              __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_13);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              if (__pyx_t_14 < (0)) __PYX_ERR(0, 1433, __pyx_L15_except_error)
              __pyx_t_15 = (!__pyx_t_14);
              if (unlikely(__pyx_t_15)) {
                __Pyx_GIVEREF(__pyx_t_4);
                __Pyx_GIVEREF(__pyx_t_7);
                __Pyx_XGIVEREF(__pyx_t_6);
                __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_7, __pyx_t_6);
                __pyx_t_4 = 0;  __pyx_t_7 = 0;  __pyx_t_6 = 0; 
                __PYX_ERR(0, 1433, __pyx_L15_except_error)
              }
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              goto __pyx_L14_exception_handled;
            }
            __pyx_L15_except_error:;
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
            goto __pyx_L3_error;
            __pyx_L14_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
            __pyx_L18_try_end:;
          }
        }
        /*finally:*/ {
          /*normal exit:*/{
            if (__pyx_t_9) {
              __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_mstate_global->__pyx_tuple[2], NULL);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1433, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
            goto __pyx_L12;
          }
          __pyx_L12:;
        }
        goto __pyx_L22;
        __pyx_L9_error:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L3_error;
        __pyx_L22:;
      }

      /* "ws_package/utils/hardware_event_validator.py":1437
 *                 raw_ts = self._windows_last_raw_mouse_ts
 * 
 *             syn_recent = syn_ts and (now - syn_ts) < WINDOWS_SYN_FILTER_WINDOW             # <<<<<<<<<<<<<<
 *             raw_recent = raw_ts and (now - raw_ts) < WINDOWS_RAW_CONFIRM_WINDOW
 * 
*/
      if (unlikely(!__pyx_v_syn_ts)) { __Pyx_RaiseUnboundLocalError("syn_ts"); __PYX_ERR(0, 1437, __pyx_L3_error) }
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_syn_ts); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 1437, __pyx_L3_error)
      if (__pyx_t_15) {
      } else {
        __Pyx_INCREF(__pyx_v_syn_ts);
        __pyx_t_6 = __pyx_v_syn_ts;
        goto __pyx_L23_bool_binop_done;
      }
      if (unlikely(!__pyx_v_syn_ts)) { __Pyx_RaiseUnboundLocalError("syn_ts"); __PYX_ERR(0, 1437, __pyx_L3_error) }
      __pyx_t_7 = PyNumber_Subtract(__pyx_v_now, __pyx_v_syn_ts); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1437, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_WINDOWS_SYN_FILTER_WINDOW); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1437, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1437, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = __pyx_t_5;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_L23_bool_binop_done:;
      __pyx_v_syn_recent = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "ws_package/utils/hardware_event_validator.py":1438
 * 
 *             syn_recent = syn_ts and (now - syn_ts) < WINDOWS_SYN_FILTER_WINDOW
 *             raw_recent = raw_ts and (now - raw_ts) < WINDOWS_RAW_CONFIRM_WINDOW             # <<<<<<<<<<<<<<
 * 
 *             if syn_recent:
*/
      if (unlikely(!__pyx_v_raw_ts)) { __Pyx_RaiseUnboundLocalError("raw_ts"); __PYX_ERR(0, 1438, __pyx_L3_error) }
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_raw_ts); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 1438, __pyx_L3_error)
      if (__pyx_t_15) {
      } else {
        __Pyx_INCREF(__pyx_v_raw_ts);
        __pyx_t_6 = __pyx_v_raw_ts;
        goto __pyx_L25_bool_binop_done;
      }
      if (unlikely(!__pyx_v_raw_ts)) { __Pyx_RaiseUnboundLocalError("raw_ts"); __PYX_ERR(0, 1438, __pyx_L3_error) }
      __pyx_t_5 = PyNumber_Subtract(__pyx_v_now, __pyx_v_raw_ts); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1438, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_WINDOWS_RAW_CONFIRM_WINDOW); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1438, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1438, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_6 = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_L25_bool_binop_done:;
      __pyx_v_raw_recent = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "ws_package/utils/hardware_event_validator.py":1440
 *             raw_recent = raw_ts and (now - raw_ts) < WINDOWS_RAW_CONFIRM_WINDOW
 * 
 *             if syn_recent:             # <<<<<<<<<<<<<<
 *                 return False
 *             if raw_recent:
*/
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_syn_recent); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 1440, __pyx_L3_error)
      if (__pyx_t_15) {

        /* "ws_package/utils/hardware_event_validator.py":1441
 * 
 *             if syn_recent:
 *                 return False             # <<<<<<<<<<<<<<
 *             if raw_recent:
 *                 return True
*/
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_False);
        __pyx_r = Py_False;
        goto __pyx_L7_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1440
 *             raw_recent = raw_ts and (now - raw_ts) < WINDOWS_RAW_CONFIRM_WINDOW
 * 
 *             if syn_recent:             # <<<<<<<<<<<<<<
 *                 return False
 *             if raw_recent:
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1442
 *             if syn_recent:
 *                 return False
 *             if raw_recent:             # <<<<<<<<<<<<<<
 *                 return True
 *             if self._automation_process_active():
*/
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_raw_recent); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 1442, __pyx_L3_error)
      if (__pyx_t_15) {

        /* "ws_package/utils/hardware_event_validator.py":1443
 *                 return False
 *             if raw_recent:
 *                 return True             # <<<<<<<<<<<<<<
 *             if self._automation_process_active():
 *                 return False
*/
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_True);
        __pyx_r = Py_True;
        goto __pyx_L7_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1442
 *             if syn_recent:
 *                 return False
 *             if raw_recent:             # <<<<<<<<<<<<<<
 *                 return True
 *             if self._automation_process_active():
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1444
 *             if raw_recent:
 *                 return True
 *             if self._automation_process_active():             # <<<<<<<<<<<<<<
 *                 return False
 *             if self._windows_raw_input_active:
*/
      __pyx_t_7 = __pyx_v_self;
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
        __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_automation_process_active, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1444, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 1444, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_15) {

        /* "ws_package/utils/hardware_event_validator.py":1445
 *                 return True
 *             if self._automation_process_active():
 *                 return False             # <<<<<<<<<<<<<<
 *             if self._windows_raw_input_active:
 *                 return False
*/
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_False);
        __pyx_r = Py_False;
        goto __pyx_L7_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1444
 *             if raw_recent:
 *                 return True
 *             if self._automation_process_active():             # <<<<<<<<<<<<<<
 *                 return False
 *             if self._windows_raw_input_active:
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1446
 *             if self._automation_process_active():
 *                 return False
 *             if self._windows_raw_input_active:             # <<<<<<<<<<<<<<
 *                 return False
 *             return None
*/
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_raw_input_active); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1446, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 1446, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_15) {

        /* "ws_package/utils/hardware_event_validator.py":1447
 *                 return False
 *             if self._windows_raw_input_active:
 *                 return False             # <<<<<<<<<<<<<<
 *             return None
 *         except Exception:
*/
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_False);
        __pyx_r = Py_False;
        goto __pyx_L7_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1446
 *             if self._automation_process_active():
 *                 return False
 *             if self._windows_raw_input_active:             # <<<<<<<<<<<<<<
 *                 return False
 *             return None
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1448
 *             if self._windows_raw_input_active:
 *                 return False
 *             return None             # <<<<<<<<<<<<<<
 *         except Exception:
 *             return None
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
      goto __pyx_L7_try_return;

      /* "ws_package/utils/hardware_event_validator.py":1431
 *         Physical mice emit WM_INPUT raw events; SetCursorPos does not.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             now = time.time()
 *             with self._windows_lock:
*/
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1449
 *                 return False
 *             return None
 *         except Exception:             # <<<<<<<<<<<<<<
 *             return None
 * 
*/
    __pyx_t_16 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_16) {
      __Pyx_ErrRestore(0,0,0);

      /* "ws_package/utils/hardware_event_validator.py":1450
 *             return None
 *         except Exception:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def _check_windows_scroll(self) -> Optional[bool]:
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;

    /* "ws_package/utils/hardware_event_validator.py":1431
 *         Physical mice emit WM_INPUT raw events; SetCursorPos does not.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             now = time.time()
 *             with self._windows_lock:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "ws_package/utils/hardware_event_validator.py":1425
 *             return None  # Fail-safe: accept event
 * 
 *     def _check_windows_mouse_move(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Windows mouse moves: pyautogui.moveTo uses SetCursorPos (no LLMHF_INJECTED).
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_windows_mouse_move", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_now);
  __Pyx_XDECREF(__pyx_v_syn_ts);
  __Pyx_XDECREF(__pyx_v_raw_ts);
  __Pyx_XDECREF(__pyx_v_syn_recent);
  __Pyx_XDECREF(__pyx_v_raw_recent);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1452
 *             return None
 * 
 *     def _check_windows_scroll(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """Windows: wheel events get a dedicated stamp (trackpad quirk)."""
 *         try:
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_79_check_windows_scroll(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_78_check_windows_scroll, "Windows: wheel events get a dedicated stamp (trackpad quirk).");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_79_check_windows_scroll = {"_check_windows_scroll", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_79_check_windows_scroll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_78_check_windows_scroll};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_79_check_windows_scroll(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_check_windows_scroll (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1452, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1452, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_check_windows_scroll", 0) < (0)) __PYX_ERR(0, 1452, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_check_windows_scroll", 1, 1, 1, i); __PYX_ERR(0, 1452, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1452, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_windows_scroll", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1452, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_windows_scroll", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_78_check_windows_scroll(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_78_check_windows_scroll(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_now = NULL;
  PyObject *__pyx_v_scroll_ts = NULL;
  PyObject *__pyx_v_hw_ts = NULL;
  PyObject *__pyx_v_syn_ts = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_windows_scroll", 0);

  /* "ws_package/utils/hardware_event_validator.py":1454
 *     def _check_windows_scroll(self) -> Optional[bool]:
 *         """Windows: wheel events get a dedicated stamp (trackpad quirk)."""
 *         try:             # <<<<<<<<<<<<<<
 *             now = time.time()
 *             with self._windows_lock:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":1455
 *         """Windows: wheel events get a dedicated stamp (trackpad quirk)."""
 *         try:
 *             now = time.time()             # <<<<<<<<<<<<<<
 *             with self._windows_lock:
 *                 scroll_ts = self._windows_last_hw_scroll_ts
*/
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1455, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1455, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1455, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_v_now = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "ws_package/utils/hardware_event_validator.py":1456
 *         try:
 *             now = time.time()
 *             with self._windows_lock:             # <<<<<<<<<<<<<<
 *                 scroll_ts = self._windows_last_hw_scroll_ts
 *                 hw_ts = self._windows_last_hw_mouse_ts
*/
      /*with:*/ {
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_lock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1456, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1456, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_5 = NULL;
        __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1456, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = 1;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          assert(__pyx_t_5);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
          __pyx_t_8 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
          __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1456, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*try:*/ {
          {
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
            __Pyx_XGOTREF(__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_11);
            __Pyx_XGOTREF(__pyx_t_12);
            /*try:*/ {

              /* "ws_package/utils/hardware_event_validator.py":1457
 *             now = time.time()
 *             with self._windows_lock:
 *                 scroll_ts = self._windows_last_hw_scroll_ts             # <<<<<<<<<<<<<<
 *                 hw_ts = self._windows_last_hw_mouse_ts
 *                 syn_ts = self._windows_last_syn_mouse_ts
*/
              __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_hw_scroll_ts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1457, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_v_scroll_ts = __pyx_t_4;
              __pyx_t_4 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1458
 *             with self._windows_lock:
 *                 scroll_ts = self._windows_last_hw_scroll_ts
 *                 hw_ts = self._windows_last_hw_mouse_ts             # <<<<<<<<<<<<<<
 *                 syn_ts = self._windows_last_syn_mouse_ts
 *             if scroll_ts and (now - scroll_ts) < WINDOWS_HW_CONFIRM_WINDOW:
*/
              __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_hw_mouse_ts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1458, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_v_hw_ts = __pyx_t_4;
              __pyx_t_4 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1459
 *                 scroll_ts = self._windows_last_hw_scroll_ts
 *                 hw_ts = self._windows_last_hw_mouse_ts
 *                 syn_ts = self._windows_last_syn_mouse_ts             # <<<<<<<<<<<<<<
 *             if scroll_ts and (now - scroll_ts) < WINDOWS_HW_CONFIRM_WINDOW:
 *                 return True
*/
              __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_windows_last_syn_mouse_ts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1459, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_v_syn_ts = __pyx_t_4;
              __pyx_t_4 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1456
 *         try:
 *             now = time.time()
 *             with self._windows_lock:             # <<<<<<<<<<<<<<
 *                 scroll_ts = self._windows_last_hw_scroll_ts
 *                 hw_ts = self._windows_last_hw_mouse_ts
*/
            }
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L18_try_end;
            __pyx_L13_error:;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            /*except:*/ {
              __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_windows_scroll", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(0, 1456, __pyx_L15_except_error)
              __Pyx_XGOTREF(__pyx_t_4);
              __Pyx_XGOTREF(__pyx_t_7);
              __Pyx_XGOTREF(__pyx_t_6);
              __pyx_t_5 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1456, __pyx_L15_except_error)
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1456, __pyx_L15_except_error)
              __Pyx_GOTREF(__pyx_t_13);
              __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_13);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              if (__pyx_t_14 < (0)) __PYX_ERR(0, 1456, __pyx_L15_except_error)
              __pyx_t_15 = (!__pyx_t_14);
              if (unlikely(__pyx_t_15)) {
                __Pyx_GIVEREF(__pyx_t_4);
                __Pyx_GIVEREF(__pyx_t_7);
                __Pyx_XGIVEREF(__pyx_t_6);
                __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_7, __pyx_t_6);
                __pyx_t_4 = 0;  __pyx_t_7 = 0;  __pyx_t_6 = 0; 
                __PYX_ERR(0, 1456, __pyx_L15_except_error)
              }
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              goto __pyx_L14_exception_handled;
            }
            __pyx_L15_except_error:;
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
            goto __pyx_L3_error;
            __pyx_L14_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
            __pyx_L18_try_end:;
          }
        }
        /*finally:*/ {
          /*normal exit:*/{
            if (__pyx_t_9) {
              __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_mstate_global->__pyx_tuple[2], NULL);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1456, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
            goto __pyx_L12;
          }
          __pyx_L12:;
        }
        goto __pyx_L22;
        __pyx_L9_error:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L3_error;
        __pyx_L22:;
      }

      /* "ws_package/utils/hardware_event_validator.py":1460
 *                 hw_ts = self._windows_last_hw_mouse_ts
 *                 syn_ts = self._windows_last_syn_mouse_ts
 *             if scroll_ts and (now - scroll_ts) < WINDOWS_HW_CONFIRM_WINDOW:             # <<<<<<<<<<<<<<
 *                 return True
 *             return self._resolve_windows_input(hw_ts, syn_ts)
*/
      if (unlikely(!__pyx_v_scroll_ts)) { __Pyx_RaiseUnboundLocalError("scroll_ts"); __PYX_ERR(0, 1460, __pyx_L3_error) }
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_scroll_ts); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1460, __pyx_L3_error)
      if (__pyx_t_14) {
      } else {
        __pyx_t_15 = __pyx_t_14;
        goto __pyx_L24_bool_binop_done;
      }
      if (unlikely(!__pyx_v_scroll_ts)) { __Pyx_RaiseUnboundLocalError("scroll_ts"); __PYX_ERR(0, 1460, __pyx_L3_error) }
      __pyx_t_6 = PyNumber_Subtract(__pyx_v_now, __pyx_v_scroll_ts); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1460, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_WINDOWS_HW_CONFIRM_WINDOW); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1460, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1460, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1460, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_15 = __pyx_t_14;
      __pyx_L24_bool_binop_done:;
      if (__pyx_t_15) {

        /* "ws_package/utils/hardware_event_validator.py":1461
 *                 syn_ts = self._windows_last_syn_mouse_ts
 *             if scroll_ts and (now - scroll_ts) < WINDOWS_HW_CONFIRM_WINDOW:
 *                 return True             # <<<<<<<<<<<<<<
 *             return self._resolve_windows_input(hw_ts, syn_ts)
 *         except Exception:
*/
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_True);
        __pyx_r = Py_True;
        goto __pyx_L7_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1460
 *                 hw_ts = self._windows_last_hw_mouse_ts
 *                 syn_ts = self._windows_last_syn_mouse_ts
 *             if scroll_ts and (now - scroll_ts) < WINDOWS_HW_CONFIRM_WINDOW:             # <<<<<<<<<<<<<<
 *                 return True
 *             return self._resolve_windows_input(hw_ts, syn_ts)
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1462
 *             if scroll_ts and (now - scroll_ts) < WINDOWS_HW_CONFIRM_WINDOW:
 *                 return True
 *             return self._resolve_windows_input(hw_ts, syn_ts)             # <<<<<<<<<<<<<<
 *         except Exception:
 *             return None
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_7 = __pyx_v_self;
      __Pyx_INCREF(__pyx_t_7);
      if (unlikely(!__pyx_v_hw_ts)) { __Pyx_RaiseUnboundLocalError("hw_ts"); __PYX_ERR(0, 1462, __pyx_L3_error) }
      if (unlikely(!__pyx_v_syn_ts)) { __Pyx_RaiseUnboundLocalError("syn_ts"); __PYX_ERR(0, 1462, __pyx_L3_error) }
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_hw_ts, __pyx_v_syn_ts};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_resolve_windows_input, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1462, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      if (!(likely(PyBool_Check(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bool", __pyx_t_4))) __PYX_ERR(0, 1462, __pyx_L3_error)
      __pyx_r = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "ws_package/utils/hardware_event_validator.py":1454
 *     def _check_windows_scroll(self) -> Optional[bool]:
 *         """Windows: wheel events get a dedicated stamp (trackpad quirk)."""
 *         try:             # <<<<<<<<<<<<<<
 *             now = time.time()
 *             with self._windows_lock:
*/
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1463
 *                 return True
 *             return self._resolve_windows_input(hw_ts, syn_ts)
 *         except Exception:             # <<<<<<<<<<<<<<
 *             return None
 * 
*/
    __pyx_t_16 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_16) {
      __Pyx_ErrRestore(0,0,0);

      /* "ws_package/utils/hardware_event_validator.py":1464
 *             return self._resolve_windows_input(hw_ts, syn_ts)
 *         except Exception:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def _check_macos_keyboard(self) -> Optional[bool]:
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;

    /* "ws_package/utils/hardware_event_validator.py":1454
 *     def _check_windows_scroll(self) -> Optional[bool]:
 *         """Windows: wheel events get a dedicated stamp (trackpad quirk)."""
 *         try:             # <<<<<<<<<<<<<<
 *             now = time.time()
 *             with self._windows_lock:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "ws_package/utils/hardware_event_validator.py":1452
 *             return None
 * 
 *     def _check_windows_scroll(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """Windows: wheel events get a dedicated stamp (trackpad quirk)."""
 *         try:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_windows_scroll", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_now);
  __Pyx_XDECREF(__pyx_v_scroll_ts);
  __Pyx_XDECREF(__pyx_v_hw_ts);
  __Pyx_XDECREF(__pyx_v_syn_ts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1466
 *             return None
 * 
 *     def _check_macos_keyboard(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """macOS: Check if keyboard event is from HID system"""
 *         try:
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_81_check_macos_keyboard(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_80_check_macos_keyboard, "macOS: Check if keyboard event is from HID system");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_81_check_macos_keyboard = {"_check_macos_keyboard", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_81_check_macos_keyboard, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_80_check_macos_keyboard};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_81_check_macos_keyboard(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_check_macos_keyboard (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1466, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1466, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_check_macos_keyboard", 0) < (0)) __PYX_ERR(0, 1466, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_check_macos_keyboard", 1, 1, 1, i); __PYX_ERR(0, 1466, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1466, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_macos_keyboard", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1466, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_macos_keyboard", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_80_check_macos_keyboard(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_80_check_macos_keyboard(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_event_data = NULL;
  PyObject *__pyx_v_current_time = NULL;
  PyObject *__pyx_v_source_id = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_macos_keyboard", 0);

  /* "ws_package/utils/hardware_event_validator.py":1468
 *     def _check_macos_keyboard(self) -> Optional[bool]:
 *         """macOS: Check if keyboard event is from HID system"""
 *         try:             # <<<<<<<<<<<<<<
 *             if not self._macos_quartz_available:
 *                 return None
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":1469
 *         """macOS: Check if keyboard event is from HID system"""
 *         try:
 *             if not self._macos_quartz_available:             # <<<<<<<<<<<<<<
 *                 return None
 * 
*/
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_quartz_available); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1469, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1469, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = (!__pyx_t_5);
      if (__pyx_t_6) {

        /* "ws_package/utils/hardware_event_validator.py":1470
 *         try:
 *             if not self._macos_quartz_available:
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *             with self._macos_lock:
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
        goto __pyx_L7_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1469
 *         """macOS: Check if keyboard event is from HID system"""
 *         try:
 *             if not self._macos_quartz_available:             # <<<<<<<<<<<<<<
 *                 return None
 * 
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1472
 *                 return None
 * 
 *             with self._macos_lock:             # <<<<<<<<<<<<<<
 *                 event_data = self._macos_last_keyboard_event.copy()
 * 
*/
      /*with:*/ {
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_lock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1472, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1472, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_9 = NULL;
        __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1472, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = 1;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
          assert(__pyx_t_9);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
          __pyx_t_11 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
          __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1472, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*try:*/ {
          {
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
            __Pyx_XGOTREF(__pyx_t_12);
            __Pyx_XGOTREF(__pyx_t_13);
            __Pyx_XGOTREF(__pyx_t_14);
            /*try:*/ {

              /* "ws_package/utils/hardware_event_validator.py":1473
 * 
 *             with self._macos_lock:
 *                 event_data = self._macos_last_keyboard_event.copy()             # <<<<<<<<<<<<<<
 * 
 *             current_time = time.time()
*/
              __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_last_keyboard_event); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1473, __pyx_L14_error)
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_8 = __pyx_t_10;
              __Pyx_INCREF(__pyx_t_8);
              __pyx_t_11 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
                __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1473, __pyx_L14_error)
                __Pyx_GOTREF(__pyx_t_4);
              }
              __pyx_v_event_data = __pyx_t_4;
              __pyx_t_4 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1472
 *                 return None
 * 
 *             with self._macos_lock:             # <<<<<<<<<<<<<<
 *                 event_data = self._macos_last_keyboard_event.copy()
 * 
*/
            }
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            goto __pyx_L19_try_end;
            __pyx_L14_error:;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            /*except:*/ {
              __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_macos_keyboard", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_8) < 0) __PYX_ERR(0, 1472, __pyx_L16_except_error)
              __Pyx_XGOTREF(__pyx_t_4);
              __Pyx_XGOTREF(__pyx_t_10);
              __Pyx_XGOTREF(__pyx_t_8);
              __pyx_t_9 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1472, __pyx_L16_except_error)
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1472, __pyx_L16_except_error)
              __Pyx_GOTREF(__pyx_t_15);
              __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_15);
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
              if (__pyx_t_6 < (0)) __PYX_ERR(0, 1472, __pyx_L16_except_error)
              __pyx_t_5 = (!__pyx_t_6);
              if (unlikely(__pyx_t_5)) {
                __Pyx_GIVEREF(__pyx_t_4);
                __Pyx_GIVEREF(__pyx_t_10);
                __Pyx_XGIVEREF(__pyx_t_8);
                __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_10, __pyx_t_8);
                __pyx_t_4 = 0;  __pyx_t_10 = 0;  __pyx_t_8 = 0; 
                __PYX_ERR(0, 1472, __pyx_L16_except_error)
              }
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              goto __pyx_L15_exception_handled;
            }
            __pyx_L16_except_error:;
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
            goto __pyx_L3_error;
            __pyx_L15_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
            __pyx_L19_try_end:;
          }
        }
        /*finally:*/ {
          /*normal exit:*/{
            if (__pyx_t_7) {
              __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[2], NULL);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1472, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            }
            goto __pyx_L13;
          }
          __pyx_L13:;
        }
        goto __pyx_L23;
        __pyx_L10_error:;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L3_error;
        __pyx_L23:;
      }

      /* "ws_package/utils/hardware_event_validator.py":1475
 *                 event_data = self._macos_last_keyboard_event.copy()
 * 
 *             current_time = time.time()             # <<<<<<<<<<<<<<
 * 
 *             # Check if we have recent event data (within 200ms)
*/
      __pyx_t_10 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1475, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1475, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_11 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        assert(__pyx_t_10);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
        __pyx_t_11 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
        __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1475, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __pyx_v_current_time = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "ws_package/utils/hardware_event_validator.py":1478
 * 
 *             # Check if we have recent event data (within 200ms)
 *             if event_data.get('timestamp') and (current_time - event_data['timestamp']) < 0.2:             # <<<<<<<<<<<<<<
 *                 source_id = event_data.get('source_id')
 *                 if source_id is not None:
*/
      if (unlikely(!__pyx_v_event_data)) { __Pyx_RaiseUnboundLocalError("event_data"); __PYX_ERR(0, 1478, __pyx_L3_error) }
      __pyx_t_9 = __pyx_v_event_data;
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_11 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_n_u_timestamp};
        __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1478, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1478, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_6) {
      } else {
        __pyx_t_5 = __pyx_t_6;
        goto __pyx_L25_bool_binop_done;
      }
      if (unlikely(!__pyx_v_event_data)) { __Pyx_RaiseUnboundLocalError("event_data"); __PYX_ERR(0, 1478, __pyx_L3_error) }
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_event_data, __pyx_mstate_global->__pyx_n_u_timestamp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1478, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = PyNumber_Subtract(__pyx_v_current_time, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1478, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_mstate_global->__pyx_float_0_2, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1478, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1478, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_5 = __pyx_t_6;
      __pyx_L25_bool_binop_done:;
      if (__pyx_t_5) {

        /* "ws_package/utils/hardware_event_validator.py":1479
 *             # Check if we have recent event data (within 200ms)
 *             if event_data.get('timestamp') and (current_time - event_data['timestamp']) < 0.2:
 *                 source_id = event_data.get('source_id')             # <<<<<<<<<<<<<<
 *                 if source_id is not None:
 *                     # Hardware events have source ID = 1 (HIDSystemState)
*/
        if (unlikely(!__pyx_v_event_data)) { __Pyx_RaiseUnboundLocalError("event_data"); __PYX_ERR(0, 1479, __pyx_L3_error) }
        __pyx_t_9 = __pyx_v_event_data;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_11 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_n_u_source_id};
          __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1479, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_8);
        }
        __pyx_v_source_id = __pyx_t_8;
        __pyx_t_8 = 0;

        /* "ws_package/utils/hardware_event_validator.py":1480
 *             if event_data.get('timestamp') and (current_time - event_data['timestamp']) < 0.2:
 *                 source_id = event_data.get('source_id')
 *                 if source_id is not None:             # <<<<<<<<<<<<<<
 *                     # Hardware events have source ID = 1 (HIDSystemState)
 *                     # Synthetic events have different source IDs
*/
        __pyx_t_5 = (__pyx_v_source_id != Py_None);
        if (__pyx_t_5) {

          /* "ws_package/utils/hardware_event_validator.py":1483
 *                     # Hardware events have source ID = 1 (HIDSystemState)
 *                     # Synthetic events have different source IDs
 *                     if source_id == 1:  # kCGEventSourceStateHIDSystemState             # <<<<<<<<<<<<<<
 *                         return True   # Hardware event - count it
 *                     else:
*/
          __pyx_t_5 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_source_id, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1483, __pyx_L3_error)
          if (__pyx_t_5) {

            /* "ws_package/utils/hardware_event_validator.py":1484
 *                     # Synthetic events have different source IDs
 *                     if source_id == 1:  # kCGEventSourceStateHIDSystemState
 *                         return True   # Hardware event - count it             # <<<<<<<<<<<<<<
 *                     else:
 *                         return False  # Synthetic event - filter it
*/
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(Py_True);
            __pyx_r = Py_True;
            goto __pyx_L7_try_return;

            /* "ws_package/utils/hardware_event_validator.py":1483
 *                     # Hardware events have source ID = 1 (HIDSystemState)
 *                     # Synthetic events have different source IDs
 *                     if source_id == 1:  # kCGEventSourceStateHIDSystemState             # <<<<<<<<<<<<<<
 *                         return True   # Hardware event - count it
 *                     else:
*/
          }

          /* "ws_package/utils/hardware_event_validator.py":1486
 *                         return True   # Hardware event - count it
 *                     else:
 *                         return False  # Synthetic event - filter it             # <<<<<<<<<<<<<<
 * 
 *             # No recent data available - fail-safe: accept event
*/
          /*else*/ {
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(Py_False);
            __pyx_r = Py_False;
            goto __pyx_L7_try_return;
          }

          /* "ws_package/utils/hardware_event_validator.py":1480
 *             if event_data.get('timestamp') and (current_time - event_data['timestamp']) < 0.2:
 *                 source_id = event_data.get('source_id')
 *                 if source_id is not None:             # <<<<<<<<<<<<<<
 *                     # Hardware events have source ID = 1 (HIDSystemState)
 *                     # Synthetic events have different source IDs
*/
        }

        /* "ws_package/utils/hardware_event_validator.py":1478
 * 
 *             # Check if we have recent event data (within 200ms)
 *             if event_data.get('timestamp') and (current_time - event_data['timestamp']) < 0.2:             # <<<<<<<<<<<<<<
 *                 source_id = event_data.get('source_id')
 *                 if source_id is not None:
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1489
 * 
 *             # No recent data available - fail-safe: accept event
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         except Exception:
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
      goto __pyx_L7_try_return;

      /* "ws_package/utils/hardware_event_validator.py":1468
 *     def _check_macos_keyboard(self) -> Optional[bool]:
 *         """macOS: Check if keyboard event is from HID system"""
 *         try:             # <<<<<<<<<<<<<<
 *             if not self._macos_quartz_available:
 *                 return None
*/
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1491
 *             return None
 * 
 *         except Exception:             # <<<<<<<<<<<<<<
 *             return None  # Fail-safe: accept event
 * 
*/
    __pyx_t_16 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_16) {
      __Pyx_ErrRestore(0,0,0);

      /* "ws_package/utils/hardware_event_validator.py":1492
 * 
 *         except Exception:
 *             return None  # Fail-safe: accept event             # <<<<<<<<<<<<<<
 * 
 *     def _check_macos_mouse(self) -> Optional[bool]:
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;

    /* "ws_package/utils/hardware_event_validator.py":1468
 *     def _check_macos_keyboard(self) -> Optional[bool]:
 *         """macOS: Check if keyboard event is from HID system"""
 *         try:             # <<<<<<<<<<<<<<
 *             if not self._macos_quartz_available:
 *                 return None
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "ws_package/utils/hardware_event_validator.py":1466
 *             return None
 * 
 *     def _check_macos_keyboard(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """macOS: Check if keyboard event is from HID system"""
 *         try:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_macos_keyboard", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_event_data);
  __Pyx_XDECREF(__pyx_v_current_time);
  __Pyx_XDECREF(__pyx_v_source_id);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1494
 *             return None  # Fail-safe: accept event
 * 
 *     def _check_macos_mouse(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """macOS: Check if mouse event is from HID system"""
 *         try:
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_83_check_macos_mouse(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_82_check_macos_mouse, "macOS: Check if mouse event is from HID system");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_83_check_macos_mouse = {"_check_macos_mouse", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_83_check_macos_mouse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_82_check_macos_mouse};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_83_check_macos_mouse(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_check_macos_mouse (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1494, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1494, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_check_macos_mouse", 0) < (0)) __PYX_ERR(0, 1494, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_check_macos_mouse", 1, 1, 1, i); __PYX_ERR(0, 1494, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1494, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_macos_mouse", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1494, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_macos_mouse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_82_check_macos_mouse(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_82_check_macos_mouse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_event_data = NULL;
  PyObject *__pyx_v_current_time = NULL;
  PyObject *__pyx_v_source_id = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_macos_mouse", 0);

  /* "ws_package/utils/hardware_event_validator.py":1496
 *     def _check_macos_mouse(self) -> Optional[bool]:
 *         """macOS: Check if mouse event is from HID system"""
 *         try:             # <<<<<<<<<<<<<<
 *             if not self._macos_quartz_available:
 *                 return None
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":1497
 *         """macOS: Check if mouse event is from HID system"""
 *         try:
 *             if not self._macos_quartz_available:             # <<<<<<<<<<<<<<
 *                 return None
 * 
*/
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_quartz_available); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1497, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1497, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = (!__pyx_t_5);
      if (__pyx_t_6) {

        /* "ws_package/utils/hardware_event_validator.py":1498
 *         try:
 *             if not self._macos_quartz_available:
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *             with self._macos_lock:
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
        goto __pyx_L7_try_return;

        /* "ws_package/utils/hardware_event_validator.py":1497
 *         """macOS: Check if mouse event is from HID system"""
 *         try:
 *             if not self._macos_quartz_available:             # <<<<<<<<<<<<<<
 *                 return None
 * 
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1500
 *                 return None
 * 
 *             with self._macos_lock:             # <<<<<<<<<<<<<<
 *                 event_data = self._macos_last_mouse_event.copy()
 * 
*/
      /*with:*/ {
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_lock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1500, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1500, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_9 = NULL;
        __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1500, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = 1;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
          assert(__pyx_t_9);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
          __pyx_t_11 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
          __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1500, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*try:*/ {
          {
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
            __Pyx_XGOTREF(__pyx_t_12);
            __Pyx_XGOTREF(__pyx_t_13);
            __Pyx_XGOTREF(__pyx_t_14);
            /*try:*/ {

              /* "ws_package/utils/hardware_event_validator.py":1501
 * 
 *             with self._macos_lock:
 *                 event_data = self._macos_last_mouse_event.copy()             # <<<<<<<<<<<<<<
 * 
 *             current_time = time.time()
*/
              __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_macos_last_mouse_event); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1501, __pyx_L14_error)
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_8 = __pyx_t_10;
              __Pyx_INCREF(__pyx_t_8);
              __pyx_t_11 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
                __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1501, __pyx_L14_error)
                __Pyx_GOTREF(__pyx_t_4);
              }
              __pyx_v_event_data = __pyx_t_4;
              __pyx_t_4 = 0;

              /* "ws_package/utils/hardware_event_validator.py":1500
 *                 return None
 * 
 *             with self._macos_lock:             # <<<<<<<<<<<<<<
 *                 event_data = self._macos_last_mouse_event.copy()
 * 
*/
            }
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            goto __pyx_L19_try_end;
            __pyx_L14_error:;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            /*except:*/ {
              __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_macos_mouse", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_8) < 0) __PYX_ERR(0, 1500, __pyx_L16_except_error)
              __Pyx_XGOTREF(__pyx_t_4);
              __Pyx_XGOTREF(__pyx_t_10);
              __Pyx_XGOTREF(__pyx_t_8);
              __pyx_t_9 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1500, __pyx_L16_except_error)
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1500, __pyx_L16_except_error)
              __Pyx_GOTREF(__pyx_t_15);
              __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_15);
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
              if (__pyx_t_6 < (0)) __PYX_ERR(0, 1500, __pyx_L16_except_error)
              __pyx_t_5 = (!__pyx_t_6);
              if (unlikely(__pyx_t_5)) {
                __Pyx_GIVEREF(__pyx_t_4);
                __Pyx_GIVEREF(__pyx_t_10);
                __Pyx_XGIVEREF(__pyx_t_8);
                __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_10, __pyx_t_8);
                __pyx_t_4 = 0;  __pyx_t_10 = 0;  __pyx_t_8 = 0; 
                __PYX_ERR(0, 1500, __pyx_L16_except_error)
              }
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              goto __pyx_L15_exception_handled;
            }
            __pyx_L16_except_error:;
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
            goto __pyx_L3_error;
            __pyx_L15_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
            __pyx_L19_try_end:;
          }
        }
        /*finally:*/ {
          /*normal exit:*/{
            if (__pyx_t_7) {
              __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[2], NULL);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1500, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            }
            goto __pyx_L13;
          }
          __pyx_L13:;
        }
        goto __pyx_L23;
        __pyx_L10_error:;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L3_error;
        __pyx_L23:;
      }

      /* "ws_package/utils/hardware_event_validator.py":1503
 *                 event_data = self._macos_last_mouse_event.copy()
 * 
 *             current_time = time.time()             # <<<<<<<<<<<<<<
 * 
 *             # Check if we have recent event data (within 200ms)
*/
      __pyx_t_10 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1503, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1503, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_11 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        assert(__pyx_t_10);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
        __pyx_t_11 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
        __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1503, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __pyx_v_current_time = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "ws_package/utils/hardware_event_validator.py":1506
 * 
 *             # Check if we have recent event data (within 200ms)
 *             if event_data.get('timestamp') and (current_time - event_data['timestamp']) < 0.2:             # <<<<<<<<<<<<<<
 *                 source_id = event_data.get('source_id')
 *                 if source_id is not None:
*/
      if (unlikely(!__pyx_v_event_data)) { __Pyx_RaiseUnboundLocalError("event_data"); __PYX_ERR(0, 1506, __pyx_L3_error) }
      __pyx_t_9 = __pyx_v_event_data;
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_11 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_n_u_timestamp};
        __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1506, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1506, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_6) {
      } else {
        __pyx_t_5 = __pyx_t_6;
        goto __pyx_L25_bool_binop_done;
      }
      if (unlikely(!__pyx_v_event_data)) { __Pyx_RaiseUnboundLocalError("event_data"); __PYX_ERR(0, 1506, __pyx_L3_error) }
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_event_data, __pyx_mstate_global->__pyx_n_u_timestamp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1506, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = PyNumber_Subtract(__pyx_v_current_time, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1506, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_mstate_global->__pyx_float_0_2, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1506, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1506, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_5 = __pyx_t_6;
      __pyx_L25_bool_binop_done:;
      if (__pyx_t_5) {

        /* "ws_package/utils/hardware_event_validator.py":1507
 *             # Check if we have recent event data (within 200ms)
 *             if event_data.get('timestamp') and (current_time - event_data['timestamp']) < 0.2:
 *                 source_id = event_data.get('source_id')             # <<<<<<<<<<<<<<
 *                 if source_id is not None:
 *                     # Hardware events have source ID = 1 (HIDSystemState)
*/
        if (unlikely(!__pyx_v_event_data)) { __Pyx_RaiseUnboundLocalError("event_data"); __PYX_ERR(0, 1507, __pyx_L3_error) }
        __pyx_t_9 = __pyx_v_event_data;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_11 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_n_u_source_id};
          __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1507, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_8);
        }
        __pyx_v_source_id = __pyx_t_8;
        __pyx_t_8 = 0;

        /* "ws_package/utils/hardware_event_validator.py":1508
 *             if event_data.get('timestamp') and (current_time - event_data['timestamp']) < 0.2:
 *                 source_id = event_data.get('source_id')
 *                 if source_id is not None:             # <<<<<<<<<<<<<<
 *                     # Hardware events have source ID = 1 (HIDSystemState)
 *                     if source_id == 1:  # kCGEventSourceStateHIDSystemState
*/
        __pyx_t_5 = (__pyx_v_source_id != Py_None);
        if (__pyx_t_5) {

          /* "ws_package/utils/hardware_event_validator.py":1510
 *                 if source_id is not None:
 *                     # Hardware events have source ID = 1 (HIDSystemState)
 *                     if source_id == 1:  # kCGEventSourceStateHIDSystemState             # <<<<<<<<<<<<<<
 *                         return True   # Hardware event - count it
 *                     else:
*/
          __pyx_t_5 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_source_id, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1510, __pyx_L3_error)
          if (__pyx_t_5) {

            /* "ws_package/utils/hardware_event_validator.py":1511
 *                     # Hardware events have source ID = 1 (HIDSystemState)
 *                     if source_id == 1:  # kCGEventSourceStateHIDSystemState
 *                         return True   # Hardware event - count it             # <<<<<<<<<<<<<<
 *                     else:
 *                         return False  # Synthetic event - filter it
*/
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(Py_True);
            __pyx_r = Py_True;
            goto __pyx_L7_try_return;

            /* "ws_package/utils/hardware_event_validator.py":1510
 *                 if source_id is not None:
 *                     # Hardware events have source ID = 1 (HIDSystemState)
 *                     if source_id == 1:  # kCGEventSourceStateHIDSystemState             # <<<<<<<<<<<<<<
 *                         return True   # Hardware event - count it
 *                     else:
*/
          }

          /* "ws_package/utils/hardware_event_validator.py":1513
 *                         return True   # Hardware event - count it
 *                     else:
 *                         return False  # Synthetic event - filter it             # <<<<<<<<<<<<<<
 * 
 *             # No recent data available - fail-safe: accept event
*/
          /*else*/ {
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(Py_False);
            __pyx_r = Py_False;
            goto __pyx_L7_try_return;
          }

          /* "ws_package/utils/hardware_event_validator.py":1508
 *             if event_data.get('timestamp') and (current_time - event_data['timestamp']) < 0.2:
 *                 source_id = event_data.get('source_id')
 *                 if source_id is not None:             # <<<<<<<<<<<<<<
 *                     # Hardware events have source ID = 1 (HIDSystemState)
 *                     if source_id == 1:  # kCGEventSourceStateHIDSystemState
*/
        }

        /* "ws_package/utils/hardware_event_validator.py":1506
 * 
 *             # Check if we have recent event data (within 200ms)
 *             if event_data.get('timestamp') and (current_time - event_data['timestamp']) < 0.2:             # <<<<<<<<<<<<<<
 *                 source_id = event_data.get('source_id')
 *                 if source_id is not None:
*/
      }

      /* "ws_package/utils/hardware_event_validator.py":1516
 * 
 *             # No recent data available - fail-safe: accept event
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         except Exception:
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
      goto __pyx_L7_try_return;

      /* "ws_package/utils/hardware_event_validator.py":1496
 *     def _check_macos_mouse(self) -> Optional[bool]:
 *         """macOS: Check if mouse event is from HID system"""
 *         try:             # <<<<<<<<<<<<<<
 *             if not self._macos_quartz_available:
 *                 return None
*/
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1518
 *             return None
 * 
 *         except Exception:             # <<<<<<<<<<<<<<
 *             return None  # Fail-safe: accept event
 * 
*/
    __pyx_t_16 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_16) {
      __Pyx_ErrRestore(0,0,0);

      /* "ws_package/utils/hardware_event_validator.py":1519
 * 
 *         except Exception:
 *             return None  # Fail-safe: accept event             # <<<<<<<<<<<<<<
 * 
 *     def _linux_ts_recent(self, ts: float, now: float) -> bool:
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;

    /* "ws_package/utils/hardware_event_validator.py":1496
 *     def _check_macos_mouse(self) -> Optional[bool]:
 *         """macOS: Check if mouse event is from HID system"""
 *         try:             # <<<<<<<<<<<<<<
 *             if not self._macos_quartz_available:
 *                 return None
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "ws_package/utils/hardware_event_validator.py":1494
 *             return None  # Fail-safe: accept event
 * 
 *     def _check_macos_mouse(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """macOS: Check if mouse event is from HID system"""
 *         try:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_macos_mouse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_event_data);
  __Pyx_XDECREF(__pyx_v_current_time);
  __Pyx_XDECREF(__pyx_v_source_id);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1521
 *             return None  # Fail-safe: accept event
 * 
 *     def _linux_ts_recent(self, ts: float, now: float) -> bool:             # <<<<<<<<<<<<<<
 *         return bool(ts) and (now - ts) < self._linux_correlation_window
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_85_linux_ts_recent(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_85_linux_ts_recent = {"_linux_ts_recent", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_85_linux_ts_recent, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_85_linux_ts_recent(PyObject *__pyx_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_self = 0;
  double __pyx_v_ts;
  double __pyx_v_now;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_linux_ts_recent (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_ts,&__pyx_mstate_global->__pyx_n_u_now,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1521, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1521, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1521, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1521, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_linux_ts_recent", 0) < (0)) __PYX_ERR(0, 1521, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_linux_ts_recent", 1, 3, 3, i); __PYX_ERR(0, 1521, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1521, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1521, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1521, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_ts = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_ts == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1521, __pyx_L3_error)
    __pyx_v_now = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_now == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1521, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_linux_ts_recent", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1521, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_ts_recent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_84_linux_ts_recent(__pyx_self, __pyx_v_self, __pyx_v_ts, __pyx_v_now);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_84_linux_ts_recent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, double __pyx_v_ts, double __pyx_v_now) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_linux_ts_recent", 0);

  /* "ws_package/utils/hardware_event_validator.py":1522
 * 
 *     def _linux_ts_recent(self, ts: float, now: float) -> bool:
 *         return bool(ts) and (now - ts) < self._linux_correlation_window             # <<<<<<<<<<<<<<
 * 
 *     def _check_linux_input_event(self, input_kind: str) -> Optional[bool]:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong((!(!(__pyx_v_ts != 0)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1522, __pyx_L1_error)
  if (__pyx_t_3) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_now - __pyx_v_ts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_correlation_window); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_1 = __pyx_t_5;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":1521
 *             return None  # Fail-safe: accept event
 * 
 *     def _linux_ts_recent(self, ts: float, now: float) -> bool:             # <<<<<<<<<<<<<<
 *         return bool(ts) and (now - ts) < self._linux_correlation_window
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._linux_ts_recent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1524
 *         return bool(ts) and (now - ts) < self._linux_correlation_window
 * 
 *     def _check_linux_input_event(self, input_kind: str) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Linux X11 dual-path validation (evdev + XI2 device class).
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_87_check_linux_input_event(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_86_check_linux_input_event, "\n        Linux X11 dual-path validation (evdev + XI2 device class).\n\n        Real input:    evdev event and/or XI2 physical slave device (Dell KB/mouse)\n        Scripted input: XI2 XTEST slave device (pyautogui/xdotool) \342\200\224 never evdev\n\n        Returns True (hardware), False (confirmed fake), None (uncertain \342\206\222 accept).\n        ");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_87_check_linux_input_event = {"_check_linux_input_event", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_87_check_linux_input_event, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_86_check_linux_input_event};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_87_check_linux_input_event(PyObject *__pyx_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_self = 0;
  PyObject *__pyx_v_input_kind = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_check_linux_input_event (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_input_kind,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1524, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1524, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1524, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_check_linux_input_event", 0) < (0)) __PYX_ERR(0, 1524, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_check_linux_input_event", 1, 2, 2, i); __PYX_ERR(0, 1524, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1524, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1524, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_input_kind = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_linux_input_event", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1524, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_linux_input_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input_kind), (&PyUnicode_Type), 0, "input_kind", 2))) __PYX_ERR(0, 1524, __pyx_L1_error)
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_86_check_linux_input_event(__pyx_self, __pyx_v_self, __pyx_v_input_kind);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_86_check_linux_input_event(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_input_kind) {
  PyObject *__pyx_v_now = NULL;
  PyObject *__pyx_v_keyboard_found = NULL;
  PyObject *__pyx_v_mouse_found = NULL;
  PyObject *__pyx_v_evdev_ts = NULL;
  PyObject *__pyx_v_xtest_ts = NULL;
  PyObject *__pyx_v_hw_ts = NULL;
  PyObject *__pyx_v_evdev_now = NULL;
  PyObject *__pyx_v_evdev_recent = NULL;
  PyObject *__pyx_v_hw_recent = NULL;
  PyObject *__pyx_v_xtest_recent = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_linux_input_event", 0);

  /* "ws_package/utils/hardware_event_validator.py":1533
 *         Returns True (hardware), False (confirmed fake), None (uncertain  accept).
 *         """
 *         now = time.time()             # <<<<<<<<<<<<<<
 *         keyboard_found, mouse_found = self._linux_drain_evdev()
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1533, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_now = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1534
 *         """
 *         now = time.time()
 *         keyboard_found, mouse_found = self._linux_drain_evdev()             # <<<<<<<<<<<<<<
 * 
 *         with self._linux_lock:
*/
  __pyx_t_4 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_linux_drain_evdev, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    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, 1534, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1534, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1534, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3);
    index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_3), 2) < (0)) __PYX_ERR(0, 1534, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1534, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_keyboard_found = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_mouse_found = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1536
 *         keyboard_found, mouse_found = self._linux_drain_evdev()
 * 
 *         with self._linux_lock:             # <<<<<<<<<<<<<<
 *             if input_kind == 'keyboard':
 *                 evdev_ts = self._linux_last_evdev_keyboard_ts
*/
  /*with:*/ {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = NULL;
    __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1536, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1536, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {

          /* "ws_package/utils/hardware_event_validator.py":1537
 * 
 *         with self._linux_lock:
 *             if input_kind == 'keyboard':             # <<<<<<<<<<<<<<
 *                 evdev_ts = self._linux_last_evdev_keyboard_ts
 *                 xtest_ts = self._linux_last_xtest_keyboard_ts
*/
          __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_input_kind, __pyx_mstate_global->__pyx_n_u_keyboard, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1537, __pyx_L9_error)
          if (__pyx_t_11) {

            /* "ws_package/utils/hardware_event_validator.py":1538
 *         with self._linux_lock:
 *             if input_kind == 'keyboard':
 *                 evdev_ts = self._linux_last_evdev_keyboard_ts             # <<<<<<<<<<<<<<
 *                 xtest_ts = self._linux_last_xtest_keyboard_ts
 *                 hw_ts = self._linux_last_hw_keyboard_ts
*/
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_evdev_keyboard_ts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1538, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_v_evdev_ts = __pyx_t_1;
            __pyx_t_1 = 0;

            /* "ws_package/utils/hardware_event_validator.py":1539
 *             if input_kind == 'keyboard':
 *                 evdev_ts = self._linux_last_evdev_keyboard_ts
 *                 xtest_ts = self._linux_last_xtest_keyboard_ts             # <<<<<<<<<<<<<<
 *                 hw_ts = self._linux_last_hw_keyboard_ts
 *                 evdev_now = keyboard_found
*/
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_xtest_keyboard_ts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1539, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_v_xtest_ts = __pyx_t_1;
            __pyx_t_1 = 0;

            /* "ws_package/utils/hardware_event_validator.py":1540
 *                 evdev_ts = self._linux_last_evdev_keyboard_ts
 *                 xtest_ts = self._linux_last_xtest_keyboard_ts
 *                 hw_ts = self._linux_last_hw_keyboard_ts             # <<<<<<<<<<<<<<
 *                 evdev_now = keyboard_found
 *             else:
*/
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_hw_keyboard_ts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_v_hw_ts = __pyx_t_1;
            __pyx_t_1 = 0;

            /* "ws_package/utils/hardware_event_validator.py":1541
 *                 xtest_ts = self._linux_last_xtest_keyboard_ts
 *                 hw_ts = self._linux_last_hw_keyboard_ts
 *                 evdev_now = keyboard_found             # <<<<<<<<<<<<<<
 *             else:
 *                 evdev_ts = self._linux_last_evdev_mouse_ts
*/
            __Pyx_INCREF(__pyx_v_keyboard_found);
            __pyx_v_evdev_now = __pyx_v_keyboard_found;

            /* "ws_package/utils/hardware_event_validator.py":1537
 * 
 *         with self._linux_lock:
 *             if input_kind == 'keyboard':             # <<<<<<<<<<<<<<
 *                 evdev_ts = self._linux_last_evdev_keyboard_ts
 *                 xtest_ts = self._linux_last_xtest_keyboard_ts
*/
            goto __pyx_L15;
          }

          /* "ws_package/utils/hardware_event_validator.py":1543
 *                 evdev_now = keyboard_found
 *             else:
 *                 evdev_ts = self._linux_last_evdev_mouse_ts             # <<<<<<<<<<<<<<
 *                 xtest_ts = self._linux_last_xtest_mouse_ts
 *                 hw_ts = self._linux_last_hw_mouse_ts
*/
          /*else*/ {
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_evdev_mouse_ts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_v_evdev_ts = __pyx_t_1;
            __pyx_t_1 = 0;

            /* "ws_package/utils/hardware_event_validator.py":1544
 *             else:
 *                 evdev_ts = self._linux_last_evdev_mouse_ts
 *                 xtest_ts = self._linux_last_xtest_mouse_ts             # <<<<<<<<<<<<<<
 *                 hw_ts = self._linux_last_hw_mouse_ts
 *                 evdev_now = mouse_found
*/
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_xtest_mouse_ts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1544, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_v_xtest_ts = __pyx_t_1;
            __pyx_t_1 = 0;

            /* "ws_package/utils/hardware_event_validator.py":1545
 *                 evdev_ts = self._linux_last_evdev_mouse_ts
 *                 xtest_ts = self._linux_last_xtest_mouse_ts
 *                 hw_ts = self._linux_last_hw_mouse_ts             # <<<<<<<<<<<<<<
 *                 evdev_now = mouse_found
 * 
*/
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_linux_last_hw_mouse_ts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1545, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_v_hw_ts = __pyx_t_1;
            __pyx_t_1 = 0;

            /* "ws_package/utils/hardware_event_validator.py":1546
 *                 xtest_ts = self._linux_last_xtest_mouse_ts
 *                 hw_ts = self._linux_last_hw_mouse_ts
 *                 evdev_now = mouse_found             # <<<<<<<<<<<<<<
 * 
 *         evdev_recent = evdev_now or self._linux_ts_recent(evdev_ts, now)
*/
            __Pyx_INCREF(__pyx_v_mouse_found);
            __pyx_v_evdev_now = __pyx_v_mouse_found;
          }
          __pyx_L15:;

          /* "ws_package/utils/hardware_event_validator.py":1536
 *         keyboard_found, mouse_found = self._linux_drain_evdev()
 * 
 *         with self._linux_lock:             # <<<<<<<<<<<<<<
 *             if input_kind == 'keyboard':
 *                 evdev_ts = self._linux_last_evdev_keyboard_ts
*/
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L14_try_end;
        __pyx_L9_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_linux_input_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 1536, __pyx_L11_except_error)
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_3);
          __pyx_t_4 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1536, __pyx_L11_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1536, __pyx_L11_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (__pyx_t_11 < (0)) __PYX_ERR(0, 1536, __pyx_L11_except_error)
          __pyx_t_13 = (!__pyx_t_11);
          if (unlikely(__pyx_t_13)) {
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_XGIVEREF(__pyx_t_3);
            __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_3);
            __pyx_t_1 = 0;  __pyx_t_2 = 0;  __pyx_t_3 = 0; 
            __PYX_ERR(0, 1536, __pyx_L11_except_error)
          }
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L10_exception_handled;
        }
        __pyx_L11_except_error:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L10_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L14_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_7) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[2], NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1536, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        goto __pyx_L8;
      }
      __pyx_L8:;
    }
    goto __pyx_L19;
    __pyx_L5_error:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L1_error;
    __pyx_L19:;
  }

  /* "ws_package/utils/hardware_event_validator.py":1548
 *                 evdev_now = mouse_found
 * 
 *         evdev_recent = evdev_now or self._linux_ts_recent(evdev_ts, now)             # <<<<<<<<<<<<<<
 *         hw_recent = self._linux_ts_recent(hw_ts, now)
 *         xtest_recent = self._linux_ts_recent(xtest_ts, now)
*/
  if (unlikely(!__pyx_v_evdev_now)) { __Pyx_RaiseUnboundLocalError("evdev_now"); __PYX_ERR(0, 1548, __pyx_L1_error) }
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_evdev_now); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1548, __pyx_L1_error)
  if (!__pyx_t_13) {
  } else {
    __Pyx_INCREF(__pyx_v_evdev_now);
    __pyx_t_3 = __pyx_v_evdev_now;
    goto __pyx_L20_bool_binop_done;
  }
  __pyx_t_1 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(!__pyx_v_evdev_ts)) { __Pyx_RaiseUnboundLocalError("evdev_ts"); __PYX_ERR(0, 1548, __pyx_L1_error) }
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_evdev_ts, __pyx_v_now};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_linux_ts_recent, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_L20_bool_binop_done:;
  __pyx_v_evdev_recent = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1549
 * 
 *         evdev_recent = evdev_now or self._linux_ts_recent(evdev_ts, now)
 *         hw_recent = self._linux_ts_recent(hw_ts, now)             # <<<<<<<<<<<<<<
 *         xtest_recent = self._linux_ts_recent(xtest_ts, now)
 * 
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  if (unlikely(!__pyx_v_hw_ts)) { __Pyx_RaiseUnboundLocalError("hw_ts"); __PYX_ERR(0, 1549, __pyx_L1_error) }
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_hw_ts, __pyx_v_now};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_linux_ts_recent, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_hw_recent = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1550
 *         evdev_recent = evdev_now or self._linux_ts_recent(evdev_ts, now)
 *         hw_recent = self._linux_ts_recent(hw_ts, now)
 *         xtest_recent = self._linux_ts_recent(xtest_ts, now)             # <<<<<<<<<<<<<<
 * 
 *         # Hardware confirmed on kernel (evdev) or X11 physical device path.
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  if (unlikely(!__pyx_v_xtest_ts)) { __Pyx_RaiseUnboundLocalError("xtest_ts"); __PYX_ERR(0, 1550, __pyx_L1_error) }
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_xtest_ts, __pyx_v_now};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_linux_ts_recent, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_xtest_recent = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1553
 * 
 *         # Hardware confirmed on kernel (evdev) or X11 physical device path.
 *         if evdev_recent or hw_recent:             # <<<<<<<<<<<<<<
 *             if xtest_recent and xtest_ts > max(evdev_ts, hw_ts):
 *                 return False
*/
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_evdev_recent); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1553, __pyx_L1_error)
  if (!__pyx_t_11) {
  } else {
    __pyx_t_13 = __pyx_t_11;
    goto __pyx_L23_bool_binop_done;
  }
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_hw_recent); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1553, __pyx_L1_error)
  __pyx_t_13 = __pyx_t_11;
  __pyx_L23_bool_binop_done:;
  if (__pyx_t_13) {

    /* "ws_package/utils/hardware_event_validator.py":1554
 *         # Hardware confirmed on kernel (evdev) or X11 physical device path.
 *         if evdev_recent or hw_recent:
 *             if xtest_recent and xtest_ts > max(evdev_ts, hw_ts):             # <<<<<<<<<<<<<<
 *                 return False
 *             return True
*/
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_xtest_recent); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1554, __pyx_L1_error)
    if (__pyx_t_11) {
    } else {
      __pyx_t_13 = __pyx_t_11;
      goto __pyx_L26_bool_binop_done;
    }
    if (unlikely(!__pyx_v_xtest_ts)) { __Pyx_RaiseUnboundLocalError("xtest_ts"); __PYX_ERR(0, 1554, __pyx_L1_error) }
    if (unlikely(!__pyx_v_hw_ts)) { __Pyx_RaiseUnboundLocalError("hw_ts"); __PYX_ERR(0, 1554, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_v_hw_ts);
    __pyx_t_3 = __pyx_v_hw_ts;
    if (unlikely(!__pyx_v_evdev_ts)) { __Pyx_RaiseUnboundLocalError("evdev_ts"); __PYX_ERR(0, 1554, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_v_evdev_ts);
    __pyx_t_2 = __pyx_v_evdev_ts;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1554, __pyx_L1_error)
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1554, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_11) {
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_1 = __pyx_t_3;
    } else {
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_1 = __pyx_t_2;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_xtest_ts, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1554, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1554, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_13 = __pyx_t_11;
    __pyx_L26_bool_binop_done:;
    if (__pyx_t_13) {

      /* "ws_package/utils/hardware_event_validator.py":1555
 *         if evdev_recent or hw_recent:
 *             if xtest_recent and xtest_ts > max(evdev_ts, hw_ts):
 *                 return False             # <<<<<<<<<<<<<<
 *             return True
 * 
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      goto __pyx_L0;

      /* "ws_package/utils/hardware_event_validator.py":1554
 *         # Hardware confirmed on kernel (evdev) or X11 physical device path.
 *         if evdev_recent or hw_recent:
 *             if xtest_recent and xtest_ts > max(evdev_ts, hw_ts):             # <<<<<<<<<<<<<<
 *                 return False
 *             return True
*/
    }

    /* "ws_package/utils/hardware_event_validator.py":1556
 *             if xtest_recent and xtest_ts > max(evdev_ts, hw_ts):
 *                 return False
 *             return True             # <<<<<<<<<<<<<<
 * 
 *         # XTEST virtual device  pyautogui / fake_detector injection path.
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1553
 * 
 *         # Hardware confirmed on kernel (evdev) or X11 physical device path.
 *         if evdev_recent or hw_recent:             # <<<<<<<<<<<<<<
 *             if xtest_recent and xtest_ts > max(evdev_ts, hw_ts):
 *                 return False
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1559
 * 
 *         # XTEST virtual device  pyautogui / fake_detector injection path.
 *         if xtest_recent:             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_xtest_recent); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1559, __pyx_L1_error)
  if (__pyx_t_13) {

    /* "ws_package/utils/hardware_event_validator.py":1560
 *         # XTEST virtual device  pyautogui / fake_detector injection path.
 *         if xtest_recent:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         # Automation script running  block only events with no hardware backing.
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1559
 * 
 *         # XTEST virtual device  pyautogui / fake_detector injection path.
 *         if xtest_recent:             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1563
 * 
 *         # Automation script running  block only events with no hardware backing.
 *         if self._linux_automation_process_active() and not (evdev_recent or hw_recent):             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
  __pyx_t_1 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_linux_automation_process_active, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1563, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_11) {
  } else {
    __pyx_t_13 = __pyx_t_11;
    goto __pyx_L30_bool_binop_done;
  }
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_evdev_recent); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1563, __pyx_L1_error)
  if (!__pyx_t_14) {
  } else {
    __pyx_t_11 = __pyx_t_14;
    goto __pyx_L32_bool_binop_done;
  }
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_hw_recent); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1563, __pyx_L1_error)
  __pyx_t_11 = __pyx_t_14;
  __pyx_L32_bool_binop_done:;
  __pyx_t_14 = (!__pyx_t_11);
  __pyx_t_13 = __pyx_t_14;
  __pyx_L30_bool_binop_done:;
  if (__pyx_t_13) {

    /* "ws_package/utils/hardware_event_validator.py":1564
 *         # Automation script running  block only events with no hardware backing.
 *         if self._linux_automation_process_active() and not (evdev_recent or hw_recent):
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         # Genuinely uncertain  accept real user rather than false-reject.
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "ws_package/utils/hardware_event_validator.py":1563
 * 
 *         # Automation script running  block only events with no hardware backing.
 *         if self._linux_automation_process_active() and not (evdev_recent or hw_recent):             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1567
 * 
 *         # Genuinely uncertain  accept real user rather than false-reject.
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     def _check_linux_keyboard(self) -> Optional[bool]:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":1524
 *         return bool(ts) and (now - ts) < self._linux_correlation_window
 * 
 *     def _check_linux_input_event(self, input_kind: str) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Linux X11 dual-path validation (evdev + XI2 device class).
*/

  /* 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("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_linux_input_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_now);
  __Pyx_XDECREF(__pyx_v_keyboard_found);
  __Pyx_XDECREF(__pyx_v_mouse_found);
  __Pyx_XDECREF(__pyx_v_evdev_ts);
  __Pyx_XDECREF(__pyx_v_xtest_ts);
  __Pyx_XDECREF(__pyx_v_hw_ts);
  __Pyx_XDECREF(__pyx_v_evdev_now);
  __Pyx_XDECREF(__pyx_v_evdev_recent);
  __Pyx_XDECREF(__pyx_v_hw_recent);
  __Pyx_XDECREF(__pyx_v_xtest_recent);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1569
 *         return None
 * 
 *     def _check_linux_keyboard(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """Linux X11: keyboard event hardware vs XTEST validation."""
 *         try:
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_89_check_linux_keyboard(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_88_check_linux_keyboard, "Linux X11: keyboard event hardware vs XTEST validation.");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_89_check_linux_keyboard = {"_check_linux_keyboard", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_89_check_linux_keyboard, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_88_check_linux_keyboard};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_89_check_linux_keyboard(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_check_linux_keyboard (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1569, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1569, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_check_linux_keyboard", 0) < (0)) __PYX_ERR(0, 1569, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_check_linux_keyboard", 1, 1, 1, i); __PYX_ERR(0, 1569, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1569, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_linux_keyboard", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1569, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_linux_keyboard", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_88_check_linux_keyboard(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_88_check_linux_keyboard(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_linux_keyboard", 0);

  /* "ws_package/utils/hardware_event_validator.py":1571
 *     def _check_linux_keyboard(self) -> Optional[bool]:
 *         """Linux X11: keyboard event hardware vs XTEST validation."""
 *         try:             # <<<<<<<<<<<<<<
 *             return self._check_linux_input_event('keyboard')
 *         except Exception:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":1572
 *         """Linux X11: keyboard event hardware vs XTEST validation."""
 *         try:
 *             return self._check_linux_input_event('keyboard')             # <<<<<<<<<<<<<<
 *         except Exception:
 *             return None
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __pyx_v_self;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_keyboard};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_check_linux_input_event, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1572, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      if (!(likely(PyBool_Check(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bool", __pyx_t_4))) __PYX_ERR(0, 1572, __pyx_L3_error)
      __pyx_r = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "ws_package/utils/hardware_event_validator.py":1571
 *     def _check_linux_keyboard(self) -> Optional[bool]:
 *         """Linux X11: keyboard event hardware vs XTEST validation."""
 *         try:             # <<<<<<<<<<<<<<
 *             return self._check_linux_input_event('keyboard')
 *         except Exception:
*/
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1573
 *         try:
 *             return self._check_linux_input_event('keyboard')
 *         except Exception:             # <<<<<<<<<<<<<<
 *             return None
 * 
*/
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_7) {
      __Pyx_ErrRestore(0,0,0);

      /* "ws_package/utils/hardware_event_validator.py":1574
 *             return self._check_linux_input_event('keyboard')
 *         except Exception:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def _check_linux_mouse(self) -> Optional[bool]:
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;

    /* "ws_package/utils/hardware_event_validator.py":1571
 *     def _check_linux_keyboard(self) -> Optional[bool]:
 *         """Linux X11: keyboard event hardware vs XTEST validation."""
 *         try:             # <<<<<<<<<<<<<<
 *             return self._check_linux_input_event('keyboard')
 *         except Exception:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "ws_package/utils/hardware_event_validator.py":1569
 *         return None
 * 
 *     def _check_linux_keyboard(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """Linux X11: keyboard event hardware vs XTEST validation."""
 *         try:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_linux_keyboard", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1576
 *             return None
 * 
 *     def _check_linux_mouse(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """Linux X11: mouse event hardware vs XTEST validation."""
 *         try:
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_91_check_linux_mouse(PyObject *__pyx_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_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_90_check_linux_mouse, "Linux X11: mouse event hardware vs XTEST validation.");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_91_check_linux_mouse = {"_check_linux_mouse", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_91_check_linux_mouse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_90_check_linux_mouse};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_91_check_linux_mouse(PyObject *__pyx_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_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_check_linux_mouse (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1576, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1576, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_check_linux_mouse", 0) < (0)) __PYX_ERR(0, 1576, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_check_linux_mouse", 1, 1, 1, i); __PYX_ERR(0, 1576, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1576, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_linux_mouse", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1576, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_linux_mouse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_90_check_linux_mouse(__pyx_self, __pyx_v_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_90_check_linux_mouse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_linux_mouse", 0);

  /* "ws_package/utils/hardware_event_validator.py":1578
 *     def _check_linux_mouse(self) -> Optional[bool]:
 *         """Linux X11: mouse event hardware vs XTEST validation."""
 *         try:             # <<<<<<<<<<<<<<
 *             return self._check_linux_input_event('mouse')
 *         except Exception:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "ws_package/utils/hardware_event_validator.py":1579
 *         """Linux X11: mouse event hardware vs XTEST validation."""
 *         try:
 *             return self._check_linux_input_event('mouse')             # <<<<<<<<<<<<<<
 *         except Exception:
 *             return None
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __pyx_v_self;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_mouse};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_check_linux_input_event, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1579, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      if (!(likely(PyBool_Check(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bool", __pyx_t_4))) __PYX_ERR(0, 1579, __pyx_L3_error)
      __pyx_r = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "ws_package/utils/hardware_event_validator.py":1578
 *     def _check_linux_mouse(self) -> Optional[bool]:
 *         """Linux X11: mouse event hardware vs XTEST validation."""
 *         try:             # <<<<<<<<<<<<<<
 *             return self._check_linux_input_event('mouse')
 *         except Exception:
*/
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1580
 *         try:
 *             return self._check_linux_input_event('mouse')
 *         except Exception:             # <<<<<<<<<<<<<<
 *             return None
 * 
*/
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_7) {
      __Pyx_ErrRestore(0,0,0);

      /* "ws_package/utils/hardware_event_validator.py":1581
 *             return self._check_linux_input_event('mouse')
 *         except Exception:
 *             return None             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;

    /* "ws_package/utils/hardware_event_validator.py":1578
 *     def _check_linux_mouse(self) -> Optional[bool]:
 *         """Linux X11: mouse event hardware vs XTEST validation."""
 *         try:             # <<<<<<<<<<<<<<
 *             return self._check_linux_input_event('mouse')
 *         except Exception:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "ws_package/utils/hardware_event_validator.py":1576
 *             return None
 * 
 *     def _check_linux_mouse(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """Linux X11: mouse event hardware vs XTEST validation."""
 *         try:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.HardwareEventValidator._check_linux_mouse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1587
 * _hardware_validator = None
 * 
 * def get_hardware_validator() -> HardwareEventValidator:             # <<<<<<<<<<<<<<
 *     """Get the global hardware event validator instance"""
 *     global _hardware_validator
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_1get_hardware_validator(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_10ws_package_5utils_24hardware_event_validator_get_hardware_validator, "Get the global hardware event validator instance");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_1get_hardware_validator = {"get_hardware_validator", (PyCFunction)__pyx_pw_10ws_package_5utils_24hardware_event_validator_1get_hardware_validator, METH_NOARGS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_get_hardware_validator};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_1get_hardware_validator(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_hardware_validator (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_get_hardware_validator(__pyx_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_get_hardware_validator(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_hardware_validator", 0);

  /* "ws_package/utils/hardware_event_validator.py":1590
 *     """Get the global hardware event validator instance"""
 *     global _hardware_validator
 *     if _hardware_validator is None:             # <<<<<<<<<<<<<<
 *         _hardware_validator = HardwareEventValidator()
 *     return _hardware_validator
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_hardware_validator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "ws_package/utils/hardware_event_validator.py":1591
 *     global _hardware_validator
 *     if _hardware_validator is None:
 *         _hardware_validator = HardwareEventValidator()             # <<<<<<<<<<<<<<
 *     return _hardware_validator
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1591, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_hardware_validator, __pyx_t_1) < (0)) __PYX_ERR(0, 1591, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "ws_package/utils/hardware_event_validator.py":1590
 *     """Get the global hardware event validator instance"""
 *     global _hardware_validator
 *     if _hardware_validator is None:             # <<<<<<<<<<<<<<
 *         _hardware_validator = HardwareEventValidator()
 *     return _hardware_validator
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1592
 *     if _hardware_validator is None:
 *         _hardware_validator = HardwareEventValidator()
 *     return _hardware_validator             # <<<<<<<<<<<<<<
 * 
 * def cleanup_hardware_validator():
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_hardware_validator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "ws_package/utils/hardware_event_validator.py":1587
 * _hardware_validator = None
 * 
 * def get_hardware_validator() -> HardwareEventValidator:             # <<<<<<<<<<<<<<
 *     """Get the global hardware event validator instance"""
 *     global _hardware_validator
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.get_hardware_validator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "ws_package/utils/hardware_event_validator.py":1594
 *     return _hardware_validator
 * 
 * def cleanup_hardware_validator():             # <<<<<<<<<<<<<<
 *     """Explicitly cleanup the global hardware validator instance"""
 *     global _hardware_validator
*/

/* Python wrapper */
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_3cleanup_hardware_validator(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_10ws_package_5utils_24hardware_event_validator_2cleanup_hardware_validator, "Explicitly cleanup the global hardware validator instance");
static PyMethodDef __pyx_mdef_10ws_package_5utils_24hardware_event_validator_3cleanup_hardware_validator = {"cleanup_hardware_validator", (PyCFunction)__pyx_pw_10ws_package_5utils_24hardware_event_validator_3cleanup_hardware_validator, METH_NOARGS, __pyx_doc_10ws_package_5utils_24hardware_event_validator_2cleanup_hardware_validator};
static PyObject *__pyx_pw_10ws_package_5utils_24hardware_event_validator_3cleanup_hardware_validator(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cleanup_hardware_validator (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_10ws_package_5utils_24hardware_event_validator_2cleanup_hardware_validator(__pyx_self);

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

static PyObject *__pyx_pf_10ws_package_5utils_24hardware_event_validator_2cleanup_hardware_validator(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cleanup_hardware_validator", 0);

  /* "ws_package/utils/hardware_event_validator.py":1597
 *     """Explicitly cleanup the global hardware validator instance"""
 *     global _hardware_validator
 *     if _hardware_validator:             # <<<<<<<<<<<<<<
 *         try:
 *             _hardware_validator.cleanup()
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_hardware_validator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "ws_package/utils/hardware_event_validator.py":1598
 *     global _hardware_validator
 *     if _hardware_validator:
 *         try:             # <<<<<<<<<<<<<<
 *             _hardware_validator.cleanup()
 *             _hardware_validator = None
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "ws_package/utils/hardware_event_validator.py":1599
 *     if _hardware_validator:
 *         try:
 *             _hardware_validator.cleanup()             # <<<<<<<<<<<<<<
 *             _hardware_validator = None
 *             logger.debug("Global hardware validator cleaned up")
*/
        __pyx_t_6 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_hardware_validator); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1599, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_cleanup); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1599, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_9 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
          assert(__pyx_t_6);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
          __pyx_t_9 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1599, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":1600
 *         try:
 *             _hardware_validator.cleanup()
 *             _hardware_validator = None             # <<<<<<<<<<<<<<
 *             logger.debug("Global hardware validator cleaned up")
 *         except Exception as e:
*/
        if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_hardware_validator, Py_None) < (0)) __PYX_ERR(0, 1600, __pyx_L4_error)

        /* "ws_package/utils/hardware_event_validator.py":1601
 *             _hardware_validator.cleanup()
 *             _hardware_validator = None
 *             logger.debug("Global hardware validator cleaned up")             # <<<<<<<<<<<<<<
 *         except Exception as e:
 *             logger.warning("Error cleaning up global hardware validator: %s", e)
*/
        __pyx_t_8 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1601, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_debug); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1601, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_9 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
          assert(__pyx_t_8);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
          __pyx_t_9 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_Global_hardware_validator_cleane};
          __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1601, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "ws_package/utils/hardware_event_validator.py":1598
 *     global _hardware_validator
 *     if _hardware_validator:
 *         try:             # <<<<<<<<<<<<<<
 *             _hardware_validator.cleanup()
 *             _hardware_validator = None
*/
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L9_try_end;
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "ws_package/utils/hardware_event_validator.py":1602
 *             _hardware_validator = None
 *             logger.debug("Global hardware validator cleaned up")
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.warning("Error cleaning up global hardware validator: %s", e)
 * 
*/
      __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_10) {
        __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.cleanup_hardware_validator", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 1602, __pyx_L6_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __pyx_v_e = __pyx_t_7;
        /*try:*/ {

          /* "ws_package/utils/hardware_event_validator.py":1603
 *             logger.debug("Global hardware validator cleaned up")
 *         except Exception as e:
 *             logger.warning("Error cleaning up global hardware validator: %s", e)             # <<<<<<<<<<<<<<
 * 
*/
          __pyx_t_11 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1603, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1603, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_9 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_13))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_13);
            assert(__pyx_t_11);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
            __pyx_t_9 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_Error_cleaning_up_global_hardwar, __pyx_v_e};
            __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1603, __pyx_L15_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }

        /* "ws_package/utils/hardware_event_validator.py":1602
 *             _hardware_validator = None
 *             logger.debug("Global hardware validator cleaned up")
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             logger.warning("Error cleaning up global hardware validator: %s", e)
 * 
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            goto __pyx_L16;
          }
          __pyx_L15_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
            if ( unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __pyx_t_10 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
            __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
            __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
            goto __pyx_L6_except_error;
          }
          __pyx_L16:;
        }
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L5_exception_handled;
      }
      goto __pyx_L6_except_error;

      /* "ws_package/utils/hardware_event_validator.py":1598
 *     global _hardware_validator
 *     if _hardware_validator:
 *         try:             # <<<<<<<<<<<<<<
 *             _hardware_validator.cleanup()
 *             _hardware_validator = None
*/
      __pyx_L6_except_error:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L5_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      __pyx_L9_try_end:;
    }

    /* "ws_package/utils/hardware_event_validator.py":1597
 *     """Explicitly cleanup the global hardware validator instance"""
 *     global _hardware_validator
 *     if _hardware_validator:             # <<<<<<<<<<<<<<
 *         try:
 *             _hardware_validator.cleanup()
*/
  }

  /* "ws_package/utils/hardware_event_validator.py":1594
 *     return _hardware_validator
 * 
 * def cleanup_hardware_validator():             # <<<<<<<<<<<<<<
 *     """Explicitly cleanup the global hardware validator instance"""
 *     global _hardware_validator
*/

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("ws_package.utils.hardware_event_validator.cleanup_hardware_validator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* #### Code section: module_exttypes ### */

static PyObject *__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread, sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread[--__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread(PyObject *o) {
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *p = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_KBDLLHOOKSTRUCT);
  Py_CLEAR(p->__pyx_v_MSLLHOOKSTRUCT);
  Py_CLEAR(p->__pyx_v_RAWINPUTHEADER);
  Py_CLEAR(p->__pyx_v_RAWMOUSE);
  Py_CLEAR(p->__pyx_v__raw_input_header_size);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_user32);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread, sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread))))
  {
    __pyx_mstate_global->__pyx_freelist_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread[__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread++] = ((struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *p = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_KBDLLHOOKSTRUCT) {
    e = (*v)(p->__pyx_v_KBDLLHOOKSTRUCT, a); if (e) return e;
  }
  if (p->__pyx_v_MSLLHOOKSTRUCT) {
    e = (*v)(p->__pyx_v_MSLLHOOKSTRUCT, a); if (e) return e;
  }
  if (p->__pyx_v_RAWINPUTHEADER) {
    e = (*v)(p->__pyx_v_RAWINPUTHEADER, a); if (e) return e;
  }
  if (p->__pyx_v_RAWMOUSE) {
    e = (*v)(p->__pyx_v_RAWMOUSE, a); if (e) return e;
  }
  if (p->__pyx_v__raw_input_header_size) {
    e = (*v)(p->__pyx_v__raw_input_header_size, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  if (p->__pyx_v_user32) {
    e = (*v)(p->__pyx_v_user32, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *p = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread *)o;
  tmp = ((PyObject*)p->__pyx_v_KBDLLHOOKSTRUCT);
  p->__pyx_v_KBDLLHOOKSTRUCT = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_MSLLHOOKSTRUCT);
  p->__pyx_v_MSLLHOOKSTRUCT = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_RAWINPUTHEADER);
  p->__pyx_v_RAWINPUTHEADER = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_RAWMOUSE);
  p->__pyx_v_RAWMOUSE = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v__raw_input_header_size);
  p->__pyx_v__raw_input_header_size = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_user32);
  p->__pyx_v_user32 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread},
  {Py_tp_clear, (void *)__pyx_tp_clear_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread},
  {Py_tp_new, (void *)__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread},
  {0, 0},
};
static PyType_Spec __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread_spec = {
  "ws_package.utils.hardware_event_validator.__pyx_scope_struct___windows_hook_thread",
  sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread_slots,
};
#else

static PyTypeObject __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread = {
  PyVarObject_HEAD_INIT(0, 0)
  "ws_package.utils.hardware_event_validator.""__pyx_scope_struct___windows_hook_thread", /*tp_name*/
  sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread, /*tp_traverse*/
  __pyx_tp_clear_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos, sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos[--__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos(PyObject *o) {
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos *p = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_kCGEventKeyDown);
  Py_CLEAR(p->__pyx_v_kCGEventKeyUp);
  Py_CLEAR(p->__pyx_v_kCGEventLeftMouseDown);
  Py_CLEAR(p->__pyx_v_kCGEventMouseMoved);
  Py_CLEAR(p->__pyx_v_kCGEventRightMouseDown);
  Py_CLEAR(p->__pyx_v_quartz);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos, sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos))))
  {
    __pyx_mstate_global->__pyx_freelist_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos[__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos++] = ((struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos *p = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_kCGEventKeyDown) {
    e = (*v)(p->__pyx_v_kCGEventKeyDown, a); if (e) return e;
  }
  if (p->__pyx_v_kCGEventKeyUp) {
    e = (*v)(p->__pyx_v_kCGEventKeyUp, a); if (e) return e;
  }
  if (p->__pyx_v_kCGEventLeftMouseDown) {
    e = (*v)(p->__pyx_v_kCGEventLeftMouseDown, a); if (e) return e;
  }
  if (p->__pyx_v_kCGEventMouseMoved) {
    e = (*v)(p->__pyx_v_kCGEventMouseMoved, a); if (e) return e;
  }
  if (p->__pyx_v_kCGEventRightMouseDown) {
    e = (*v)(p->__pyx_v_kCGEventRightMouseDown, a); if (e) return e;
  }
  if (p->__pyx_v_quartz) {
    e = (*v)(p->__pyx_v_quartz, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos *p = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos *)o;
  tmp = ((PyObject*)p->__pyx_v_kCGEventKeyDown);
  p->__pyx_v_kCGEventKeyDown = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_kCGEventKeyUp);
  p->__pyx_v_kCGEventKeyUp = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_kCGEventLeftMouseDown);
  p->__pyx_v_kCGEventLeftMouseDown = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_kCGEventMouseMoved);
  p->__pyx_v_kCGEventMouseMoved = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_kCGEventRightMouseDown);
  p->__pyx_v_kCGEventRightMouseDown = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_quartz);
  p->__pyx_v_quartz = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos},
  {Py_tp_clear, (void *)__pyx_tp_clear_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos},
  {Py_tp_new, (void *)__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos},
  {0, 0},
};
static PyType_Spec __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos_spec = {
  "ws_package.utils.hardware_event_validator.__pyx_scope_struct_1__initialize_macos",
  sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos_slots,
};
#else

static PyTypeObject __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos = {
  PyVarObject_HEAD_INIT(0, 0)
  "ws_package.utils.hardware_event_validator.""__pyx_scope_struct_1__initialize_macos", /*tp_name*/
  sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos, /*tp_traverse*/
  __pyx_tp_clear_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes, sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes[--__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes(PyObject *o) {
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes *p = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_cmdline);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes, sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes))))
  {
    __pyx_mstate_global->__pyx_freelist_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes[__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes++] = ((struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes *p = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_cmdline) {
    e = (*v)(p->__pyx_v_cmdline, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes *p = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes *)o;
  tmp = ((PyObject*)p->__pyx_v_cmdline);
  p->__pyx_v_cmdline = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes},
  {Py_tp_clear, (void *)__pyx_tp_clear_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes},
  {Py_tp_new, (void *)__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes},
  {0, 0},
};
static PyType_Spec __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes_spec = {
  "ws_package.utils.hardware_event_validator.__pyx_scope_struct_2__scan_linux_automation_processes",
  sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes_slots,
};
#else

static PyTypeObject __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes = {
  PyVarObject_HEAD_INIT(0, 0)
  "ws_package.utils.hardware_event_validator.""__pyx_scope_struct_2__scan_linux_automation_processes", /*tp_name*/
  sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes, /*tp_traverse*/
  __pyx_tp_clear_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr, sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr[--__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr(PyObject *o) {
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_marker);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr, sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr))))
  {
    __pyx_mstate_global->__pyx_freelist_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr[__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_marker) {
    e = (*v)(p->__pyx_v_marker, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr_spec = {
  "ws_package.utils.hardware_event_validator.__pyx_scope_struct_3_genexpr",
  sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ws_package.utils.hardware_event_validator.""__pyx_scope_struct_3_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes, sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes[--__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes(PyObject *o) {
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes *p = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  Py_CLEAR(p->__pyx_v_haystack);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes, sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes))))
  {
    __pyx_mstate_global->__pyx_freelist_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes[__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes++] = ((struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes},
  {Py_tp_new, (void *)__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes},
  {0, 0},
};
static PyType_Spec __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes_spec = {
  "ws_package.utils.hardware_event_validator.__pyx_scope_struct_4__scan_windows_automation_processes",
  sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER,
  __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes_slots,
};
#else

static PyTypeObject __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes = {
  PyVarObject_HEAD_INIT(0, 0)
  "ws_package.utils.hardware_event_validator.""__pyx_scope_struct_4__scan_windows_automation_processes", /*tp_name*/
  sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr, sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr[--__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr(PyObject *o) {
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_marker);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr, sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr))))
  {
    __pyx_mstate_global->__pyx_freelist_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr[__pyx_mstate_global->__pyx_freecount_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_marker) {
    e = (*v)(p->__pyx_v_marker, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr_spec = {
  "ws_package.utils.hardware_event_validator.__pyx_scope_struct_5_genexpr",
  sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "ws_package.utils.hardware_event_validator.""__pyx_scope_struct_5_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
/* #### Code section: initfunc_declarations ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
/* #### Code section: init_module ### */

static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread)) __PYX_ERR(0, 303, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread_spec, __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread) < (0)) __PYX_ERR(0, 303, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread = &__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread) < (0)) __PYX_ERR(0, 303, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread->tp_dictoffset && __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct___windows_hook_thread->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos)) __PYX_ERR(0, 608, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos_spec, __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos) < (0)) __PYX_ERR(0, 608, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos = &__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos) < (0)) __PYX_ERR(0, 608, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos->tp_dictoffset && __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_1__initialize_macos->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes)) __PYX_ERR(0, 935, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes_spec, __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes) < (0)) __PYX_ERR(0, 935, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes = &__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes) < (0)) __PYX_ERR(0, 935, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes->tp_dictoffset && __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_2__scan_linux_automation_processes->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 949, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr_spec, __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr) < (0)) __PYX_ERR(0, 949, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr = &__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr) < (0)) __PYX_ERR(0, 949, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_3_genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes)) __PYX_ERR(0, 953, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes_spec, __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes) < (0)) __PYX_ERR(0, 953, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes = &__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes) < (0)) __PYX_ERR(0, 953, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes->tp_dictoffset && __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_4__scan_windows_automation_processes->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr)) __PYX_ERR(0, 966, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr_spec, __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr) < (0)) __PYX_ERR(0, 966, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr = &__pyx_type_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr) < (0)) __PYX_ERR(0, 966, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_10ws_package_5utils_24hardware_event_validator___pyx_scope_struct_5_genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_hardware_event_validator(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_hardware_event_validator},
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
  #endif
  #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
  {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
  #endif
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "hardware_event_validator",
      __pyx_k_Hardware_Event_Validator_Detect, /* m_doc */
    #if CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstatetype), /* m_size */
    #else
      (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
    #endif
      __pyx_methods /* m_methods */,
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      __pyx_moduledef_slots, /* m_slots */
    #else
      NULL, /* m_reload */
    #endif
    #if CYTHON_USE_MODULE_STATE
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif

/* PyModInitFuncType */
#ifndef CYTHON_NO_PYINIT_EXPORT
  #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#else
  #ifdef __cplusplus
  #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
  #else
  #define __Pyx_PyMODINIT_FUNC PyObject *
  #endif
#endif

__Pyx_PyMODINIT_FUNC PyInit_hardware_event_validator(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_hardware_event_validator(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
/* ModuleCreationPEP489 */
#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
      || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
    {
        PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
        if (!module) {
            PyErr_Clear(); // just try the 3.8-3.12 version
            module = PyImport_ImportModule("_xxsubinterpreters");
            if (!module) goto bad;
        }
        PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
        Py_DECREF(module);
        if (!current) goto bad;
        if (PyTuple_Check(current)) {
            PyObject *new_current = PySequence_GetItem(current, 0);
            Py_DECREF(current);
            current = new_current;
            if (!new_current) goto bad;
        }
        long long as_c_int = PyLong_AsLongLong(current);
        Py_DECREF(current);
        return as_c_int;
    }
  bad:
    PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
    return -1;
}
#endif
#if !CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    static PY_INT64_T main_interpreter_id = -1;
#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
    PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_GRAAL
    PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
      || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
    PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
#elif CYTHON_COMPILING_IN_LIMITED_API
    PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
#else
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
#endif
    if (unlikely(current_id == -1)) {
        return -1;
    }
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return 0;
    } else if (unlikely(main_interpreter_id != current_id)) {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#endif
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    #if !CYTHON_USE_MODULE_STATE
    if (__Pyx_check_single_interpreter())
        return NULL;
    #endif
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_hardware_event_validator(PyObject *__pyx_pyinit_module)
#endif
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  __pyx_mstatetype *__pyx_mstate = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'hardware_event_validator' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #else
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_t_1 = __pyx_pyinit_module;
  Py_INCREF(__pyx_t_1);
  #else
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #if CYTHON_USE_MODULE_STATE
  {
    int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
    __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "hardware_event_validator" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = __pyx_t_1;
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
  #endif
  __pyx_mstate = __pyx_mstate_global;
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_mstate->__pyx_d);
  __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /* ImportRefnannyAPI */
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
    PyErr_Clear();
    __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
    if (!__Pyx_RefNanny)
        Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  
__Pyx_RefNannySetupContext("PyInit_hardware_event_validator", 0);
  __Pyx_init_runtime_version();
  if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Library function declarations ---*/
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__pyx_module_is_main_ws_package__utils__hardware_event_validator) {
    if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "ws_package.utils.hardware_event_validator")) {
      if (unlikely((PyDict_SetItemString(modules, "ws_package.utils.hardware_event_validator", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code(__pyx_mstate);
  (void)__Pyx_modinit_variable_export_code(__pyx_mstate);
  (void)__Pyx_modinit_function_export_code(__pyx_mstate);
  if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_type_import_code(__pyx_mstate);
  (void)__Pyx_modinit_variable_import_code(__pyx_mstate);
  (void)__Pyx_modinit_function_import_code(__pyx_mstate);
  /*--- Execution code ---*/

  /* "ws_package/utils/hardware_event_validator.py":14
 * """
 * 
 * import glob             # <<<<<<<<<<<<<<
 * import os
 * import platform
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_glob, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_glob, __pyx_t_2) < (0)) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":15
 * 
 * import glob
 * import os             # <<<<<<<<<<<<<<
 * import platform
 * import re
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_os, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_os, __pyx_t_2) < (0)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":16
 * import glob
 * import os
 * import platform             # <<<<<<<<<<<<<<
 * import re
 * import shutil
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_platform, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_platform, __pyx_t_2) < (0)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":17
 * import os
 * import platform
 * import re             # <<<<<<<<<<<<<<
 * import shutil
 * import subprocess
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_re, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_re, __pyx_t_2) < (0)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":18
 * import platform
 * import re
 * import shutil             # <<<<<<<<<<<<<<
 * import subprocess
 * import ctypes
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_shutil, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_shutil, __pyx_t_2) < (0)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":19
 * import re
 * import shutil
 * import subprocess             # <<<<<<<<<<<<<<
 * import ctypes
 * import ctypes.wintypes
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_subprocess, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_subprocess, __pyx_t_2) < (0)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":20
 * import shutil
 * import subprocess
 * import ctypes             # <<<<<<<<<<<<<<
 * import ctypes.wintypes
 * import threading
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_ctypes, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ctypes, __pyx_t_2) < (0)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":21
 * import subprocess
 * import ctypes
 * import ctypes.wintypes             # <<<<<<<<<<<<<<
 * import threading
 * import queue
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_ctypes_wintypes, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ctypes, __pyx_t_2) < (0)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":22
 * import ctypes
 * import ctypes.wintypes
 * import threading             # <<<<<<<<<<<<<<
 * import queue
 * import time
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_threading, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_threading, __pyx_t_2) < (0)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":23
 * import ctypes.wintypes
 * import threading
 * import queue             # <<<<<<<<<<<<<<
 * import time
 * from collections import deque
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_queue, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_queue, __pyx_t_2) < (0)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":24
 * import threading
 * import queue
 * import time             # <<<<<<<<<<<<<<
 * from collections import deque
 * from typing import Optional, Dict, Set, Tuple
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_time, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_time, __pyx_t_2) < (0)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":25
 * import queue
 * import time
 * from collections import deque             # <<<<<<<<<<<<<<
 * from typing import Optional, Dict, Set, Tuple
 * from ws_package.log.writer import LogWriter
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_deque};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_deque};
    __pyx_t_3 = 0; {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 25, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":26
 * import time
 * from collections import deque
 * from typing import Optional, Dict, Set, Tuple             # <<<<<<<<<<<<<<
 * from ws_package.log.writer import LogWriter
 * from ws_package.configs import config
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Optional,__pyx_mstate_global->__pyx_n_u_Dict,__pyx_mstate_global->__pyx_n_u_Set,__pyx_mstate_global->__pyx_n_u_Tuple};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_typing, __pyx_imported_names, 4, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Optional,__pyx_mstate_global->__pyx_n_u_Dict,__pyx_mstate_global->__pyx_n_u_Set,__pyx_mstate_global->__pyx_n_u_Tuple};
    for (__pyx_t_3=0; __pyx_t_3 < 4; __pyx_t_3++) {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 26, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":27
 * from collections import deque
 * from typing import Optional, Dict, Set, Tuple
 * from ws_package.log.writer import LogWriter             # <<<<<<<<<<<<<<
 * from ws_package.configs import config
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_LogWriter};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_ws_package_log_writer, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_LogWriter};
    __pyx_t_3 = 0; {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 27, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":28
 * from typing import Optional, Dict, Set, Tuple
 * from ws_package.log.writer import LogWriter
 * from ws_package.configs import config             # <<<<<<<<<<<<<<
 * 
 * logger = LogWriter.file(__name__)
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_config};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_ws_package_configs, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_config};
    __pyx_t_3 = 0; {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 28, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":30
 * from ws_package.configs import config
 * 
 * logger = LogWriter.file(__name__)             # <<<<<<<<<<<<<<
 * 
 * # Windows LL hooks can lag pynput; only filter synthetic on a very fresh stamp.
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LogWriter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_file); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_logger, __pyx_t_2) < (0)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":33
 * 
 * # Windows LL hooks can lag pynput; only filter synthetic on a very fresh stamp.
 * WINDOWS_HW_CONFIRM_WINDOW = 0.10             # <<<<<<<<<<<<<<
 * WINDOWS_SYN_FILTER_WINDOW = 0.04
 * WINDOWS_RAW_CONFIRM_WINDOW = 0.15
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_WINDOWS_HW_CONFIRM_WINDOW, __pyx_mstate_global->__pyx_float_0_10) < (0)) __PYX_ERR(0, 33, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":34
 * # Windows LL hooks can lag pynput; only filter synthetic on a very fresh stamp.
 * WINDOWS_HW_CONFIRM_WINDOW = 0.10
 * WINDOWS_SYN_FILTER_WINDOW = 0.04             # <<<<<<<<<<<<<<
 * WINDOWS_RAW_CONFIRM_WINDOW = 0.15
 * WM_MOUSEMOVE = 0x0200
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_WINDOWS_SYN_FILTER_WINDOW, __pyx_mstate_global->__pyx_float_0_04) < (0)) __PYX_ERR(0, 34, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":35
 * WINDOWS_HW_CONFIRM_WINDOW = 0.10
 * WINDOWS_SYN_FILTER_WINDOW = 0.04
 * WINDOWS_RAW_CONFIRM_WINDOW = 0.15             # <<<<<<<<<<<<<<
 * WM_MOUSEMOVE = 0x0200
 * WM_INPUT = 0x00FF
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_WINDOWS_RAW_CONFIRM_WINDOW, __pyx_mstate_global->__pyx_float_0_15) < (0)) __PYX_ERR(0, 35, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":36
 * WINDOWS_SYN_FILTER_WINDOW = 0.04
 * WINDOWS_RAW_CONFIRM_WINDOW = 0.15
 * WM_MOUSEMOVE = 0x0200             # <<<<<<<<<<<<<<
 * WM_INPUT = 0x00FF
 * RI_MOUSE_WHEEL = 0x0400
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_WM_MOUSEMOVE, __pyx_mstate_global->__pyx_int_512) < (0)) __PYX_ERR(0, 36, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":37
 * WINDOWS_RAW_CONFIRM_WINDOW = 0.15
 * WM_MOUSEMOVE = 0x0200
 * WM_INPUT = 0x00FF             # <<<<<<<<<<<<<<
 * RI_MOUSE_WHEEL = 0x0400
 * RI_MOUSE_HWHEEL = 0x0800
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_WM_INPUT, __pyx_mstate_global->__pyx_int_255) < (0)) __PYX_ERR(0, 37, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":38
 * WM_MOUSEMOVE = 0x0200
 * WM_INPUT = 0x00FF
 * RI_MOUSE_WHEEL = 0x0400             # <<<<<<<<<<<<<<
 * RI_MOUSE_HWHEEL = 0x0800
 * RI_MOUSE_BUTTONS = 0x003F
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RI_MOUSE_WHEEL, __pyx_mstate_global->__pyx_int_1024) < (0)) __PYX_ERR(0, 38, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":39
 * WM_INPUT = 0x00FF
 * RI_MOUSE_WHEEL = 0x0400
 * RI_MOUSE_HWHEEL = 0x0800             # <<<<<<<<<<<<<<
 * RI_MOUSE_BUTTONS = 0x003F
 * 
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RI_MOUSE_HWHEEL, __pyx_mstate_global->__pyx_int_2048) < (0)) __PYX_ERR(0, 39, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":40
 * RI_MOUSE_WHEEL = 0x0400
 * RI_MOUSE_HWHEEL = 0x0800
 * RI_MOUSE_BUTTONS = 0x003F             # <<<<<<<<<<<<<<
 * 
 * 
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RI_MOUSE_BUTTONS, __pyx_mstate_global->__pyx_int_63) < (0)) __PYX_ERR(0, 40, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":43
 * 
 * 
 * class HardwareEventValidator:             # <<<<<<<<<<<<<<
 *     """
 *     Validates whether input events originate from hardware devices.
*/
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_kp_u_Validates_whether_input_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "ws_package/utils/hardware_event_validator.py":52
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self._enabled = False
 *         self._platform = platform.system()
*/
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_1__init__, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator___init, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < (0)) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":124
 *         self._initialize()
 * 
 *     def __del__(self):             # <<<<<<<<<<<<<<
 *         """Cleanup hooks on destruction"""
 *         try:
*/
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_3__del__, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator___del, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_del, __pyx_t_6) < (0)) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":131
 *             pass
 * 
 *     def cleanup(self):             # <<<<<<<<<<<<<<
 *         """Clean up platform-specific resources"""
 *         self._stop_hooks = True
*/
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_5cleanup, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator_cleanup, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_cleanup, __pyx_t_6) < (0)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":169
 *             self._linux_teardown_monitors()
 * 
 *     def _linux_teardown_monitors(self):             # <<<<<<<<<<<<<<
 *         """Stop Linux evdev/xinput monitor threads and close device handles."""
 *         proc = self._linux_xinput_process
*/
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_7_linux_teardown_monitors, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__linux_te, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_linux_teardown_monitors, __pyx_t_6) < (0)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":191
 *         self._linux_open_devices = []
 * 
 *     def _linux_reset_timestamps(self):             # <<<<<<<<<<<<<<
 *         """Clear correlation timestamps (e.g. after scripted input session)."""
 *         with self._linux_lock:
*/
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_9_linux_reset_timestamps, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__linux_re, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_linux_reset_timestamps, __pyx_t_6) < (0)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":201
 *             self._linux_last_hw_mouse_ts = 0.0
 * 
 *     def reinitialize_linux(self):             # <<<<<<<<<<<<<<
 *         """
 *         Restart Linux monitors after a listener restart.
*/
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_11reinitialize_linux, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator_reinitial, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_reinitialize_linux, __pyx_t_6) < (0)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":226
 *         )
 * 
 *     def _initialize(self):             # <<<<<<<<<<<<<<
 *         """Initialize platform-specific hardware detection"""
 *         try:
*/
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_13_initialize, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__initiali_2, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_initialize, __pyx_t_6) < (0)) __PYX_ERR(0, 226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":245
 *             self._initialized = True
 * 
 *     def _initialize_windows(self):             # <<<<<<<<<<<<<<
 *         """Initialize Windows hardware event detection using low-level hooks.
 * 
*/
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_15_initialize_windows, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__initiali_3, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_initialize_windows, __pyx_t_6) < (0)) __PYX_ERR(0, 245, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":303
 *         )
 * 
 *     def _windows_hook_thread(self, ready_event: threading.Event, ok_flag: list):             # <<<<<<<<<<<<<<
 *         """
 *         Dedicated thread that INSTALLS and PUMPS low-level Windows hooks.
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ready_event, __pyx_mstate_global->__pyx_kp_u_threading_Event) < (0)) __PYX_ERR(0, 303, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ok_flag, __pyx_mstate_global->__pyx_n_u_list) < (0)) __PYX_ERR(0, 303, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_17_windows_hook_thread, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__windows_9, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_windows_hook_thread, __pyx_t_5) < (0)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":608
 *             ready_event.set()
 * 
 *     def _initialize_macos(self):             # <<<<<<<<<<<<<<
 *         """Initialize macOS CGEvent API for event validation"""
 *         try:
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_19_initialize_macos, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__initiali_4, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_initialize_macos, __pyx_t_5) < (0)) __PYX_ERR(0, 608, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":774
 *             self._enabled = False
 * 
 *     def _initialize_linux(self):             # <<<<<<<<<<<<<<
 *         """
 *         Initialize Linux X11 input validation (evdev + XTEST path).
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_21_initialize_linux, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__initiali_5, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_initialize_linux, __pyx_t_5) < (0)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":819
 *             self._enabled = False
 * 
 *     def _linux_xinput_binary(self) -> Optional[str]:             # <<<<<<<<<<<<<<
 *         """Resolve the xinput binary path for X11 sessions."""
 *         if self._linux_xinput_path:
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_str) < (0)) __PYX_ERR(0, 819, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_23_linux_xinput_binary, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__linux_xi, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_linux_xinput_binary, __pyx_t_6) < (0)) __PYX_ERR(0, 819, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":833
 *         return None
 * 
 *     def _linux_discover_xtest_device_ids(self) -> Set[int]:             # <<<<<<<<<<<<<<
 *         """Discover Virtual core XTEST pointer/keyboard device IDs."""
 *         ids: Set[int] = set()
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Set_int) < (0)) __PYX_ERR(0, 833, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_25_linux_discover_xtest_device_ids, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__linux_di_2, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_linux_discover_xtest_device_ids, __pyx_t_5) < (0)) __PYX_ERR(0, 833, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":866
 *         return ids
 * 
 *     def _linux_discover_xtest_device_ids_ctypes(self) -> Set[int]:             # <<<<<<<<<<<<<<
 *         """Discover XTEST device IDs via libXi (works in frozen PyInstaller builds)."""
 *         import ctypes.util
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Set_int) < (0)) __PYX_ERR(0, 866, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_27_linux_discover_xtest_device_ids_ctypes, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__linux_di_3, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_linux_discover_xtest_device_ids_2, __pyx_t_6) < (0)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":918
 *         return ids
 * 
 *     def _automation_process_active(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return True when a known input-automation script/process is running."""
 *         now = time.time()
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 918, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_29_automation_process_active, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__automati, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_automation_process_active, __pyx_t_5) < (0)) __PYX_ERR(0, 918, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":935
 *         return active
 * 
 *     def _scan_linux_automation_processes(self) -> bool:             # <<<<<<<<<<<<<<
 *         own_pid = os.getpid()
 *         for cmdline_path in glob.glob('/proc/[0-9]*[inserted by cython to avoid comment closer]/cmdline'):
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 935, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_31_scan_linux_automation_processes, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__scan_lin_2, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_scan_linux_automation_processes, __pyx_t_6) < (0)) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":953
 *         return False
 * 
 *     def _scan_windows_automation_processes(self) -> bool:             # <<<<<<<<<<<<<<
 *         own_pid = os.getpid()
 *         try:
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 953, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_33_scan_windows_automation_processes, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__scan_win_2, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_scan_windows_automation_process, __pyx_t_5) < (0)) __PYX_ERR(0, 953, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":972
 *         return False
 * 
 *     def _linux_automation_process_active(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return True when a known input-automation script/process is running."""
 *         return self._automation_process_active()
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 972, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_35_linux_automation_process_active, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__linux_au, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_linux_automation_process_active, __pyx_t_6) < (0)) __PYX_ERR(0, 972, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":976
 *         return self._automation_process_active()
 * 
 *     def _linux_open_evdev_devices(self) -> int:             # <<<<<<<<<<<<<<
 *         """Open physical keyboard/mouse evdev nodes for synchronous draining."""
 *         evdev = self._evdev_module
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(0, 976, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_37_linux_open_evdev_devices, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__linux_op, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_linux_open_evdev_devices, __pyx_t_5) < (0)) __PYX_ERR(0, 976, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1009
 *         return opened
 * 
 *     def _start_linux_evdev_reader(self):             # <<<<<<<<<<<<<<
 *         """Background thread keeps evdev timestamps warm for pynput correlation."""
 *         if not self._linux_open_devices:
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_39_start_linux_evdev_reader, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__start_li, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_start_linux_evdev_reader, __pyx_t_5) < (0)) __PYX_ERR(0, 1009, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1023
 *         self._linux_evdev_thread.start()
 * 
 *     def _linux_evdev_reader_thread(self):             # <<<<<<<<<<<<<<
 *         """Continuously timestamp physical keyboard/mouse evdev events."""
 *         import select
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_41_linux_evdev_reader_thread, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__linux_ev, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_linux_evdev_reader_thread, __pyx_t_5) < (0)) __PYX_ERR(0, 1023, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1050
 *                 time.sleep(0.5)
 * 
 *     def _start_linux_xinput_monitor(self):             # <<<<<<<<<<<<<<
 *         """Monitor XI2 events on the X11 root window for XTEST slave devices."""
 *         if self._linux_xinput_thread and self._linux_xinput_thread.is_alive():
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_43_start_linux_xinput_monitor, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__start_li_2, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_start_linux_xinput_monitor, __pyx_t_5) < (0)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1063
 *         time.sleep(0.3)
 * 
 *     def _linux_xinput_monitor_thread(self):             # <<<<<<<<<<<<<<
 *         """
 *         Parse `xinput test-xi2 --root` to classify XI2 events as hardware vs XTEST.
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_45_linux_xinput_monitor_thread, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__linux_xi_2, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_linux_xinput_monitor_thread, __pyx_t_5) < (0)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1141
 *                 time.sleep(2.0)
 * 
 *     def _linux_drain_evdev(self) -> Tuple[bool, bool]:             # <<<<<<<<<<<<<<
 *         """Synchronously drain pending evdev events (called when pynput fires)."""
 *         if not self._linux_open_devices:
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Tuple_bool_bool) < (0)) __PYX_ERR(0, 1141, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_47_linux_drain_evdev, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__linux_dr, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_linux_drain_evdev, __pyx_t_6) < (0)) __PYX_ERR(0, 1141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1169
 *         return found_keyboard, found_mouse
 * 
 *     def is_enabled(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Returns True if validation is enabled and initialized successfully"""
 *         return self._enabled and self._initialized
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 1169, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_49is_enabled, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator_is_enable, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_is_enabled, __pyx_t_5) < (0)) __PYX_ERR(0, 1169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1173
 *         return self._enabled and self._initialized
 * 
 *     def classify_macos_cg_event(self, event) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Classify a macOS Quartz CGEvent as hardware or synthetic.
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_bool) < (0)) __PYX_ERR(0, 1173, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_51classify_macos_cg_event, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator_classify, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_classify_macos_cg_event, __pyx_t_6) < (0)) __PYX_ERR(0, 1173, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1200
 *             return None
 * 
 *     def should_count_activity(             # <<<<<<<<<<<<<<
 *         self,
 *         is_hardware: Optional[bool],
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_is_hardware, __pyx_mstate_global->__pyx_kp_u_Optional_bool) < (0)) __PYX_ERR(0, 1200, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_input_kind, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 1200, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 1200, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_53should_count_activity, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator_should_co, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[7]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_should_count_activity, __pyx_t_5) < (0)) __PYX_ERR(0, 1200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1222
 *         return True
 * 
 *     def should_count_macos_cg_event(self, event, input_kind: str = 'input') -> bool:             # <<<<<<<<<<<<<<
 *         """Return True when a macOS CGEvent should count toward activity."""
 *         if not self.is_enabled() or not self._macos_direct_validation:
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_input_kind, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 1222, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 1222, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_55should_count_macos_cg_event, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator_should_co_2, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[7]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_should_count_macos_cg_event, __pyx_t_6) < (0)) __PYX_ERR(0, 1222, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1231
 *         )
 * 
 *     def _notify_synthetic_input_filtered(self, input_kind: str) -> None:             # <<<<<<<<<<<<<<
 *         """Log when fake/scripted input is blocked (throttled)."""
 *         now = time.time()
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_input_kind, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 1231, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(0, 1231, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_57_notify_synthetic_input_filtered, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__notify_s, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_notify_synthetic_input_filtered, __pyx_t_5) < (0)) __PYX_ERR(0, 1231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1251
 *         )
 * 
 *     def is_hardware_keyboard_event(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Check if keyboard event is from hardware.
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_bool) < (0)) __PYX_ERR(0, 1251, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_59is_hardware_keyboard_event, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator_is_hardwa, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_is_hardware_keyboard_event, __pyx_t_6) < (0)) __PYX_ERR(0, 1251, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1276
 *         return None  # Unknown platform or error
 * 
 *     def drain_windows_keyboard_events(self) -> list:             # <<<<<<<<<<<<<<
 *         """
 *         Return and clear queued Windows keyboard edges.
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_list) < (0)) __PYX_ERR(0, 1276, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_61drain_windows_keyboard_events, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator_drain_win, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_drain_windows_keyboard_events, __pyx_t_5) < (0)) __PYX_ERR(0, 1276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1299
 *             return []
 * 
 *     def is_hardware_scroll_event(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """Check if a scroll/wheel event is from hardware (Windows wheel-aware)."""
 *         if not self.is_enabled():
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_bool) < (0)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_63is_hardware_scroll_event, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator_is_hardwa_2, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_is_hardware_scroll_event, __pyx_t_6) < (0)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1311
 *             return None
 * 
 *     def get_last_hw_scroll_timestamp(self) -> float:             # <<<<<<<<<<<<<<
 *         """Unix timestamp of the last physical scroll Raw Input event (Windows only)."""
 *         if not self.is_enabled() or self._platform != "Windows":
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(0, 1311, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_65get_last_hw_scroll_timestamp, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator_get_last, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_get_last_hw_scroll_timestamp, __pyx_t_5) < (0)) __PYX_ERR(0, 1311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1318
 *             return float(self._windows_last_hw_scroll_ts)
 * 
 *     def is_hardware_mouse_event(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Check if mouse event is from hardware.
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_bool) < (0)) __PYX_ERR(0, 1318, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_67is_hardware_mouse_event, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator_is_hardwa_3, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_is_hardware_mouse_event, __pyx_t_6) < (0)) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1343
 *         return None  # Unknown platform or error
 * 
 *     def is_hardware_mouse_move_event(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """Check if a mouse-move event is from hardware (Windows SetCursorPos-aware)."""
 *         if not self.is_enabled():
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_bool) < (0)) __PYX_ERR(0, 1343, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_69is_hardware_mouse_move_event, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator_is_hardwa_4, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_is_hardware_mouse_move_event, __pyx_t_5) < (0)) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1355
 *             return None
 * 
 *     def _resolve_windows_input(             # <<<<<<<<<<<<<<
 *         self,
 *         hw_ts: float,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_hw_ts, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(0, 1355, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_syn_ts, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(0, 1355, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_bool) < (0)) __PYX_ERR(0, 1355, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_71_resolve_windows_input, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__resolve, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_resolve_windows_input, __pyx_t_6) < (0)) __PYX_ERR(0, 1355, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1379
 *         return None
 * 
 *     def _check_windows_keyboard(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Windows: Check if keyboard event is injected using low-level hook data
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_bool) < (0)) __PYX_ERR(0, 1379, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_73_check_windows_keyboard, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__check_wi, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_check_windows_keyboard, __pyx_t_5) < (0)) __PYX_ERR(0, 1379, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1393
 *             return None  # Fail-safe: accept event
 * 
 *     def _check_windows_mouse(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Windows: clicks and non-move mouse events via LL hook + raw input.
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_bool) < (0)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_75_check_windows_mouse, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__check_wi_2, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_check_windows_mouse, __pyx_t_6) < (0)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1425
 *             return None  # Fail-safe: accept event
 * 
 *     def _check_windows_mouse_move(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Windows mouse moves: pyautogui.moveTo uses SetCursorPos (no LLMHF_INJECTED).
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_bool) < (0)) __PYX_ERR(0, 1425, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_77_check_windows_mouse_move, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__check_wi_3, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_check_windows_mouse_move, __pyx_t_5) < (0)) __PYX_ERR(0, 1425, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1452
 *             return None
 * 
 *     def _check_windows_scroll(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """Windows: wheel events get a dedicated stamp (trackpad quirk)."""
 *         try:
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_bool) < (0)) __PYX_ERR(0, 1452, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_79_check_windows_scroll, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__check_wi_4, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_check_windows_scroll, __pyx_t_6) < (0)) __PYX_ERR(0, 1452, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1466
 *             return None
 * 
 *     def _check_macos_keyboard(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """macOS: Check if keyboard event is from HID system"""
 *         try:
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_bool) < (0)) __PYX_ERR(0, 1466, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_81_check_macos_keyboard, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__check_ma, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[46])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_check_macos_keyboard, __pyx_t_5) < (0)) __PYX_ERR(0, 1466, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1494
 *             return None  # Fail-safe: accept event
 * 
 *     def _check_macos_mouse(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """macOS: Check if mouse event is from HID system"""
 *         try:
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_bool) < (0)) __PYX_ERR(0, 1494, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_83_check_macos_mouse, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__check_ma_2, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[47])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_check_macos_mouse, __pyx_t_6) < (0)) __PYX_ERR(0, 1494, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1521
 *             return None  # Fail-safe: accept event
 * 
 *     def _linux_ts_recent(self, ts: float, now: float) -> bool:             # <<<<<<<<<<<<<<
 *         return bool(ts) and (now - ts) < self._linux_correlation_window
 * 
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ts, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(0, 1521, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_now, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(0, 1521, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_85_linux_ts_recent, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__linux_ts, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[48])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_linux_ts_recent, __pyx_t_5) < (0)) __PYX_ERR(0, 1521, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1524
 *         return bool(ts) and (now - ts) < self._linux_correlation_window
 * 
 *     def _check_linux_input_event(self, input_kind: str) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """
 *         Linux X11 dual-path validation (evdev + XI2 device class).
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_input_kind, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 1524, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_bool) < (0)) __PYX_ERR(0, 1524, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_87_check_linux_input_event, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__check_li, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[49])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_check_linux_input_event, __pyx_t_6) < (0)) __PYX_ERR(0, 1524, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1569
 *         return None
 * 
 *     def _check_linux_keyboard(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """Linux X11: keyboard event hardware vs XTEST validation."""
 *         try:
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_bool) < (0)) __PYX_ERR(0, 1569, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_89_check_linux_keyboard, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__check_li_2, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[50])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_check_linux_keyboard, __pyx_t_5) < (0)) __PYX_ERR(0, 1569, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1576
 *             return None
 * 
 *     def _check_linux_mouse(self) -> Optional[bool]:             # <<<<<<<<<<<<<<
 *         """Linux X11: mouse event hardware vs XTEST validation."""
 *         try:
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_bool) < (0)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_22HardwareEventValidator_91_check_linux_mouse, 0, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator__check_li_3, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[51])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_check_linux_mouse, __pyx_t_6) < (0)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":43
 * 
 * 
 * class HardwareEventValidator:             # <<<<<<<<<<<<<<
 *     """
 *     Validates whether input events originate from hardware devices.
*/
  __pyx_t_6 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_HardwareEventValidator, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator, __pyx_t_6) < (0)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1585
 * 
 * # Global singleton instance
 * _hardware_validator = None             # <<<<<<<<<<<<<<
 * 
 * def get_hardware_validator() -> HardwareEventValidator:
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_hardware_validator, Py_None) < (0)) __PYX_ERR(0, 1585, __pyx_L1_error)

  /* "ws_package/utils/hardware_event_validator.py":1587
 * _hardware_validator = None
 * 
 * def get_hardware_validator() -> HardwareEventValidator:             # <<<<<<<<<<<<<<
 *     """Get the global hardware event validator instance"""
 *     global _hardware_validator
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_HardwareEventValidator) < (0)) __PYX_ERR(0, 1587, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_1get_hardware_validator, 0, __pyx_mstate_global->__pyx_n_u_get_hardware_validator, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[52])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_get_hardware_validator, __pyx_t_6) < (0)) __PYX_ERR(0, 1587, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1594
 *     return _hardware_validator
 * 
 * def cleanup_hardware_validator():             # <<<<<<<<<<<<<<
 *     """Explicitly cleanup the global hardware validator instance"""
 *     global _hardware_validator
*/
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10ws_package_5utils_24hardware_event_validator_3cleanup_hardware_validator, 0, __pyx_mstate_global->__pyx_n_u_cleanup_hardware_validator, NULL, __pyx_mstate_global->__pyx_n_u_ws_package_utils_hardware_event, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[53])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_cleanup_hardware_validator, __pyx_t_6) < (0)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "ws_package/utils/hardware_event_validator.py":1
 * # cython: language_level=3             # <<<<<<<<<<<<<<
 * """
 * Hardware Event Validator - Detects and filters synthetic input events
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_6) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  if (__pyx_m) {
    if (__pyx_mstate->__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init ws_package.utils.hardware_event_validator", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    #if !CYTHON_USE_MODULE_STATE
    Py_CLEAR(__pyx_m);
    #else
    Py_DECREF(__pyx_m);
    if (pystate_addmodule_run) {
      PyObject *tp, *value, *tb;
      PyErr_Fetch(&tp, &value, &tb);
      PyState_RemoveModule(&__pyx_moduledef);
      PyErr_Restore(tp, value, tb);
    }
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init ws_package.utils.hardware_event_validator");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #else
  return __pyx_m;
  #endif
}
/* #### Code section: pystring_table ### */
/* #### Code section: cached_builtins ### */

static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_open); if (!__pyx_builtin_open) __PYX_ERR(0, 945, __pyx_L1_error)

  /* Cached unbound methods */
  __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_get.method_name = &__pyx_mstate->__pyx_n_u_get;
  __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
  __pyx_mstate->__pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_keys.method_name = &__pyx_mstate->__pyx_n_u_keys;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
  __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "ws_package/utils/hardware_event_validator.py":93
 *         self._linux_xinput_path = None
 *         self._automation_markers = (
 *             'fake_detector',             # <<<<<<<<<<<<<<
 *             'fake_activity',
 *             'pyautogui',
*/
  __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(6, __pyx_mstate_global->__pyx_n_u_fake_detector, __pyx_mstate_global->__pyx_n_u_fake_activity, __pyx_mstate_global->__pyx_n_u_pyautogui, __pyx_mstate_global->__pyx_n_u_xdotool, __pyx_mstate_global->__pyx_n_u_ydotool, __pyx_mstate_global->__pyx_n_u_autokey); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);

  /* "ws_package/utils/hardware_event_validator.py":113
 *         # Check if validation is enabled via config
 *         try:
 *             validation_enabled = config('hardware_event_validation_enabled', 'ActivityMonitor', 'bool')             # <<<<<<<<<<<<<<
 *             if validation_enabled is False:
 *                 logger.info("Hardware event validation disabled via config")
*/
  __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_n_u_hardware_event_validation_enable, __pyx_mstate_global->__pyx_n_u_ActivityMonitor, __pyx_mstate_global->__pyx_n_u_bool); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);

  /* "ws_package/utils/hardware_event_validator.py":193
 *     def _linux_reset_timestamps(self):
 *         """Clear correlation timestamps (e.g. after scripted input session)."""
 *         with self._linux_lock:             # <<<<<<<<<<<<<<
 *             self._linux_last_evdev_keyboard_ts = 0.0
 *             self._linux_last_evdev_mouse_ts = 0.0
*/
  __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);

  /* "ws_package/utils/hardware_event_validator.py":910
 *                 for index in range(ndevices.value):
 *                     name = devices[index].name
 *                     label = name.decode('utf-8', 'replace') if name else ''             # <<<<<<<<<<<<<<
 *                     if 'XTEST' in label.upper():
 *                         ids.add(devices[index].deviceid)
*/
  __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u_utf_8, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);

  /* "ws_package/utils/hardware_event_validator.py":946
 *             try:
 *                 with open(cmdline_path, 'rb') as handle:
 *                     cmdline = handle.read().replace(b'\x00', b' ').decode('utf-8', 'ignore').lower()             # <<<<<<<<<<<<<<
 *             except OSError:
 *                 continue
*/
  __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_b__4, __pyx_mstate_global->__pyx_kp_b__5); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);
  __pyx_mstate_global->__pyx_tuple[5] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u_utf_8, __pyx_mstate_global->__pyx_n_u_ignore); if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);

  /* "ws_package/utils/hardware_event_validator.py":1144
 *         """Synchronously drain pending evdev events (called when pynput fires)."""
 *         if not self._linux_open_devices:
 *             return False, False             # <<<<<<<<<<<<<<
 * 
 *         evdev = self._evdev_module
*/
  __pyx_mstate_global->__pyx_tuple[6] = PyTuple_Pack(2, Py_False, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[6])) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[6]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[6]);

  /* "ws_package/utils/hardware_event_validator.py":1200
 *             return None
 * 
 *     def should_count_activity(             # <<<<<<<<<<<<<<
 *         self,
 *         is_hardware: Optional[bool],
*/
  __pyx_mstate_global->__pyx_tuple[7] = PyTuple_Pack(1, ((PyObject*)__pyx_mstate_global->__pyx_n_u_input)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[7])) __PYX_ERR(0, 1200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[7]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[7]);
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_tuple;
    for (Py_ssize_t i=0; i<8; ++i) {
      #if PY_VERSION_HEX >= 0x030F0000
      PyUnstable_SetImmortal(table[i]);
      #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
      }
      #else
      if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  {
    const struct { const unsigned int length: 11; } index[] = {{1},{34},{46},{86},{37},{54},{48},{43},{35},{16},{35},{47},{37},{39},{49},{50},{49},{54},{84},{53},{58},{36},{45},{45},{30},{58},{54},{47},{85},{33},{46},{52},{50},{59},{45},{27},{32},{28},{81},{60},{179},{14},{13},{41},{49},{31},{51},{8},{76},{17},{246},{39},{87},{34},{91},{84},{0},{1},{1},{1},{8},{16},{11},{33},{21},{7},{6},{2},{8},{9},{39},{39},{69},{59},{59},{20},{30},{26},{59},{6},{8},{15},{15},{5},{44},{55},{54},{48},{5},{12},{15},{4},{4},{9},{27},{18},{16},{16},{14},{7},{5},{6},{4},{16},{7},{6},{6},{6},{5},{11},{16},{15},{6},{9},{5},{9},{8},{4},{22},{30},{31},{49},{47},{44},{41},{44},{41},{46},{43},{48},{44},{68},{34},{42},{40},{40},{55},{84},{55},{62},{41},{49},{48},{46},{47},{39},{43},{51},{55},{45},{72},{55},{74},{57},{48},{50},{68},{67},{76},{73},{67},{67},{61},{75},{43},{46},{30},{52},{51},{33},{49},{47},{46},{51},{41},{44},{50},{11},{15},{5},{14},{14},{6},{7},{5},{16},{20},{4},{9},{3},{14},{13},{4},{8},{4},{5},{7},{5},{20},{6},{5},{14},{14},{8},{15},{9},{13},{16},{15},{14},{23},{6},{3},{17},{9},{6},{16},{5},{4},{5},{19},{14},{11},{25},{26},{25},{11},{8},{10},{8},{14},{12},{13},{13},{11},{6},{6},{7},{3},{13},{12},{16},{13},{14},{12},{5},{4},{2},{13},{1},{7},{6},{6},{3},{12},{6},{4},{8},{18},{10},{7},{19},{26},{29},{25},{25},{4},{3},{7},{5},{6},{8},{5},{7},{6},{8},{8},{7},{8},{8},{12},{9},{12},{4},{4},{24},{21},{18},{21},{18},{12},{23},{20},{25},{21},{17},{7},{23},{7},{26},{5},{18},{5},{7},{12},{11},{6},{8},{4},{20},{6},{11},{15},{18},{12},{6},{5},{6},{7},{5},{6},{12},{8},{7},{7},{7},{7},{29},{11},{7},{6},{6},{1},{2},{6},{8},{7},{9},{3},{7},{5},{13},{9},{12},{8},{5},{10},{10},{11},{9},{18},{10},{6},{8},{13},{13},{2},{6},{8},{4},{6},{12},{5},{5},{14},{11},{16},{8},{7},{3},{22},{14},{28},{6},{4},{3},{5},{7},{6},{33},{23},{19},{8},{6},{4},{8},{11},{12},{6},{9},{5},{10},{3},{6},{5},{4},{8},{11},{17},{17},{19},{12},{8},{5},{10},{3},{8},{13},{7},{10},{11},{26},{23},{28},{24},{11},{8},{7},{9},{9},{5},{6},{5},{15},{13},{21},{18},{22},{39},{33},{21},{26},{24},{21},{2},{8},{9},{8},{15},{14},{13},{13},{4},{4},{6},{6},{6},{5},{26},{6},{5},{4},{32},{25},{32},{39},{18},{22},{26},{19},{29},{26},{26},{23},{29},{26},{11},{19},{25},{23},{24},{16},{20},{28},{28},{18},{21},{20},{23},{4},{12},{6},{23},{20},{5},{16},{24},{16},{25},{26},{23},{11},{13},{23},{20},{8},{5},{6},{5},{6},{7},{13},{5},{10},{5},{9},{12},{11},{10},{10},{15},{2},{3},{5},{4},{8},{10},{8},{4},{32},{3},{11},{7},{4},{6},{2},{6},{7},{4},{3},{8},{9},{13},{4},{3},{11},{4},{12},{5},{6},{2},{9},{12},{6},{5},{22},{10},{6},{2},{3},{2},{4},{8},{11},{22},{18},{7},{22},{8},{7},{3},{6},{8},{9},{32},{34},{9},{6},{6},{4},{4},{3},{12},{12},{10},{21},{27},{6},{4},{6},{8},{5},{9},{5},{10},{5},{25},{27},{6},{6},{11},{3},{5},{8},{10},{7},{10},{6},{25},{27},{6},{6},{9},{8},{4},{9},{5},{4},{7},{9},{2},{4},{6},{6},{18},{12},{5},{12},{13},{7},{10},{7},{11},{3},{14},{6},{9},{4},{18},{5},{6},{7},{6},{7},{6},{4},{7},{5},{20},{21},{20},{14},{24},{18},{28},{25},{26},{28},{25},{26},{29},{26},{13},{25},{26},{8},{6},{18},{21},{41},{7},{6},{10},{12},{8},{7},{1},{1},{1241},{114},{286},{59},{132},{205},{137},{15},{224},{31},{155},{114},{80},{90},{434},{15},{55},{495},{28},{222},{103},{72},{75},{170},{114},{259},{675},{81},{215},{254},{470},{297},{127},{139},{130},{113},{133},{18},{125},{255},{271},{51},{2},{2},{92},{80},{47},{183},{28},{106},{87},{135},{53},{32}};
    #if (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (8227 bytes) */
const char* const cstring = "BZh91AY&SY\3545\364\322\000\007\325\177\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\300@D@@@@@@@@@P\000@\000`#\277{\315\212(d\030\3647\270{,\363\225[\336{\236.\300\000=\261\347\260\233\267\266[p\266\327-\306P\367i\351\224z\003Z\326\330\320\353T(\351\316n\261\254\326\247a\220P \006\217\260\247\322@\331'Mp\037{\000\300\224\"\010\020\300\000\324\304h\322z\006\215OB2h\302\215\224\304\232f\230&\232\233Se3!2\030\232c&S \000b \004\0215=556%?M(\017P\365=5\r\250m\251\036\223@\003M\014\200\000\320\000\000\320\320\032\000\r1\010I\022b\236I\246\232i\240\003@\033Hd\323@\320\302<4\364@\215CA\221\352i\240\r\000h\014\232h\022jA\010ShDi=F\236\223\322i\246\232\032h\003@\321\2654\323&\232h\000\323@\0002\r\031\003L\2310\020\r\022zD\247\251\243\324d\365='\242\017S\3220\230&L\206\236\247\264iOM\032\236)\370\244\364L\030\247\246\241\204\000\321\210\r\031\003L\004\211\004\000\200L\202\236CM\032\t\240\323T\365<\247\251\351<\246\324\323OSA\240\000\000\000\000\r\000\000\007\377\032\365h^>Q\033\211\271-L\357\234\344\243\303\362l\236M\0206\301\304\020\320\260U\263+\330\362-3\305\007\304\360|\237G\322\364\330\311\352\023\325\017X\270\027nz\350\271\277aaU\213\222 \031J\361&\034\322\266\204\240\212l0}t\230K4\255\256-\t\024:\262\340`\0011x\003\331\036\314s\204Dm\0031\031\031\013U\271J\212\210\202~\023\260B-\251T\252\026\242\3032\352_}\327\023.\273m\264\334C\200pQ\004X\252*E\212\254\212\212\254PX\212\212\n\nAa\001\005\021`\242\254E@U\020@U\026\"\013\030\356\332m\267D\n\014Ch0)E\201\2072A\207\315\376\027~\354\276|;\304k\270H\311e\246!\3049\222\002\220EE\2022E\024\2020\026I\025\"\013\010\260\200\212\301T\"\252\214bs\224\325\020\250\252\2155U$\244$6\201\254\201\317\r\373\254@\r\020Z[\002-g\212\342\241n8\252QR\020\006!\000\253\347E\370\010\260G|5\231\rY\020FAdF\003\010\360\233\2727\276\375`l\310\260R\n\n\nDE\202\311\005\005\222(\240F*@RE\222l\214\005\211\356\367o\232\032\305d\013\302r\031\206\243%FG9\214s\020x\234\223\223\214\342\007>\007v\003\262\002\006\005\037\201W\211*e\253J""\326\0360\034\323j\271\267a\330 \324\254\227\020g$\022\303FU\213\223\np]\305\031\016E\364\243P\327M\013\232X\322\305\254\330\305\034\341\316N\001\302\000\2600\206\231\206\206\327\017y\312\006\301\304\271\271\222M\303\010\244T\030\306\007\035\344\337\r\347C\216\306\371\016d\025H\240((\nE\024X\002\213\300\005\021U\224\201M\216\007\000P\340\223\204'\002p,\\H\027\227\277\275\003w8oA\200\214\"\233\332\036\227\264\236\n\022\365\033V&\251\347D\027\212\313f1\244\332\000\266\325\232Fb\326\030-\206\313W\270h\226\274\322\325\303]\232\230\332C\202\023\201\206\271\nLr\030\334(\tD7\2505j\325\277!\002\310hlY&\230w\263\320f\330-\236`\271l\363\314@\032\223q\270`\221\201[\314\\\003\204\340,\014\r6\257@\203#\024\213-j\361-\030\024\240\006Y\023\252-%\356JCG\254\274\220Vl\206\257\317+\326\374\266\214@\33237\362\307n'D\215'9\022\206\336\2223 \317\340\305\030\241`\255\021\177\300F\030\027\222\226\273T\212P\007\020\212H\266X3v\253U\375X\373\025\203f\020c\271\016\016\254N\361\007\272-\231\262)\347O\024<\377.y\266\220Y\n\307\231\351f\346\222\257f\007\371\311\265\217I\360t\"t%i\252\201\331_>\304_\213l~O\240\357\320&\314 \364\262\252;0\351\252\372\336PB\234P\371\307\316\312\271\210\021{O\002\272\"#\350;\377fd|\037\312\264\206\225Eznv\342\\\273\303\010\217\316\321A\274\373\321\031F,\371#q\201\274\031\365\302\007S\326\252\232##\313i\311\262\325\261\001\352J\263\313/\022\302\227[7\371\3635\036d\3501\246\307\344;\004\227\327\200\260\333\2039DI\333;\215\226\233\224\213c\324\345\333C(\264\353\223\325\366Jb\220\2375\037.\002\325\275D\373\337},\373;\014\276\0340\257\2066\300\230t\203\323J\340gqg\237\022/\2779\0079F\025U\3531\314:]\246\317VH\361\344\330\307\256p\354\343\r\244\211\360 L\367\365\301\352\272\311\307\2217@\2316gl'9't\303\211\023t\t\207\n\314B\010\025A\037\003\3108\232\334\226nZ\005\023J\2201*\r\022I\016xU\032%c\225C\350\r\303\255\227\223\2344\200u\361\306\247]\013y\347 6\0008\256r\264\220\352\210\217\274\251\0277\342\342\240\343$\346\001\334N\206\347L\036'\314\221\243l\032\352z\3273\314""\201\263A\243\221\346\240\377^\"\021\t\n\304\265\254\221\254\325\030\016Fh36\356\374\316}\014P\261\026\034\370\343\301\2764\303\201\241\242\336\215\\2)\307\311\257~:\226z)\356\2730\314\310\372\365_\337\316d\203\357yf\313\010\226\026\300\024\304\261F\302\255*\t@\254\224\220\255\203{^\371\311\320F\310\270\242\021\206u\205\330\243\207\005:`v*5\342\230\205\342\245\352\235\233\276-\031`\223;\027\0359\326\334M\255\236\326\006\313\025m%\204\303\255]\321\357\276\226\273\203\003\302\272>\2235\267\241\354;\211Oe\0354\2622\006O\267k\307\232\372\033\231i\351R)O\022}\005\267m\247\212\365\200\255\312-\304\024\025?\236\314\277p\330\303\322\000\243\345\211M\221\r\023\221\r\251I\323V\254\276\311\346\370\317\007pl\230\316\272x\215B\226f\265\217\323\251\315{[\364\216\267\225\255\213.\304\315\022\301`\256V.\213S\037\252\201\301\021.N\232\270\257T\235\376\020\036\231?\022\356\006\207\273\253\002\217\264p:4Ax\227oS\226\343\355N\375\333\350\213\377S\207yE\321b\333\026*\326d\313\237q\2331\231\255p7f$\034\004\241\202\\\t\227\t\250R0\235\002\t@\002+\0132\014\227J\335!\200\345\n\2513J\240I\252\244y}\316\370\367\235\362\335\350\016o/\301\370h=B\305v{\336=\233Q\211\263\034L1\352\310\311[\374\036\277\3379\0023H\315\n\250\315l\357\345\220\373\274\374;\277{ng2p\341\334\346F`D\211S\237~\373u\307-\201\260\0266\036\02128s\347*\2065\002\242\007\243\312\360j.os\350c\261\226Yd\017\337\036\205\356'JPS\252{e\273lk\314\332\355\252m\233\313\246\366\310\216\274\212\345\205\031\372\276\356\205 \242\026\264ns\316\212$D\210\253T\300g\333\261c\264x\001&K%\3139\354\350W\256\265\352\216\2752\210\0230\312\244\235*r`\234\tC&\314\251H\354\301\324o\376t\027\366\213\351=\237\273\332=(\364N\244\177\022IA\n\340H\005Q\354\300\353\357\335\327\241\002R\364ymh\263\016\240\3200\242nz\325\330\203\032P\251\264$\247\023T\252\356\003\004\230\254\243\226\tA\325LZlV\201 \246\321\3034@\250\366X\034\341\222\"\007\242\257\342z\322\377\334\\\262\2747\217$\351\331\324\370\324\313\257\371z\006\260hn\005\305C1\3629\335\026z\337\244Fz\212""\212N4pn\314\233\203t\234\367\224\326\034\332\246yZ\356\336\227\275\017\203\352\305P\3259\344\254z=\005\252\313\026\022\021\"\323\276\323S\351\345\2650\263\010\347\373\336F!sx\340|08m\263kT\n\341!!\271\255'\223$\250\310\343\372\365\016\207\344[\034\0263\376e[Y\341\033\275lAq\344\246T\013\214\226\025\367V(\367\020\034\030\216YI\203\324o\254\365@4\026\362 \211\262\033\033\273\327\003BA$Lx\364NL\272\344\213x\332\252\205J\324)Q\325\207{[X\250\025\022\240\211Q\rB\251\213\251_YV8\241\252\"\027\253Hl\025sS4\224f\236\357\323\253\252J\r?\\\353N\317\213H/5\026\224\021a\375\222\007V\022\n\234,\252\252jC\250\256\305\343g\035x\231#\332p\323\036\252\245O\206\206G9\320\304\263\343W8'K\311\215\361&n\022\351\242^\272n\351?l\245\"\365J\373-\366?=\022CQ\201\222>3\216\346\354\262Y-&\023SP`\267\222\302\214\325J5MZ\333\020b,\215\022C\305\356ngW\013*-]k\004\345By:y;z$\205M\r6B\254\341\366\3271W\211\236,068\315\310\006\027\255\260O\336\235\251\225U\231\244VW\014\314k_\331r\355]K\001t\262j\235\372\025\353\342U\250\310,\333\333\020\302\005y\345{\374V\014z,\217\246\233\311\3515'_3\0330M\021TQ\005Z*\230\340:\272\025s\244\274v}\036\302W\310f\211)w\3113\246\345\022VwH\014B\032\252\240nt\256hx\363\320\350|\366\347\316[E\232-j\224X\020\341S\242\211xi\361o\\\322~\025\220\333\276z\370\367f\224\276Zg\327\267k\"0Fp\007vx\263\034\234\230\320\027B*c\335\250\326\245`T\366\324^\304<<gL#\000Xd(.\214\214\024\010s\211NV\034\315B\262Z\260\315T\212\370\034.\311\243Qd[\025\265\241F\200\317\272\333\372\016\254P\200\262<\032\310]\317\312r6\031\233\373o\263Z\271e3\274\305TM41\252\0334\261\014b\250\"\346\266\255\220j\351i\025\3512\036c\206k\251\324\327`\237|#\371&{;\031-&\235\260\265\207\206\226\023M\013*\\\027tu\374\240@L(\371\3539\241\250\351\"T\352s\344\203\253\223}]>\236\001\301.\0369\223<|\2647\206\0336\375\341\343<\002.\023\345\037S\352m4\320\330l\366\262<x\265\305\207\323\311!/FW\002\344\334\036\030>^\363\341\346Y{\261\036\201\353\004\212\361\301\226\356\307^pOm\343\236]\016p\222\262C3V\275\372\026\261\246""\255\2765u\016kb[-\332MNm>9hfU\223\365n\350l\224\366\245\t\014\026\213\373up\324\246`0\tJ4Q\211B\307\021X4\372x1F\236H\242\235\264N\327\311\031W{5h\242J\316\350\367)\377T\261\2474li,\243D&\223\353\374\246w\256\203d\235/\240\335dw\323\207$\353\265\014\255\235\204\3357%d\312\212\312\344\211\223\252@\264\2645\345\314\226\261\244\245:N\253+Yr\340\177\0067;c\232\036n\375c\032w\366[\n\225i\273\017\202\273\253\300\206\"\003)\270u\325X\330e\226\370 \222J\201x\274\313\001\247\026x\032\232\001\033\315%\265]2t\311\322\314Z\271\3716\330\265\260@ar\276\005\252\367\024\261\025\202\010\202\215\306\327BTd:\304\220\365n\326\305\313{CP\314\244+\205\276Z\024^\341\314\326\211\356\256\354T\220\005\335\266\325\236,\010\263\321\347z\000 @\326\303bN\206j\205\370\2404\014\360q\263X_(\245n\032\233\316m\260\353\311\222\346\232\313-\204\rlh\031\311\275\326\025\030\244\265\240\353\007\226\002\261\n%\022I&\207-[\277&\324\215\314r\234Rik\035\231\313\006A\r\311\366\214JPP\022Z81\013+\004\246\341j\023\2046\t\302(NVU\240\014\306J\033\036\230\271S\002\024\316\226\342\274`\240\004\220,9\030\203I\310{\001\252\013\200f\252\267\016\r\\ \210\230C\020\266\034\025\246\253)\312p\242n47\201\240\274\034Xy\004\350n\331U\330\252\303M2\342Q\235\n\332t\t\315\nc\007G\211\265 J\356r\022\202I\032\004\\\251\344#4:\035\335\313\317\345\351\347\255\246\276L\315\266<\323m&=8_\304\017P\036\245\323\027a\314e\376\337\013Z\003Rn\364\"\334F\321\244\020\260\340$\177\243\000\325m\234A\242\301\374Z\221\337\326\217\256\020\014[t`\372\334\311\234\333\006\254\356bCI\t\264\333\014y!\032nK\346\365\034\203\037\351\302@\245~\014\245\010\324\013\002\207j\200\033\205\334q\300\207\306\237b\225\221\360\262H\204w*'\023z\364\316\317S\263\354\230I\226X\314\344b\242\242\221\220\221\000\304\001\025`\027_\323\321\221E06\213\325\273[\035o\351A\3535\302\021\206wd\313(u\272\310\325\007y\270\343\311\344v\324\227\000O&\"\310$X\"\300\232\315\2511\000e\324W\314\2358\tfr\202\375~\2205%\2210\237\220\017\266\017(|\377\035\314\230\377(0\327\212\223\362\002""\3725\025A\017\365@LQ\031\254\031\004\315h\313H\242$\344\330\221\214*\240E\2731\t\263\027j\303\2620-\223Z\304V\311OV+c\217OA\326{s?\037\317M\322\227\316S\211G\355\324*\301\024'\322\200\003\312u\22411\311H\304skY\206\343\352\246\245\000\0272\245\250y\373^\217\221\362Y\241\021\240e\330'\267\t\273\227\226\323I\311!\340\245Nv\0102-\014\304\235\274\205]$\332\310\nE\334\026\341\322\253[S}\210l\201r\373rs\333)\272\210\245%4\222\222\241B\242\232|\0216\3578\324+\233\207\003\331n1\370\214\216\227\213g\227\023,\247\251\312\244M\352B\030Tt\003\tt\271\010\263`\301\260\311\332\330-\354\205\273f\026\362\203l\253\320\274\t\036\003\302v\363\325#A\233rQkXKp\004\270\201d\237\225N\3202\005\313\201\316\232ZL\223vD\021\021\347sT\006\2028EJ\207\\Ym\021cEH\246\312 H\230\351\272\342\274\244o\264\346\276\311^\202\222(\332'\350HP\271\244+\016\211\242K7\215\243\323=.\312\214\202;\255\276\3128G\325\312(\206cZ\332\035\312P\352\372\273\r\224\260\251\000%\231|\216\267\245\364\027\007c\tl\006i\016/@\010\261'L\t\002D$\0149\372\203\252`,\332\301D\253\006\376\220\322Q)\013\024\266\021\243\215\372Y\240\204\204n\341\"a\016\010t\001\307\212IF\010\314\220OD#X\225e\013A\316\373\345\317uB\372^\307t\342\315qG\330X\312i\256\343!\304C\252dC\033\020\350e\234\004\"\031\304!ge\0131\204\346\"\202\002h\345\014\2421\211\002\346\263W.A\357\242Y\036\354\330\244N\000\024U\016\006\346\306.\361&t\002\007\n\277\006\200\377x$\r\3157\271\250\332\017049\305\t\323\002w\004'\027%\025Y\003\271\232\001\232\r\304\372q5\244\333T\350\367P\222\304\244%\002\266\367\263\220\216\337\035\2611\034\341\307\306\360\0028j\351G\251\215\304E\220\216\321A\031\201\016\314\034i\306\210\355<V\265W\266_-h\326\305\2725\217A\006\326$#H\201\020\322\346x\316\033\006\341\211h\302D\243\205*\263\252F\355,z\335\372A\013G\323?\202\201b\033\363\226[*\006\312R\374\221\215\335\375y\336N\341X\373\215k@\303\2146;\002-\326\022J,\246H\210\033p3\236\371\310\236\251p\245i2\275\033Uw\271\225\232\204\217\225s\316Ih\360\310J\210\260\323\036\027}\200\274\"@\325\217""\021K\234Nl\272\220\340\266\3459\273\022\024\270\037\242\303\211\3044a\322\303\235\353\346\013\001H\t3\332\350\216\345\345z-\322s0\324\005\337Rr\207V\010\n\244Y:S\024\337E\365G\235\377|1 \364\007\241#\320w\236s\323\364\027k\314F~\344\216\226k\366\271yJ\035\326\356O\215\320\263xN\202\310o!\345R}\024.\351\307\tYLCp\215\301\271z\267\243\325\353\320\021\215\316\016\340a\224\363\340#Y\252\235\263\335\306\255W\301\0241\274\271n\341.f\253\350\352\312\371\2055K\005\00771\315\300\2707\353d7\257d\266\000K\331\273uAYM\"\3262{ \021#\265\242!N\nL\274\325@\010\032\336\211\241|\215\005\234\323\306\241\213U\237gH-\374\347\277\364G\252\324#\262\350\367d\241\036(( ;\316\363\206\336\275\266\000\221\267\245so\026Mxy|\332\262\256\304\311\036\354\346\\\347\332\014\266\261\005\317\035\307/4\344\214\217\006 Z\r1\357\251\003\252\020<\335\312[v+`\006\320\304#x]\2147\236\254\375\355\373l\025\215\022\\9\262\254\311N-5&\264V\r\005Ucy\315\320\274\0269\214a\276\2443c\245c\245\233]\371\025+\303i\324\220l\030\320\204\336\356\214\220\226\203\0016un/\0103\236;;[\223($\224\322p\330rO\221\277\234\007\343\210\354\036\rp\325\266\231-\322 \211\206\222|u\220\302\226\245&!\211lb\367\241G\211#\305\336w\257A\211\246S\361\335\352S\310p\267M\354]\216\236\225\315\317\270.4\312\204Ud\030M^\000\205\374e\207\244\375\277{\224\216\004\035h\233\241\000\036\rR\354\3246E\226\375\343w[\271\035\234D2!\372xK\265\236g_\2558,+F\323C\017\005\250\345\337\347l\326\203j\021\272\212\350\200\2700\300\277\020\261\203\350$\302VqpH\301\005\326J\300c\006\320\322/\254\245lx\\\245\210X;>\234\014\200H\306\353WVW\001#\324\266\354\354;I\005\003\212\351U5B\201[\265\2577\303\355\217@%\253Z\362\345-\337F\312u\270)\253V\214\324\341\t\266\027\025RR\232\207\277\307\326\273\216\303\263\354\375kmO\035GF\336G?\235\306\341\"\346X\301\334\000\375>I\033\326\344o\243\336\321k\232\266N)%u\352\022l\365\220\022\222\ng\244\200\362\264\217\211\242\231\274\032\225\226\303\221\3539\034\275\227\032\231c\276\331\310\0244\211\2714\306\273\t\266\014\250\005|\311""\207\"P.LH\371!\224 #\022\220\230b|\261a\024\013#.\266X\216\205|B\275\272\337)\271]\204\352\351\t\302\004\251B\002\345\212zEe\230\274\346\251\361\245\304`J\031\3650k4\233\261$3$a\n)@\272\nfK\227A\002\206\315\003\215Dd\233\023\022W\230\273o\275\215\362J\210\022\017\022\201\031\002\232\230\275\256',\032A\260\n\260 \236sR\022A1\360\367;\322\315\317\276>\342\026o\207\225\0000\222\326\340\023\000\366B!\265\352\360\236f\333\177$\225\334s\327u\3575\360oK\251\363\264)\261-\020f\373\245T\344P\003\354k\2631oIy\"\000\206\252\333H[8\027X\264&\215\315\264\274v*Z\342\343\356\201\211\0238\241\227\353\214\274\036\214\243\246\365\261\\\rIf6\242\216\010I*$\312\030(\242\316=\252\347>fX\250\031\345l\246\204m:t\304K{\321\233(\270\366q\014\303C6\031%\034\377\0303\222\\\343M\241,,\251\306\276\325Qc\270\r\241s5A\271\237\032\224\000\226\007\233\307\3324\304\313\343s\tD\032\007F\235:\332\231\205\320]\302k\306\010_\315@:!\352\354\001\305i\262\334r\020\365\263\3052\246`L\\0i\337u3\353\245~\201\374%\376h\365Ima\316\322\355a\313a\206\334\267\302G6\246\266Y\316!nb\006\321J\373S\226\277\2034W\345\217G\264\321\350 =\301\036\304{\017\220\252\255`\027#\317\240\311\017\t\204-\000\205\250f\021\010\300D\313\014b\230\251\010Y\251\211\014\\\020\022\022_\225\210\227T\312\225\006`\323Tz\016&\371\316\034\246qX\261j-\ne\334W\022t\030*\212(I:\325@u\212\245C\235\241\235FR\260\264\355a\334\037'3\257\332\032v\020u\337\333%f\016\214B\201\245c\022\022&\300<^Q\006P^\022V\311\313\267\270\203\023\330\313\244\34505\351\235\243J>K\266\220\335>\316\035\300\234\265\311\236\346V\001\2432\"\027\317\347\367hTui\266=\320IGu\310\250\320\033Dr4\367\366\000wg\003\262\327\241n\005\023\342\305IaWNkq\205\321w\244\275\356\222\3154*\236\333\255\325;\037\003W\274\354f\335\317\014vw1\033\0245\357\335t\353Sox\337%+d*r\2456M\364iv\324_\206\002tL\341Wd\n\265\002\227\235\006\356&\024\211\230\361!hZS\2338\223\306QDk8\230\334\2105\313\353\003W71\235q\003\0010\313U(Y\nT1\234\2218m\256\232f \035\244\004'\"VH\201\306sJb\257\037~\001\362\260""\353\333\330I\244\355\316'|\300\255R\271\324\326\353v\301nz\232\000\265\303:+\030t\301\225\345\242\031O(\005\272\023\215r\347\207DW\033\013\201z\333\266\302\034\026\222\317n\\\327\2166S(\250\356{d\214\267\275\373\221[v\305\2311\2646\004A\010c\032tg\035t\234\355r*KT\205\"\212\261N<m\007\2305\340_\234\314\326\031\307]\306\225\266\334ji\204p-\251\033,\266\362\222\316s\r\335gy\330v/7\247Wn\032\271\216J\225(G\222\206\251\222\252\255I\313\212\201\214P!\247a`\260\303\267tb{N\255\213^\251\002\002j5\257R_[\214\305\255f\244(\244\262\342\001Q\241$\021\016\"bp\304\310\246\241\300F\203Q\202\002\034\034\365ICb\342pGT\200\367\003[\035n1\200\214o\260\231V\202\342\"b\260\305\332Cnaa\230\3459H\227\030fs\230\353\244\360\204\212\021\215\003\014m\220h6\247b:\211\316\324\007n\0356\\\204Yp\242\363\001]6\026\366\347C\200\2655\262X\006\301\240\033s\204!\204\021\222\036\022@[\216W\352\003t!\320\230,\334\3331\t#\026\016\251@\351\266\3527\351\316q\301\2038\262\035\032702\211\024R%b\334\227\245w\324\334\333~xp\3044s\301\221{\266\005\235\346vI\243[\251:[e\302\366\304\227R]K\250\352:\216\252\205Dl\377\216?\212@h\271e\3105*T\223\202;Q\2757\264\277v xB|\344\370\236\002\242QcSR\257\266OY4\252\271\315w\320\327\215\200(w\264\005z\347?_X\204U\230y/t\355\252\257\263 m%\022\030\377\tB\330$\203\234;\022\354;;;6$,\021\273\230A\273\245\303l%No\004\010\364\260\n9\325\006mSa-ZV!\221\220c\"I\001\t\016Y\001;\346\002\206\233E\264\346\270WS\rh5\201\255k5\353=\354\221\260j\3708Hf\304A\003m\203\362\371\350\200\026gE\213y\330\316\024\004\216\233gP\301\243\025\302\262\004,ew\345\315\035\306\375\373\315\276A\007oL\003O\314\320\205\032x2\366\354\235\234up8\360 \013\316\253Nv\263\032\370j+\031\331v\242\274:\327\005\303\255k\267{\322.\226\242G\273:J\204\242K\303\"\302~P\232\232\000{\354\244$l\221\345`\036\216V\222xz\013}xf\372\315\253gv\010\362\010N\210\340\212\370\025T\300\277O\r\211,U\307\035\377\367\356\273\257&\377\230\267\354O}u=\017\375\352\317)\001\214U\024PO\033ml\007\004\203\017L?\240\362$\245'A'\332\004\210""\204`\310\214\024\250\225\024T\222\2177\275*l\236\262K\311;\343\317\016\344\265\007\356\033\002)\013\177\212\201f\230<\317n\365P\224\2052\314-j\246S\030$\375\202\024\301\013\324% \243\005\200\201\331\177)\207\316\343r\342x\225\037\354T\231a\231\017A!\345\263\371u\355^m\005>\021\345\226\264\365*T\377l\207\236\300\024\214\372gV\212\246\244\245\020\242\202\2452\277\025I\356\231\014_\270\260K\242\207\330\361\377\301\332\240Q\217M\017-\372\"Oh\257n\371Z\354\333\275\265\255\340}\234\367j\365\374|\0261\367\2513E\220\262\na\202\370\031\356\217\245<\303\270\250wG~\371\3239\365\302\302/\216\341\300\036\241\350\037\014i\350\310\360\272\020z\031\374~y3\353\221T\342\304!\014\212$\372\2656 \246<j\014hPa\326\265\264\376~:\273w\307\335\237f\005\177\310O\355\324\371P\342e)\263\224\027\275uMs\3634\316\306I\343}\357\232\036\212\211\341\344\205\036\305\355Ie<\203\277\265\353\026\037&\207L\230+\312\266r\321I\257\317\235t^\315\236\221\2214\204\343BB\003p\300`\200Xw\276\205<\031&\266\332\222\003,\251\240\253\023\364\316\224\033\0335LW\333\206\007K\nTTP*(\212\237\300\023\351\323\r\237P\331\0301\202\031\"\316\356\347\222<\2571`\364\354\216\220\002\231\237@8\256\227\247\021q\274\n\215\251\017\001T\313ycT\027\223\321\350\351!\037\335\237\340\200S\324E\365\005\202\327\260nK\241\331&e\337\346\343\320\257Ln\352\361uJ\340\034]7\341\314\332\007\253\\SP\305N*\007\021\366\032\034PH\310\255\036\242\203h\300\254\277\250\006\312\014\2651M \036e\nF\365\027~\"Q>m\003&\031\004\236.uM!\177\333~\265\277\0325\244 \022\201du\276\317\341\337\315\375\235?\"\001\261\325\251\337\024&H\235\3679\002[\375\256,\236Mh\014P\241\325\361z\207\217\246\267\256G\352\320\347\326;\220\204\014y}>g\267v\022o~\001\304\276\347\271C\365\235\317\223\272\252\305\024\367\330>\303\273\031\002\306\310\330w\177\312T\313\271\006\331\344\372{\370\203\343\236mx\357~&=\037\304\272\303-aH\240\307i\212\307&\336\261\000u\370\227!\\[\3033\353q\311#\022\007\265\\\235n\277\2436G*\273;\271I9{\375\343\372U_Wr0O\003\331\312x\024\360:%\225\023\274""\344\270\343h\374\344\241\352\003\230\377\001\363|\014\275\364\357/\300\341\236\365\376\036\037\024oa\3778\346\377\222\245,\177\023\224\035\010p\366\374?1\335\222c\265\332Q}\276\323\200\027\334\315y\323\333\322c\266\363U\264\337\037\235\346\371b9\207\322\354&\3231\374\314vp\261\333\023\347Kq\251\331\305\r}.\261\201\305\325B\017'=\200\201\007\223\263v;.\301\351\361\3658\213\372\343\217z\035a/\2710\317\344\375]~\302^\276\316\244v\2626\300\337\330\344}\244\275%\332}\200h\300\276\321\023y\302\363db~&\376\277e\243\035H=b:\334m\2169\260\323\354\014\341\346\334\216\250\373\303\223\214!\323;\312!q\337$\357\356\021\201\254u\244k\315\351rtx\327\205\274\330\003\250/\210N0\002\337\216;\033q\351\200F\t\364:?\0267\364\220\351\230\3673G-\020\337\360\230cN\370\250>\367M\014\031\212<\014\352!\243\364!\272(\213\036U\341\003d\326\350|(\200\355rc\354s3\273\003\335\3553s\334\346r\247Y9yml'\321\371\363C\017^2\211\313\210\370\372\353\312/\306<H\027\343\366\010\322\217S\253\305\346\344nG\034\217\210VS\307\303\307\306\354<G\033H\346\211bt\016\353-{\272\355\266\334W\024\201\246\253\232 r\264\206\351\2030\034\357\007%\232\330R\330\363\t&\\5}\356\022\345\211u\013\375)\311\225j#\213\032\352\022w\276\006\245zeD\232\315m\010\262\rU4\245%Li*m\267\203f\030t0x`\337\357\\\340\360=\303\372{\352w\274\375\234\252\345\027/G\344Z\347}V\267\222\232\032\352\274\233\030|\213\303\247\207\005\007\366\016\321\366\232~\333\272\217\303\320\303\330\357\2142]\275\342<\247^\377<\323\226\367\367\341\025d\370m\360\177?\221\341u\2215\251\317r\236\222T\363*V_\t\355\277pY$\024\220\024f\037\n}\350'F\262\252\231C\350\0049\324\230\324S]%\"jy\204\360\232>\020>\324N\330\253\301\230!a\017\250\305?(\242\242s\245\224\350\334U\0034\314\334\231KH\310\307\312\275\245\0232\351\371\221a\0369\013\231\333P\272\361\354\243q\275q\241\362\326\027\317\344\005\327\203\211\330\375\023\306\361\303\303\031Q&z\217\273\034t;\236\322}C\036t\314<\247\327w\375j\376\037\021\263`\341R\342\220\275J\274\017M8Q\210[e\207\010\331\031\315M\021N^\032X4C""\220g\022Hd\020\216hI\221&\245B\0366\246t\031\2044\r\262\233\224\033\220\214\264I\314d\341x\217\004\207v&^v.X\t\353W\205-\243X/\0077nnEc\014\371\200\244 \204\\\274gY\376:\300\261\200\261E\214\245@U\01357x\000k=\373\200\353\204Q\215\306\277:\036\337p\260^\035\347v\345\030 \211\022\312[&nmp\205K9\234e\022\350c&NP\253\307\215b\214@\234\337+Y\325\346\303G\343-pU\344^Q\013\201fI\345\207/\033\003\263\022lu\366\305\341\r\037\003K(\3368\326\261\252\304\341vT\263I\031\241:\344\245\0038M$j\3114?dd_vhmsp\334JU7k\261\203Zc.\34362=\356\230K\353\014\027\255\007\256\370!Y\232\001\347\233>\320\211\220m\275\262h\234\343\245\273X\325\353:\010\3108L\317d\3463IS\303\315st\261=\375\314\321n\214\354Wu\273\023;w\\\0235\255\203\033\023\270\2538\265\2441\313\3227Xl\026b\00616\0373)\233\034\002\363\260\005=P\241\207j/e\303+\235\253\211\331F\216\332L\316\302pM\320z\3575F\255\343t\275\273\275\326F+b\234\356\232\006L\255\254\302\264<E\206\360\205\214E\\\247\213\224\216\314K\254MO\356v\030\240\231\300(\234\256\367(5%\212/\005r\332\004w\214s\316\ra\006\201c9O\275\252\251{\215\272\030\272\\,\266\235\356Q\203\2149\275\306Z\366\3061s\2623\251\300Ch\351\244\344\335\332\316-\332\2255\024\341F\020l'\254\342\253\274ys\204\306\312\212\302\217\027\352\337\3646\301E+2B\266\214\002\021\026\264D\024\243\tb\211\205\024!\303\303N\315n\246+\322\372rB\363\341\220Jn\327\216\217\311\332\336?\370\273\222)\302\204\207a\257\246\220";
    PyObject *data = __Pyx_DecompressString(cstring, 8227, 2);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (8723 bytes) */
const char* const cstring = "x\332\265z\313[\024\347\326\257$D1\301\010\332(F\214\205\200B\024\010\212\227x\331\337n\351F\210\334A\321hv}Ew\001\265i\272\232\252j.\331_\316\311\220a\017\316\240\2065\254a\017{\310\220a\r\031\366s\376\002\377\204\363[\353}\253ot#I\236\343#uy\257\353]\327\337Z\325C\321\254cnj\216a\246\225\214e&t\333V\354\204\226VV5#\245'\237*}\366\330\253\370\266\236v\226\264L<\255\255\244t\331\245\014*Z\"\241g\034#\275\246h\251\224\242\323\250\212\321J\302\322\305\302rB\377\246\266\247\244u<\321D\3336V\214\224\341\354)\031\335\3324\360j\246\355\201F\253j\351\264\351(fFO+SF:\273\253\030\351L\326Q\222\372\266\221\320A$\023jfSI\205\306\361\316\272R\246\205\272\033-]\232\2254\354\204\271\255[\312\273\245\370\342R\270\366d\314V\314p\327w##\025\343-\315H+\313F:i\356\330\312\206\276\267bjVR.[MP\312\324\222\312|V\263\234\337\224UK\333\324wLk\203\206\304\337\306g\226\024g/\243+\375\037\223w\007\342\226eZJ\"\245ki\"3\233)\255\277n\232\033\274\352\361!k)sEK)\353\330}G\263te[K\031I\3151\255\372\3037\265\304\354\242 Sq\004o\304 b/\215i\310\341q!H\307D\247\341\030\330\3467]\216.m\236\324\035=Abo8\2414T\220 \251=i\206\240\370\363[\330\016\311\265\212c\r\244>\256m\350\350p\214m\322@\261\240Pwy\356\225\224\231\330 \245e}2\263it\017\014)\361\335D*\233D\273mf-(1Fs\003&\016U\257i\254\245M\353\363K\216\203&\"mEKl\320!\352\021\253\364S\357\016)W\302\334\314\200W0\303\201W\215\244.\204\215\215\262\231\211F\254&e'cN*\333\206\206U\323\253\306Z\343\301D\260\235\315dL\013$\2235\364\331\245\301\304e\305Y\207\305A\365I\215\236V\366n\232Y[\037\334\204YU\256\307\343\224\376\362Yy\307\201\252\231v\3022\301\201?9\353t\303K\306|\214{4\261\254x\220\225\276\r\013x\321g\337Sv\035\335vT#i\2137\226\251\272ib\260i\241i\240\274\250\020\267\354*3\245\321\000h-\363\265\237wP\260\203r\302r\266cf2\030\375\177\377\370?\212\245\363\\:\034<\321}\271\003\223\314\n\265fA\313\222\n\311F\257\330\007\032)\314:\334E\314(\361\002\032\266\316\223\366xl\350\331\206Y\230\365\246>\205\2064\030\306NEOV\356#Z\3300\372\373\252I(k\221\320""\2622\333\312\375\3721\226\326\023\242\2457\022c\255\340\356):\307\265dY\210\365\026\314\246\265m\270\032\216\200\365}\312\214\211\230\343\254k\2162\266\347\254\223\"\021\237S\306\212n!\032\245\366 \000\313\200\233\261hPZ\231\213\317\r\216>\031U4\226\320\277\341\200\020z\263+\211\224f\333\304\267Ue%k\244\260\007\207\007{H\231\\U\366\314\254\210\240\360\024\031\315\256\232\340\254#8\332\272C\017\312\035\016\230L\271\212\351 \364\016L\336\"\267\tS\304l\370\035[\037\232\315\320\010-\365a\3054S\277\226\336@\350\257\013\372\232a\203\330\005mg\2228\026\223\362\014\203\271\220R_r`\241\314\351r\360\250\307A\311r{QO'y\311a\002\037\023\246\003\315!qK\277\275\250;\362i\002\256%\276\273\334\277<\241\276\216\277\1779\033]\210\251SS\003\307I\300\224\017F\332\371uxq\017$o\016O\031+\226f\355\r\217\207\241\326\036\216f2)#\301\204,\352\026\037e\250\024\211\353\365.e3)\235\371rOa\356|\255\340\337[q\034\360ag]\007\243-i\235\322Q\233\226\261f\244\t{\254Z\346fe\304\022;\362\032|\241\2605hk\253\324g#V<%\361V0+!\020\317\212^\345\216p\\:\274}\217\327 \325[\315\2469\024\332\320!'k\245\225\0313\255\337\003uFb]\241\205!\347r\\a\335`Zy\201\376\014<\010\316\213\343\350\273\2206\007\"}]\3336Lk@\020\033\006S\250\2012)\035\021\231\267m\2447\260\245\320\021=y\342\260J\323)\013\355Y\0312U\331\355&P\225-\342\250~|Y(8 L\031\235\226\202}\303\340U\345\007J[NM\211\310u\027\356Hh}-\355\003\307\220]=\245\026t*5:\372\014\273\376\233!\005\315&\356\n\33000\254\374\227\226L\252\020\255\256\225\221\267\003\375\262\207W\214\364\260\360N\t\266\370\020\207JX\272Wqj\241OO\025@F\345c?#\307\217\0032\244\013o\266\2260\222/\270\303\260\245\177\023(J\202b\205\335\206\261*\265\276b\355\032xXF\n\344\250\312\320\242\006\223\035c\273\334T\351\027n\247\264\257\000NJb]Ol\014|n\221J\331\355\030\210JeH_3\265\036\264\031\304\034\230\210T\375\262\243\036\246Lg\370\303\217\203?\375\372\303pb3\t\000\246g\366H\036kYcXn1g\"\026\223\327\242}\312\275\273I\223\244UJ\t2\354\352\007Ex\"\213-\253z)k\030\024\222\0344\323\010\002eB\007\007-""\323t(\346\017\356\032\367\005\204\202\005\016\361\366\303Y\333\252\320\210\254\263:\370d\307V3\210\352\332\232>\234u\340\005\206\303\323\253|.\265\204\000\2072{\273\022s\302\033As\210\260U\306\002\222\026\021\343K@\272\30439-\005\263\016\335,\\\t\016\023j!\271\210\312\374\210C\264\234u\352]\242/\027\325wQN\002cH9\320 Q\363\264\010\021/gg\247\306bSSc\343of\306\226\336\317\305\245L^\351\316$P\363\232n\301\017g\365qCO%\313\0321\006\t\277\004\177*Z8\017\254M`i\334\214\276\353\210\360\022\213\277\235y35\025[\236]\210\3054k\307H\307\020\244c\206\r\332\023\353\323 \021\374^\246\367\224\266\027\177\253\202v\\a\353\270.\304\247B\272\302\201\364h&\263)}\002\346\222\342\367R\004\325\034m\":\023\233\212O\214\251\321\261\245\311\331\231\211\211\331\331\327\023\2233\213K\321\231\2618\275\314-\314\216M,\317\304BD\313\353\277\r\005[\277uHU\2013T\265a/\231Q\343\356\262#Re\t@\025^\255\321\004\266]5E\272\255\n4\305\372w\232\341\241/=\315X\366\302'\017\204q\232\366)\027\025cO\261\350\216\360\373\247\\6\034\375'\026\346\241*%E\247\033/R\241Fc\313>R\034q\3509\362LD\375\177\014\t\257\000\037\256\342=E\t\301\347\3278\305.\222\254\323\322s\212q,\357F\343\2042\374i%\025\323B\267\245\212\354M\370,J\342T\021c\313\314z7)\020\356dz\325\374\213k\376=R>3\233\212M*\207\231\223\007\362\020U$J\252\010*'O\240tL\316\222.\375\344\361\004\031\241U\306&%\237\233\231\317\214\006\316\261\240-\3510\341\372\334p\033\353'Np&b\230L\342Dt;\325P\271\375g8\202\010f\254\356\251\366^\032@\3311\022\322\275\255\"\017#\224\333h\032Xb\246\266K\226!f5\032L\345\325\206J]\251\221kH\223w3\326_\\\347\304i!\241\177\237\200\223Vj8\221\n\021u\324\3654\343\253\305\331hFH\025A|)\362\362\261^\277\004\264\240X\273\270\264\360fl\351/\2551\275\370\267\227H\231;j\n.:U\n4\314\271\277\271\226\210-\177y\241\205\350\362\344\314\334\233%\240\242I\000\222\277\263\304D<\032\213/\374\325%\246g\337,\376\265\375\341?L\360\322\322v$3N\264\306:K5\030*\023\246=\t$\022k'\242\036N\224\312\005\330\232^\341\315k\201\206X\260\221\331\254\301\353\202""\004G]\337\221\210\240\354\204\033L1lU\246a\215\007\224r\210j*N1A\022q\332\341B\030\177n4a\244\023\247T\226\371N\204\021\366:}\214Q\271\354\256\206E\372\323\214\255\226vE)\254\306\215 #P\243SS\257'\306\325\311\231\237\343cKqtOW\276\315E\027\242\323Ssc\313\230\300\211!_\342\344\000\027\330\377\361\373\273\221\021\316\235d*4e&6\246\314\265e\313@\004\232^|U\355xf\314\305lb}N8\\\252\374\204%\274\271\311\271\370\334\354\344\314\022_\342\013s\034\345\325\271\275]\374Q\202\243R\006\264\240\257\212\217R\363Y=\253W\333~\265\031\207\026\2710\211^\225;\026'g^\343U\274,LN\253\224\250\311A*\337\325\227o\226\226fg\026K\357\023\313\023\361\370T\351U\274\325\2573..\305f\261\207\356\034+\007.:V6\341d-}\211\255u\311\322\322v\ni\236\314\300\270n\367\006\207~35;\363\352M\232\014\273z\201\252J\r\336\0041x\234\234\211\315./\202Julvf|raZ\025Ma\007\230\320\240g\361\375\214:>9\005F\227;\302\334uyZ\260\010w\354\213\276\031\361\364f\016w\341\346\230\021\341\333\364\354\333x\370\034v,\276_,\317\025/\230\316\n\205\263A\321\344\tIy\306R\246\255\313|\265\022\324\276\233\034\267t\275\362\035R\267\366D\203|y\253[\364\035\366\335,\264%\\\202\224\361\235:\373\372\235\361\213\271\271b\350s!\374^\261\r,#\276\345\n,N\245-UV\236u<e\260LR\263\326l\3741\306\325\200\254\022\2069\004\017mf\035#\215\026\307\321\022\353\2330-B\020\360A\225HbS\2636@Qc\360_\331\303p$\201\305\364\223;\035\373X\207\221\206\002nk)\252\363\256dW\361\337\206?Y\331\263\364\325\204J\215\tdd\232\245f\010\020:|y4\232PSfz-\241f\361\366\340\276\270SkV6\303\213X\030\273m\032\010\354a\002\246\322\222Z:\311E\344\204\226\321\370\033\270\241\203\214\014\376\340\335\033$\327u\263\350\343\351r\335\274\370x\002,\032 \002Z\277~\326[7gm\224\307\326MXU\225C\246\212\300\005\347\265)_q\324\372\201TFLy+G\202RU\213zp\201\326\2001\252ci\t\235X\232 }\227U<yS\251\356\224\000\t\242\356d\213\357\233\270:\024_\023ffO\374B@\245/2\3515\025\002_\325-\221\206\311\274\220\nl\362\021\247\022=Y\313\"I\310\264\032Ma\013\305\341\244\246\003\224&\365\225\354Z\022\010$""\251\313\242LR\337\312\352\"\261\222)\337&\025\226\304\263\221\224)\027%\2078pR\330\034f\231\tU=\021%$w\342\273\340\001Yrrg<\245\255\241e\221\n\245;K\240L\327\3573\021%\000 o*\336\241\353t\303*\333\206\205\230\301\010\\\\7\271t%\236\323\346N\010\316)!\023\317\216\315\273\013\026@*\232x\332\324\354\215\360\t\207+\025\036\216W \312\314\023\307\000%\273T\234Z\3256\364R\\\346\027Q64\255\325\344j\022\313f\220\205\351)d\313H\306t\372K\233\253\340\014\224\237\277\365\254\022\007VS\246\346p\005\262\304-\361\306\232J\237d\244\250U\322\001l\232M\203\3152\315\201\232\022\304:\256w%\340\305\237.N\202a\350\313\030I\3729\306\232\351\320\307\327\314\272p\257\353\\\014\254_\256%/$\245S=\300V\345\217\004\352\320\264\256\355a\307\304\306:\003\207u\310M X\374\347;\177\275\255\004\265\240\026\301\021W!M<8\366\372N:\271\244\321\211\214\244-~\257\000\216B\036\320\251\260hXY\246\251\205Z\307J=u\252D\025M\311\360\233\010\2735\341\33360\n\346\005\344\207!\360#\006\035Z\306\006<S\345\240\014b+\360ac\340\332\000r\236\204-\033\201Z\243lt\206\364v|\337\246\233\245g\350\347M\241\263\303C6c\330\244\230\344\354\354\260\n\375Z\337\213\341\020\025\257o2\341\313\224\276\352L\323\252\225#\270a\032{$\303\226\005cm\375\370\270E\376\216\262H\221v\214\342rZO.\352\374+*n\2533lb2&\276\2176\0320\031\253\3238g\031\333\025\303\227\264\214\300\2301}U\313\246\034\264O@\275&\323\266n9\341\210\215\025\204\355\264\236zp\237\002:\373\241\220\2215^\254\364\312vZz#\305\255\312\212\351+\332\206\221J\245\246`z\357\370\372>5\247Y\332fJ[\201\233e\213,\227m J\372%\023t\034\356awd\204\256\006G\206\317T\023e?t\320\322Sb\200P\344\317\026\361NW\344;^\315\253\252\203\224>\0365.\346U\365T5\t\037\305\355%\3369\366\361N\241\376\325=\360\007\r\346\254\357\324\235 \316\327`\216\350\254\235f\226\240\n'#2\3625\254B6(76\252+\326\026\020\353U\n\353\227\004\253$_\267\\X\335G\340\242\246E\352PUc\365\324\032u\240\017l\364\027\0366e\256\255\351V\203\222P\275\352\016\332\240\022\022A\231\364\3137\n\030\342]|q\255\214/\242\275\034\215k\337K""\360Tt\260\020\253-\265\262\247\302\255\206\315fi\356\026'\224\325/e\265\256\036\303hCU\351\213?]\377mZ\002\3613\210\330\324v\021\3447EV\207n\035\361\216\361\244\272i T\251\345\351D\016_\350\013[\005q\266xf\327\"\036\311\257\224y\210\251\226I\200\310\002\000\307\213\275i\257\245\307L\302J\233X\267\342\312\334NKY\001-8\237\253\024\003<\245\263\233!\342E\024&|B:.~\374d\332\002{\223\002\0031\220F\321-E\350\305\332T\303\207R\303:bd\006Q&cfT\220\256g(T\361\031B\325\243\362\000\236w\36726A\327\214S\372d\255\022\273S\3420\202\361[\224\355s\201L\020-@\204J9\0175\n\373\241'\307\266V,\322&\322d\372#\031\nh\301\014\256_j;^\223\001\301)\240\365\372ur\331\230\244\037\263\301EZ\272#~\311B\231\031\tC\244n\004\250?S\361\376|A:\304kxF&\261n\353\224 \340\272j#O\205\233!O\303\277\322\244\330\241\322\233`\033\236\222\"\334\325-#\235P/\262\327\371K=8A\177\346\252\235\322\266\205\003\320\365\214\370)\004\275e\220\004\362\205b\224-\352\335\215\252\344'\224\303m\220i\321\025\332\245\322\017\005Y\341\261\236E\211N\206/\031=igW$K\240\276\004\013\351&\244NO\216]\326j\tDC\265\256\023b\303\334\331fh\3410\234t\350\027\335i\256\001\260\337\303u\327)\375\300\001\017\346\0169t\372\003\245%\337\356\260\002\210\237\253e\305\317\036R\245$\307\022\302\314\246\026\264\235\227\230\004\237\227\305a\254\254-\336\310\366\303gN\207\262\266\274-\210\3378%\263\366\033r%\3626\307\217\364\277\002\334\343\315zp\237\256*\201`\222\335q\224\276M\277=\340\213\215\004\312\201qmo\220\242no\260\232\3560,\331\321\014G\262\210\177\213U\322K\3416\205\tV\025\237E\216`\327\253HW\265\331\2152\302\312v\001\235K-\365b|m_)\\\327v\224\254\246\272\247&>T\365UF\210\252\216\262\253\250]\2164\257!y\324y|\232YQr({3\031\316\303\016\001\365Y\314)\346_\230\316\357dXN\245\337\324\014\211*\201]\321\202\250<\264\303\225\327\212F6\350\241F?\275\221\277\017\022vY\006\037\"\376\013\033\023\317051\364\214\0224\377\030\374\370\363a\367\247\3163\347\277.\266^\315m\273\313^\324\373\230\277y\320tT\375Zl\275\341\316\037\375\351\213X\364\243\337~""\324v%\247\225.\206\273%o\237Z\316\\\270\034\\\352\365\246\362M\324\264\356\312\001\377\343?\312_+t\027[/Q\357k\177;\377\276\240\341-7\354u\371\363b\314\256\267\035>\356\371g}#\277%\006\\\367\307\363\003\205\021\236{\333K\345\273\363\217\n\327\016\272\217\302\367\333\205\363\007\355\305\326H\020\351\303\351\332\305\373Q\370~%\277G\347\275\345\335\366A\322uw\344\250\243\327\033\367\007\362\237\177\350\017\267\372t\366\314\205[\336\025o\353\357,\360\355\247\251&\272\216\343z\303\235\200(\300\324.\361Pl\275\234{\022\\\277\347G\375y\342\341\rw<\2705\232\217\036\265)\336E0\013\003\256\2718\323\305}'7\02226\322q\024\371\316\035\366\333\213mWs[\356W\020\022\310\033%a`h[\320v\333\323\274\377\225\237\247\315o\270\321\243\326N\027z\360\275\013\276w\327\034\246\373\250C\361\316z\232\270\031\376\326QG\217\367\310\277\226?v\364\233\356\266\367\336\327*\036J3d\013\315\350r\037y\355r\206\\\370\266\267\352G\217:\372\274\267\376\210X\275\275\364F3\347K\267\273\320\225vZ\005\232t\313\273\347kU:A/\033 h\327\337\312\237\315\033\205P\365X=nyw\375\267\371\237\n8,-\375\030\374\207\336\\\370\364\034\214\307\270\340\312\220\237*t\023\333\372\275\356\240g4?^\0308x|x;\230{\037\274\377\245(Fl\024\256\024\366\016Y\177\323\020\316[\377Q0\362\022\372\326v9\367(\2706\222o\247\371\267\275&\020a\373\267\363\347\362[\205\246b\2443\350|\230\237\017\273\332\213\342\341\250\363\332Q\347\367\256\351\263\210_x\274\352\252\033\rn\214\035\2002\222\347hn\253,\321\242\220(\235\276=\207\301\337\271\330\267\013\302k\353&\206\262\360.\347Frq\322\206\2539\007\014\206\215\364\321\022\355l|\271{n\n\342\024\013J\021U\231h\231]\030\272\341_\361\205\321\346n\273\347\275\010\251\344\245\\o.I\333\312s\266B)\337B\215\333\013\267\017\316\036$\016\321L\033\217\272\2167B\307\303\233\355\016x\017 \344\316!_\363\355<18\370\356\256?\002\303\275]h*\264\037{\277\332y\024\351t\317\202\302\255b\313\305\375\337I;/\345\372\335\356\340\372\213\002h\250>\"\034[\276\351\323\2453\347[\367G\367\377\343\366\270b\304Q\313\371\243\326\216""\334\2220\214\235\\\302\345\205\241\346_\272#,\355\373D\312u\322Ebh\333\376o\356ew\334\303\321`/r\211\322\346\267\335\246\340Z\354 \312\355A3\250-\266\264\345\232s\321\243\226\366\\\007\034\035n\355\305\226\326\375\tPv\003\207m\275p\324v\315\355 vC\207!\232U\030R\217\277\010\255\324HW\236\272\213\3367\376\003\350\254M*\327AV\272\355\376\212\321O\340\037 \324\230\327\314\352\365\023\3319M\237\360\307\374l>V8[X;X<do\365\310\353\364/\373q\241s\375^\217\367\306\357\365W\363\257\n\017\n\311\203\336\003\355`\373\360}\360v\271\210\375\036\272\255\336\030\354\224v\272\224\033t\267`w:Q\006G\330\357\237\203\271\204\372$5\360ya\374\3406\266i\215\344&\203\033\244\327a\317\370\301\352!3\242Ra'\016\317\036j$\255\255\240y$\337\025\274\230=\204\360\276\201H\234\33437\341]\366b~\263\037-\361\325\t.\017\370\302\021\365\373M>\013s\213\031\373\251\025\001J(\232\016I\265w\344\346\211\225\0217\274\221\267\273\352}\345-\371\227\300\254\3730\253\332\0062\235-)\307\312'l:D\032\037\276\222\267,\t\373b\233\024.\364\242\330\002\347Tl\201\372\004\327h\006\0162\"E\372\235\367\002\254\212t\344>\302\344\"\344w#d\201P\244\247\260\017\350\355\027\220D\237\267Ul\213\344&\240Ow\021\265`\004\273\356\216\227\204?`\233\307\214\227\356\2327\357mB\326\021\242\240\223]\263\367\2457\342\305\311\3520\256\206\301\313\301\362\273\242\240\003TBc%\223\202+\377(h\265\232*\233\266\3700G-\227r\267r\257\300\313\226\326\240\2254\353+l-T\364\n\331\205{\217\274\257\277\204\350\010UThS\031M\036P\010o\247\221\0358\251;\344\237']#m\2143\257G\362\223\2057\007w\016\333\017\007\202\305\217\301\307\225`%qt9\302sX\231\350l%B\212-\241\010\202\346\007\371'\205\021\262\332\213\373I\366P-\235\356\267^2\370\001\026^\204wc\002\2045\207aK\336:\335f\362x`z\261qO\313\325\334o\244sA\377OpM?\300p[\"\271X\320\t\235\363\357\340\014\350wDD\375%\277E\314l\335\177\301\216\241\225\030\031\363\316C\010\277\301\025\225\324C\214\031\251x\036\r.\376\230\3772?\232\317\026\246\017/\013\213\340\2566\034\367\014\270Xl\376\352\250\371\\p\356\272\373""\000\336\273\345\373\340{\212\331\315\020a\320LOe\261\234'\236I\375;b'2\356\016z[\260\213\253\371o\nB\363.#\024d\335(P\2320c\262\326\036\367\215\327\355\215zY\234\343C\341K\230\375*N\312|\210{\355^\177\331\341\020\r\006\255\310Q\202\264u\204\335\356\017P\311\213\205\355\203y\022\231\020\024X\024zS2]\215\251*\2227\275(m\231\331\002\366\301\357\222y~ \265\225Md,u\232j\324sJrK\372\213\037\374\356\262\253\320\312\336\273v?rB\350\034\r\256\016\373[\265k.\006\213K\322\200\237\025\236 |\266|\033jV\353~,\367\005Y\312\0038\207\245\002\3533\231\002\357\213}\010\250\266\222\233!\037tt\376\302\376<f\336C0\305\022\353\324w\001(\001\327\240\031\312T\204\234Z.\354\377\013\346\276\354O\346?\034\234;\200\243k\317]a\351\274\365\036\372\027\362\363`9\302\303Yr`p\001}\336\357\371(\334\024\237\221\"\021\3712\332\265\010\025\020\276Fl\335NP\272\375\232{\005\332\334Nx\254\375&=\221\177i'\263\244'\322\260\213\373\233\356sH\363,\261\366[\274<\363\370!\355N\261/\005}*?^\313\337\201\372\367\263\205v\013\262i\336\371\374\325\302\271\302\026\200?7=\363\326\374yZ\352Bp\341{\216X\002\032\265\020k/\260\257`\322\267$\321\327\205\316\022*u\037\002\316D\020w(\312\265\266\347n\342\365\232\337\007\007\326R\370\2520\0177\204\203\021c\370\300\272\373\017\330\337@\376A^/\214\020\014c\347\214\000\303z\374\004K@1\037\343\221\340_\204<\3259\246\366\373\302o\002X\354\2726\270I\211\200t\230\347$\027\332:\202\016\002\264\214\\\206\010b\2616\377\021e\001\267\345Z\300\314\213mx\025\256\005Q\207\225\twR\317z\357\341\035\021\351\217\350\247o\317\234\357\202\t%\030\004\265\020\206\020/K\304\355\3120\301\\b\260BB\275 \264\260\227\224\210 \032\2536Y3\271\247+l\307\210#\224\343\204\361C\336\312q\2452\240\004\221A\312\201pg\364\177\205\003$\\\301w\314\014hF{'\020\321\023\3571a<\n?1(MD\000\301\316k\305\310M\2402f\355-\357\026\341\372\340\356?\017\232d\000\032\204\253h\312_G\324\357>\020\243{\274\373\004\300\203{\343\007\032\r\372\235\334\351\263\302c\200\335\316\036Bt\336\3770\360\353&\014\233$\022\217n\320!\273n\002""\215\177\351\217\302F\225\236\240\347Q>\001\223\353\355\017\372'!\304\276'\360S#\374\212e\213\325\003h\243\212\001cD\010\235\230\"\212\200\254\"{)EF4\0057\001\313\212%\236\020\3229\347f\031m\304\363\227\363cyv\226\235]\356\317P\343\353]!\027k\321\265\313\2128Nb\013\232{=\2417\354k\340\345\240\032\322;\013U\370Zj\306h0<\027\314\315\227\260\004\226\306\350b\270\"y\r@Njf\330\3019\247@1\301\215\307\224\254\220:Pn\300P\364;\267\017TPJp\r\242\354\270NY\010\274h\305\341\213\320\344V\022\252\027\t\372\2361\312\353\256H\373\2046\024I\236\034\t\205Z\220\n5\221n\\\225\347\254\201\324\342\004\264pT\234\256\002G\263\376\352\200\333Q\362\242\263\014!\366\307s\3359\201%\3504t\007\277\312\375\001%\221Gb\036\273N\330!#e\354\321\304\027\262\312o(~\366\301~\"\301\340\313\203\201Ca,\274\326\244\277\234\347\3700\032B\263V\001\256\003\231\231\2064\310u\370\370\344\322y\315^\022}p\357\237\007\347\017\333\3035{\274\237\374W\371\221\372kr\006*e^Z\355r\356\261\333]\013\361\311([(X\204\241\205\000\377\317\234\016\221M\223\037#\377\337tt\215\3748<\324C,\235 8w\324Ej\334\245\004J\364\240\375\350\006\225\033\232\271n\361\010\257]\210C\334G\250\355r\204R\270g\2422\302\300/zp\345`\207\261up\021\341 h\006j9e\200~\220\037\251\215\306\344\346\3524\235\024\240\367\243\234\355Q\272!\\{\223\204\0160|\005I\314\243\374\225\3746|\375\332\301|\221\235\315c\357V\320\373\254p\277\360\026\331s\367\241\310\003\221,\006\nr\340|R\244\330x#\374\300+<\004HY-D\013\313\260d^\341\001\020\346\244\377&\177+\377\022\241\224\246\337p\377\025\334}\2161\214\246\267\335w\336\242\037b\351\211\240\227\026FL\241\205{]\035G\023\"\350\n\272\236\222\177\"Q\\D\3569|p\t>%\344\265l\266p~j\242\334\222\233Z\340\275\036\202\266\260\361j'\307\021\312\204\277\r\r\032B\010\355\235$?%\374\221\264@\260\213\254Vtsu\247\330FQ=K\325\0342\305\001\002b\354\257\3301\200Fj\355\010\"\017\362/\220Fo\022\226\021\323/\200\211/\310B\261\311,\3248\316\305\017H\020\241\201t*B\220Dz\026\020\330~\251\030!pD\364\221\023\271\003\247\027!\363\214P\266\305T""\3234\352\372AB\334N2\327:\027\254\326q\345\323\3633\035\275A\017\261\227J7\035=\010\034c\301\035\362\321\367\013\213\007\027\017\267\216\272\021\013\202\333O\013=\205\205\202\035\274|\037\274G\"\360\257\340_Z\240\255\320\032\327)\271\177\016oWw#.\200hEQ\002xFZ\300\276O\316A\262\273qx\005\233\034\357\177\224O!R=:\274\036,\375\022\374\362\201G<\312o\300X\250d\321\321\355\235\rn\223\217e\177Z\371\237\346w\"\374F\274_\250\032Q\354\2045\2124\341\356\001+\200P\020\222N\250\000t\177\006\355\352\272EQ\316o*\342\241\237!\217\354\301\232\327n\272\353\004@X\351\2601%\364\277\023\343\271\322\023t\177\010>|d_\377\200\212N\325\021\214\342\036\311\020\222+\226b\t\351T\261J\265(\2579\301w\027;\256P\226\023=:\3775\345\320\2555\200\372\233\375\3479\233\\U\010n\302\312\020\376\027%\002B\030\n\023t\302N\027\333\352T9\340!\316\001G<\366{\375\177\027\232\201\342B\324\023\006\213 \362\363a\317\341\374\241V\001~.\210te\t\376{\307\327|\007\231\343x\241\257\220=\210\0356\0372\224Ir\364\0231\230B\326yr\365\322\020CX\221\345\032\312[x5\2457\350\215C\\\335T8\214q\251\217\222\030j\246b\\M\356L2\014\243;b\\\377\231\363\027\202\326A\377c\341J\341\367\303\250\314\005\356A\271\246\0213\350\215\354\204\356d4t'K\223\031C\335{8.|\027\225Kz\022UKz\272\341\276\247\212\013\341\367\2539C4S%+Z\024i\371$\362\211r\330\343\032MU\244\332\237\246\274@\346\236\010\320`\027<\325W\200m\315\371\tv\214e\334\311\032!\242\337\376\024\240o)\032\377\301\201\232\233h\301N\357\252\337$\313\002\234Y\\\220\321\273*\270sEB\362\341\377\037\317\372q\226y\177-?_\265\373\035oK\3666U@\215\240\365\266'\250\354\361F\004\364\370\td\326\337\270\021!\341\322\234\213\037C3\345\003\211-\312\004\337\362h\376>\361\267\346\177\261\336\371k\317y\327\227\024\217H\206\207t\014pe\227\300%\303\234\240\177:\230\376\357\340\277a=\210\374\267\274\036o\276\344\007\310j/\266}\372\032\363I\230\024\236xE\201`\010\274\375\3429\214\300E\321*\342\252\260\022\302\261\002r^\315\375\007\353Q\362\322\371}\360=\320g~4x<M6\033fY\275T\260\255\355\2531+\002\336""\245\r\337{I\252\254P\t7\254W\020vn\316\277B\2527\036\274D~\276\034,\013/x\003\216\240\275\030\226}c\301\217@\372\344\226\257\311\242/\271I\016U\302]\226\312\346\265\004P\006!\375&m\010\310\306_\026\344\3642m\363\354\364\300_\006O\365*\003\367\0015b\205\246\320\374\310\317\325\226 \030\265\023l(\303'n\242\024\252\006>\375Wa\353\270\n\204.\225d\007\017\375mE\351\213\274jon\305\375\232\253\205T\024\000\025\226{\235>\224\025\341\322_\001R\365A\240\217Ae\224\362\315w\3562\324=\342\277\313/\344\271\314\3724\367\006\300g\303\277\014T\331\223\237/\271\374g\320\227Q\3677\264\277\022\225\322\320\273\303\247#\032\302\247n\025\225{\376xp\177\006\362\355\375\201\276Na\213\336>\210\243\373G\370\351\207\005\0020\267\177\300\tz\357x\377\311\367\006\217^\035l\035\365\223x\356!h\362\24580\232\217\005O\246\202\251_\203_S\237\316\234\331l\212}\201[\354\213\370\027\265Co*\010\317\327\024\227ss\021\353@\347\303\334\271\\\226k\336q\320:&\0257\222\373\231\200p\204\252\375\224\r\311\322\"\242\003}\316\272\332Y\2544[\226l%\036g%!@-\215\270\234\327\225R?dJEQ`\206J\006\335?\025:\350\273#\245M\200j\341W\201\210;\357n\"\016]\000\300\371\355\260\375p(x\307\210\243\215r\312\244\250\357SA\177\331c\364JuG0\2278K\027Z%\002$]*/w\271\362\340Oa\005\021o\376\217h-v\347\222|ei\r\r\344\357j\033\212!~\000\014X\n\226\336\204@\264\006$\314\007\363\013\265\261\201\003\276\3425IlO\210z\221\276Gu\023\361\036\303\240\307\354q\272\310\027Q}\361]\376-\225\325\202\030\357\304\301\370\245\267\346/P\226\177\307\333\366U\204 \302\373\375\301\302\342Q\347\r\221\t\371\235\310\rv\013[\301?\031\251t\366x\243\010\352_\300Q\\\202Y\227\312\006\235\275\336+x\253\377M\230\374\226w\007\032\020\225@\354N\251\250@\365/\205TI\241\354\235\024\267\024\355\025^\226K\006\214\tn\225z\272o\221\036\367\005\275\224vA_\370#\213\312\237\254\036\027\372\017\272k\217\177\214l\346]-\331\354\213=\246\265\037(\210\276\031\"\215iAJ\367s^\253-\206\334F\006\330\356\337\002\341]\375~\013\307\352\261\202CYHx\204\307y\207\253a\222\356\307\264\363AS""\303\023\343\210E\272\323\327(4\356z6\002\0135\274\240\374\351\250\227\234a\357H\376r>J\316A\276\223'\352\245D\257\227\022\026z*\326a\207(\376\362\367\027a\025\262\242.\276\276\210r\010}\304\333\3011\245>C\247\220<\2232\2060PzP\202\027\355\322#\272\3552>B\313\311\236\026\240<\257\340\371_\343\344\367\211\352\203\017\301\334\002)\016i6\005\312\212\017\007\330\360T\325\341\207\371\371\306\325a\372z\"\355\257j=\361a\352\233\374\203\274\\Y\324\007\251\212\324D\207\346\243\325\375\"U\305\232\360\303\024\023B!\363q\201\0133{\342c#\271\231S}\264\372\017g\257\317\374d\376N\3412T\342\263\237\260\312\033\324|\304\202\3414(a\005\315\340\317\2476Q\305\002\270\177\355nU2\223\037e$-\206\314\256\370\010\007\345\356>\022E\264\267\242\244r\354;\351\304aS\r\025\325\254\353\342\272d\215r\221ft`\361[\336k\316\310\3033\035W\271\362\262\215\374\370\363B\234~\363\361\327\375x\230#\236\344\311\377\220\037x\376\330bu$K\004\301\004\016KJ_\343\210\021b\203\346\036\3579\247\335\"\366\345b\010eK\336%8\030\013\361|\376\377\001\002$)\257";
    PyObject *data = __Pyx_DecompressString(cstring, 8723, 1);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #else /* compression: none (21803 bytes) */
const char* const bytes = ".Automation process scan failed: %sCGEventTapEnable failed - accepting all eventsCGEventTap creation failed (may need accessibility permissions) - accepting all eventsCannot open Linux input device %s: %sCould not create CGEventTap: %s - accepting all eventsCould not discover XTEST device IDs on Linux X11Could not drain Windows keyboard events: %sCould not load Quartz framework: %sEVENT type (\\d+)Error cleaning up Windows hooks: %sError cleaning up global hardware validator: %sError cleaning up macOS event tap: %sError opening Linux input device %s: %sFailed to initialize Linux hardware detection: %sFailed to initialize hardware event validation: %sFailed to initialize macOS hardware detection: %sFailed to install Windows hooks - accepting all eventsFake activity detected: %s input blocked (not counted). Excluded sources include %s.Fake activity ignored: %s input blocked (not counted)Falling back to accepting all events (backward compatible)Global hardware validator cleaned upHardware event validation disabled via configHardware event validation not supported on %sHardware hook thread error: %sHardware mouse-move validation error (accepting event): %sHardware scroll validation error (accepting event): %sHardware validation error (accepting event): %sLinux X11 hardware validation initialized (evdev=%s, xtest_ids=%s, xinput_monitor=%s)Linux X11 input monitor error: %sLinux X11 input monitor started (xtest ids %s)Linux X11 input monitor stopped \342\200\224 restarting in 2sLinux evdev background reader started (%s devices)Linux evdev hardware path ready (%s keyboard/mouse devices)Linux evdev: no keyboard/mouse devices openedLinux evdev opened: %s (%s)Linux evdev read error on %s: %sLinux evdev reader error: %sLinux hardware validation reinitialized (evdev=%s, xinput_monitor=%s, enabled=%s)Linux hardware validation unavailable - accepting all eventsNote that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subcla""sses then set the 'annotation_typing' directive to False.Optional[bool]Optional[str]RegisterRawInputDevices failed (error %d)Reinitializing Linux hardware validation monitorsSendInput/AutoHotkey on WindowsSetWindowsHookExW(WH_KEYBOARD_LL) failed (error %d)Set[int]/System/Library/Frameworks/ApplicationServices.framework/ApplicationServicesTuple[bool, bool]\n    Validates whether input events originate from hardware devices.\n    \n    Fail-safe design: If validation cannot be initialized or fails,\n    all functions return None, which signals to accept the event\n    (preserves existing behavior).\n    Windows Raw Input mouse sink registeredWindows Raw Input mouse sink unavailable (error %d); keyboard validation remains activeWindows Raw Input setup failed: %sWindows hardware event validation initialized (keyboard LL hook + optional Raw Input mouse)Windows keyboard hardware validation active (WH_KEYBOARD_LL; injected keys excluded)/ ?add_noteautomation tools/bin/xinputctypes XTEST discovery failed: %sdevice: \\d+ \\((\\d+)\\)disableenablegcid=(\\d+)isenabledmacOS CGEvent classification failed: %smacOS event tap disabled and cleaned upmacOS hardware event validation enabled (direct CGEvent source check)macOS hardware event validation initialized with CGEventTapmacOS hardware validation disabled - will accept all events/proc/[0-9]*/cmdlinepyautogui/CGEventPost on macOSpyautogui/xdotool on Linuxpython-evdev not available on Linux - XTEST-only validation--roottest-xi2threading.Event/usr/bin/xinpututf-8ws_package/utils/hardware_event_validator.pyxinput binary not found - XTEST path detection disabledxinput list failed while discovering XTEST devices: %sxinput not found - XTEST path detection disabledABS_XAccessDeniedActivityMonitorBOOLCDLLCFUNCTYPECGEventGetIntegerValueFieldCGEventTapCallBackCGEventTapCreateCGEventTapEnableCallNextHookExDEVNULLDWORDDarwinDictDispatchMessageWDisplayEV_ABSEV_KEYEV_RELEventGetMessageWGetModuleHandleWGetRawInputDataHANDLEHC_ACTIONHHOOKHINSTAN""CEHOOKPROCHWNDHardwareEventValidatorHardwareEventValidator.__del__HardwareEventValidator.__init__HardwareEventValidator._automation_process_activeHardwareEventValidator._check_linux_input_eventHardwareEventValidator._check_linux_keyboardHardwareEventValidator._check_linux_mouseHardwareEventValidator._check_macos_keyboardHardwareEventValidator._check_macos_mouseHardwareEventValidator._check_windows_keyboardHardwareEventValidator._check_windows_mouseHardwareEventValidator._check_windows_mouse_moveHardwareEventValidator._check_windows_scrollHardwareEventValidator._initialize_macos.<locals>.event_tap_callbackHardwareEventValidator._initializeHardwareEventValidator._initialize_windowsHardwareEventValidator._initialize_macosHardwareEventValidator._initialize_linuxHardwareEventValidator._linux_automation_process_activeHardwareEventValidator._linux_discover_xtest_device_ids_ctypes.<locals>.XIDeviceInfoHardwareEventValidator._linux_discover_xtest_device_idsHardwareEventValidator._linux_discover_xtest_device_ids_ctypesHardwareEventValidator._linux_drain_evdevHardwareEventValidator._linux_evdev_reader_threadHardwareEventValidator._linux_open_evdev_devicesHardwareEventValidator._linux_reset_timestampsHardwareEventValidator._linux_teardown_monitorsHardwareEventValidator._linux_ts_recentHardwareEventValidator._linux_xinput_binaryHardwareEventValidator._linux_xinput_monitor_threadHardwareEventValidator._notify_synthetic_input_filteredHardwareEventValidator._resolve_windows_inputHardwareEventValidator._scan_linux_automation_processes.<locals>.genexprHardwareEventValidator._scan_linux_automation_processesHardwareEventValidator._scan_windows_automation_processes.<locals>.genexprHardwareEventValidator._scan_windows_automation_processesHardwareEventValidator._start_linux_evdev_readerHardwareEventValidator._start_linux_xinput_monitorHardwareEventValidator._windows_hook_thread.<locals>.KBDLLHOOKSTRUCTHardwareEventValidator._windows_hook_thread.<locals>.MSLLHOOKSTRUCTHardwareEventValidato""r._windows_hook_thread.<locals>.low_level_keyboard_procHardwareEventValidator._windows_hook_thread.<locals>.low_level_mouse_procHardwareEventValidator._windows_hook_thread.<locals>.RAWINPUTDEVICEHardwareEventValidator._windows_hook_thread.<locals>.RAWINPUTHEADERHardwareEventValidator._windows_hook_thread.<locals>.RAWMOUSEHardwareEventValidator._windows_hook_thread.<locals>.record_raw_mouse_inputHardwareEventValidator._windows_hook_threadHardwareEventValidator.classify_macos_cg_eventHardwareEventValidator.cleanupHardwareEventValidator.drain_windows_keyboard_eventsHardwareEventValidator.get_last_hw_scroll_timestampHardwareEventValidator.is_enabledHardwareEventValidator.is_hardware_keyboard_eventHardwareEventValidator.is_hardware_scroll_eventHardwareEventValidator.is_hardware_mouse_eventHardwareEventValidator.is_hardware_mouse_move_eventHardwareEventValidator.reinitialize_linuxHardwareEventValidator.should_count_activityHardwareEventValidator.should_count_macos_cg_eventInputDeviceKBDLLHOOKSTRUCTKEY_ALLKHF_INJECTEDLLMHF_INJECTEDLPARAMLPCWSTRLinuxLinuxEvdevReaderLinuxX11XTESTMonitorLockLogWriterMSGMSLLHOOKSTRUCTNoSuchProcessNoneOptionalPIPEPOINTPOINTERPopen__Pyx_PyDict_NextRefQuartzQueueRAWINPUTDEVICERAWINPUTHEADERRAWMOUSERIDEV_INPUTSINKRID_INPUTRIM_TYPEMOUSERI_MOUSE_BUTTONSRI_MOUSE_HWHEELRI_MOUSE_WHEELRegisterRawInputDevicesSTDOUTSetSetWindowsHookExWStructureThreadTranslateMessageTupleUINTULONGUnhookWindowsHookExWH_KEYBOARD_LLWH_MOUSE_LLWINDOWS_HW_CONFIRM_WINDOWWINDOWS_RAW_CONFIRM_WINDOWWINDOWS_SYN_FILTER_WINDOWWINFUNCTYPEWM_INPUTWM_KEYDOWNWM_KEYUPWM_MOUSEHWHEELWM_MOUSEMOVEWM_MOUSEWHEELWM_SYSKEYDOWNWM_SYSKEYUPWPARAMWinDLLWindowsX11XCloseDisplayXIDeviceInfoXIFreeDeviceInfoXIQueryDeviceXIQueryVersionXOpenDisplayXTESTX_OKXiZombieProcess_absinfoaccessactiveadd__annotate__appendargsargtypesasyncio.coroutinesattachmentautokey_automation_markers_automation_process_active_automation_scan_cache_active_automation_scan_cache_ts_automation_scan_intervalboolbufbufsizebyrefc_boolc_ch""ar_pc_intc_int64c_longc_uint32c_uint64c_ulongc_ushortc_void_pcallback_refcandidatecapabilitiescapscast_check_linux_input_event_check_linux_keyboard_check_linux_mouse_check_macos_keyboard_check_macos_mousecheck_output_check_windows_keyboard_check_windows_mouse_check_windows_mouse_move_check_windows_scroll__class_getitem__classesclassify_macos_cg_eventcleanupcleanup_hardware_validatorclearcline_in_tracebackclosecmdlinecmdline_pathcollectionsconfigcontentscopycreate_string_bufferctypesctypes.utilctypes.wintypescurrent_event_typecurrent_timedaemondebugdecode__del__dequedevicedevice_matchdeviceiddevicesdiscarddisplay__doc__drain_windows_keyboard_eventsdwExtraInfodwFlagsdwSizedwTypeee2ecodes_enabledenabled__enter__envenvironevdev_evdev_moduleevdev_nowevdev_recentevdev_tseventevent_dataevent_maskevent_matchevent_tapevent_tap_callbackevent_typeevents__exit__fake_activityfake_detectorfdfd_map_fields_filefilenofind_libraryflagsfloatfound_keyboardfound_mousefrom_buffer_copy__func__genexprgetget_hardware_validatorget_last_errorget_last_hw_scroll_timestampgetpidglobgotgrouphDevicehandlehardware_event_validation_enabledhardware_events_counted_hardware_validatorhaystackheaderhmod_hook_ok_hook_ready_hook_threadhw_agehw_recenthw_tshwndTargetidsignoreindexinfo__init___initialize_initialize_linux_initialize_macos_initialize_windows_initializedinjectedinputinput_kindintis_alive_is_coroutineis_downis_enabledis_hardwareis_hardware_keyboard_eventis_hardware_mouse_eventis_hardware_mouse_move_eventis_hardware_scroll_eventis_keyboardis_mouseis_moveis_repeatis_scrollis_upisfileitemskCGEventKeyDownkCGEventKeyUpkCGEventLeftMouseDownkCGEventMouseMovedkCGEventRightMouseDownkCGEventSourceStateCombinedSessionStatekCGEventSourceStateHIDSystemStatekCGEventSourceStateIDkCGEventSourceStatePrivatekCGEventTapOptionDefaultkCGHeadInsertEventTapkbkernel32key_codeskeyboardkeyboard_eventskeyboard_foundkeyboard_hookkeyboard_prockeyskilllLastXlLastYlParamlabel_last_synthetic_warning_tslibx11libxiline_linux_auto""mation_process_active_linux_correlation_window_linux_discover_xtest_device_ids_linux_discover_xtest_device_ids_ctypes_linux_drain_evdev_linux_evdev_available_linux_evdev_reader_thread_linux_evdev_thread_linux_last_evdev_keyboard_ts_linux_last_evdev_mouse_ts_linux_last_hw_keyboard_ts_linux_last_hw_mouse_ts_linux_last_xtest_keyboard_ts_linux_last_xtest_mouse_ts_linux_lock_linux_open_devices_linux_open_evdev_devices_linux_reset_timestamps_linux_teardown_monitors_linux_ts_recent_linux_xinput_binary_linux_xinput_monitor_active_linux_xinput_monitor_thread_linux_xinput_path_linux_xinput_process_linux_xinput_thread_linux_xtest_device_idslistlist_devicesloggerlow_level_keyboard_proclow_level_mouse_proclower_macos_constants_macos_direct_validation_macos_event_tap_macos_event_tap_callback_macos_last_keyboard_event_macos_last_mouse_event_macos_lock_macos_quartz_macos_quartz_available_macos_quartz_module__main__majormarkermatchmaxlenmessage__metaclass__minor__module__mousemouseDatamouse_eventsmouse_foundmouse_hookmouse_proc__mro_entries__msmsgnCodename__name__name_lowerndevicesnext_notify_synthetic_input_filterednownum_classesok_flagopenopenedosoutputown_pidpathpidplatform_platformplatform_hintpollpop__prepare__procprocess_iterproxypsutilptpyautogui__qualname__quartzqueue_raw_input_header_sizeraw_recentraw_tsrbrdirereadreadableready_eventrecord_raw_mouse_inputreinitialize_linuxreplace_resolve_windows_inputresolvedrestyperetreturnscanCodescan_code_scan_linux_automation_processes_scan_windows_automation_processesscroll_tssearchselectselfsendsetset_blocking__set_name__setdefaultshould_count_activityshould_count_macos_cg_eventshutilsizesizeofslave_idsleepsource_idsplitsplitlinesstart_start_linux_evdev_reader_start_linux_xinput_monitorstderrstdout_stop_hooksstrstripstrippedsubprocesssyn_agesyn_recentsyn_tssynthetic_events_filtered_synthetic_warning_intervalsystemtargetterminate__test__textthreadingthrowtimetimeouttimestamptstypetypinguinputulExtraInformationulRawButtonsupperusButtonD""atausButtonFlagsusFlagsusReservedusUsageusUsagePageuseuse_last_erroruser32user_infoutilvalidation_enabledvaluevaluesvirtualvkCodevk_codewParamwaitwarningwhich_windows_event_queue_windows_hook_handles_windows_hook_thread_windows_hooks_windows_keyboard_events_windows_keys_down_windows_last_hw_keyboard_ts_windows_last_hw_mouse_ts_windows_last_hw_scroll_ts_windows_last_keyboard_event_windows_last_mouse_event_windows_last_raw_mouse_ts_windows_last_syn_keyboard_ts_windows_last_syn_mouse_ts_windows_lock_windows_raw_input_active_windows_use_mouse_ll_hookwintypeswparamws_package.configsws_package.log.writerws_package.utils.hardware_event_validatorxdotoolxinputxinput_binxtest_recentxtest_tsydotool\000 \320\0040\3200J\310!\360\030\000\t\n\340\014\027\220v\230W\240A\240\\\260\037\300\001\330\014\027\220v\230W\240A\240\\\260\037\300\001\340\014\035\230Q\330\014\035\230Q\330\014\035\230Q\330\014\035\230Q\330\014\035\230Q\330\014\035\230Q\330\014\035\230Q\330\014\035\230Q\330\014\035\230Q\330\014\035\230Q\330\014\035\230Q\340\014\027\220v\230\\\250\021\330\020\026\220a\330\020\026\220a\330\020\026\220i\230q\330\020\026\220i\230q\360\010\000\r\023\320\022$\240L\260\001\330\020\026\220h\230a\330\020\026\220i\230|\2506\260\031\270!\340\014\022\320\022$\240K\250v\260Y\270a\340\014\022\220/\240\034\250Q\330\020\026\220i\230x\240v\250Q\330\020\026\220i\230y\250\006\250i\260q\340\014\022\220/\240\033\250F\260)\2701\340\014\022\320\022&\240l\260!\2606\270\031\300!\330\014\022\320\022&\240l\260&\270\t\300\021\340\014\024\320\024%\240\\\260\021\260&\270\t\300\021\330\014\024\320\024%\240\\\260\026\260y\300\001\340\014\"\240&\250\001\330\020\033\2301\330\025$\240F\250)\2601\330\025$\240F\250)\2601\330\025$\240F\250)\2601\330\025$\240F\250)\2601\330\025$\240F\250(\260!\2606\270\031\300!\360\006\000\r\"\240\026\240q\330\020\033\2301\330\025$\240F\250)\2601\330\025$\240F\250)\2601\330\025$\240F\250)\2601\330\025$\240F\250)\2601\330\025$\240F\250(\260!\2606\270\031\300!\360\006\000\r\016\360L""\001\000\r\016\360F\001\000\r\035\230H\240A\240Q\330\014\034\230H\240A\240Q\340\014\023\2208\320\033,\250A\250Q\360\010\000\r\035\230F\320\"4\260A\330\020 \240\017\250v\260Q\340\014\031\230\021\330\014\017\210t\2201\330\020\026\220h\230a\330\024\025\330\024\032\230/\250\021\340\020\027\220q\230\005\230Q\330\020\033\2304\230q\330\020\021\330\014\020\320\020&\240a\240~\260Q\360\006\000\r\035\230A\330\014\030\230\001\330\014\036\230a\340\014!\240\026\240q\330\020\033\2301\330\025$\240F\250!\330\025 \240\006\240a\330\025 \240\006\240i\250q\330\025#\2406\250\031\260!\360\006\000\r\"\240\026\240q\330\020\033\2301\330\025\037\230v\240Y\250a\330\025\037\230v\240Y\250a\330\025 \240\006\240i\250q\330\025\037\230v\240Y\250a\360\006\000\r\034\2306\240\021\330\020\033\2301\330\025 \240\006\240a\330\025&\240f\250A\330\025%\240V\2501\330\025#\2406\250\021\330\025%\240V\2501\330\025\037\230v\240Q\330\025\037\230v\240Q\330\025+\2506\260\021\360\006\000\r\023\320\022\"\240,\250a\330\020\026\220i\230y\250\006\250i\260q\330\020\026\220k\240\026\240x\250q\260\006\260i\270q\330\020\026\220i\230q\340\014\022\320\022\"\240+\250V\2609\270A\330\014%\240V\2507\260!\2601\340\014\r\360<\000\r\016\330\020\026\320\026.\250l\270!\330\024\032\230(\240!\320#4\260F\270)\3007\310&\320PY\320YZ\340\020\026\320\026.\250k\270\026\270y\310\001\330\020\026\220n\240A\240V\2506\3201B\300!\330\020\023\2206\320\0311\260\021\330\024\032\230&\240\001\240\026\240s\250&\260\007\260q\270\001\340\024\030\320\0305\260Q\330\024\032\230&\240\001\240\021\340\024\032\230&\240\001\330\030\031\330\030\036\230o\250Q\340\014\023\220=\240\001\330\020\026\220f\230A\320\035C\3001\340\014\017\210t\2204\220q\330\020\026\220h\230a\330\024\025\340\024\032\230/\250\021\360\006\000\r\021\220\001\330\020\032\230!\330\020\034\230A\330\020!\240\021\330\020\036\230a\340\014\023\2201\220E\230\021\330\014\027\220t\2301\330\014\022\220%\220q\330\020\021\360\010\000\r\023\220,\230l\250!\330\020\026\220h\230a\230v\240Y\250a\330\020\026\220i""\230q\330\020\026\220i\230q\330\020\026\220i\230q\340\014\022\220,\230k\250\026\250q\360\010\000\r\023\220&\230\t\240\024\240Q\330\014\022\220$\220d\230!\330\020\021\330\024\032\230&\240\014\250A\250V\2606\270\021\270&\300\006\300c\310\021\330\024\027\220t\2304\230t\2401\330\030\031\330\024\027\220s\230)\2403\240a\330\030.\250a\250s\260!\330\024\032\320\032+\2501\250F\260&\270\001\270\021\330\024\032\320\032+\2501\250F\260&\270\001\270\021\330\027\030\330\024\030\230\006\230a\230q\340\010\017\210}\230A\330\014\022\220(\230!\320\033=\270Q\330\014\023\2201\220E\230\021\330\014\027\220t\2301\320\0040\260\001\360\022\000\t\014\2104\210{\230#\230Q\330\014\023\2201\330\010\t\330\014\025\220T\230\021\330\014\017\210w\220c\230\021\330\027\030\330\014\030\230\003\2301\330\020\026\320\0262\260!\330\024\033\2306\240\021\360\006\000\r\020\210z\230\023\230F\240!\330\020\027\220q\330\014\023\2201\330\010\017\210}\230A\330\014\022\220&\230\001\320\031D\300A\330\014\023\2201\320\004+\2501\340\010\020\220\004\220A\330\010\021\220\025\220a\330\010\021\220\021\340\010\014\210H\220E\230\035\240a\330\014\r\330\020\031\230\025\230l\250!\2501\330\020\036\230f\240F\250#\250S\260\006\260a\330\020\023\220:\230S\240\013\2503\250i\260s\270!\330\024\025\340\020\027\220v\230]\250!\2508\2601\330\020\034\230D\240\004\240A\240V\2509\260A\330\020\036\230f\240H\250C\250u\260D\270\006\270g\300S\310\001\330\020\033\2306\240\030\250\023\250E\260\021\330\024\032\230(\240#\240U\250$\250f\260G\2703\270d\300$\300a\300v\310Y\320VW\340\020\023\2205\230\014\240C\240q\330\024\025\340\020\022\220-\230q\240\006\240e\2501\330\020\024\320\024(\250\007\250q\260\001\330\020\032\230!\330\020\026\220f\230A\320\035<\270F\300&\310\001\330\014\024\220I\320\0351\260\021\330\020\026\220f\230A\320\035F\300f\310A\330\014\023\220=\240\001\330\020\026\220f\230A\320\035H\310\006\310a\340\010\017\210q\320\0041\260\034\320=O\310q\340\010\013\2104\210t\220;\230c\240\023\240D\250\004\250A\330\014\023\2201\330\010\017\210t\320\023)""\250\021\330\014\020\320\020(\250\001\250\021\330\014\027\220q\320\004+\2501\360\014\000\t\n\330\014\022\220$\220e\2301\330\021\025\220Q\330\020\031\230\024\230Q\330\020\031\230\024\230Q\340\014\031\230\027\240\005\240T\250\022\2508\2602\260Q\330\014\031\230\027\240\005\240T\250\022\2508\2602\260Q\340\014\017\210q\330\020\027\220q\330\014\017\210q\330\020\027\220q\330\014\017\210t\320\023.\250a\330\020\027\220q\330\014\017\210t\2201\330\020\027\220q\330\014\023\2201\330\017\020\330\014\023\2201\320\0042\260!\340\010\033\2301\340\010\025\220T\320\031.\250a\330\010\013\2101\330\014\r\330\020\031\230\032\240=\260\001\330\024\025\220\\\240\021\330\024\031\230\021\330\024\034\230A\330\024\033\230:\240Q\330\024\030\230\002\230(\240%\240q\340\020\024\220H\230F\240+\250Q\330\024\027\220x\230w\240d\250&\260\001\330\030\031\330\024\034\230B\230g\240Q\240m\2601\330\024\027\220q\330\030\033\2304\230q\240\003\2401\240E\250\026\250q\260\001\330\014\023\220=\240\001\330\020\026\220f\230A\320\035W\320WX\340\010\013\2101\330\014\023\2201\360\006\000\t\n\330\014\022\220$\320\026>\270a\330\010\017\210}\230A\330\014\022\220&\230\001\320\031>\270a\330\010\017\210q\320\0042\260!\330\010\022\220\"\220G\2301\330\010\014\320\014\034\230D\240\005\240Q\240a\330\014\r\330\020\026\220c\230\021\230,\240f\250A\250T\260\021\260!\330\024 \240\001\330\020\021\330\014\017\210t\2203\220a\330\020\021\330\014\r\330\025\031\230\021\230.\250\t\260\021\330\024\036\230f\240E\250\022\2508\2601\260I\270U\300'\310\021\310)\320S\\\320\\b\320bc\330\023\024\330\020\021\330\014\032\230!\330\020\027\220q\330\010\017\210q\320\0042\260!\340\010\017\210t\320\023.\250a\320\0043\2608\2701\360\022\000\t\017\210d\220%\220q\330\010\030\230\016\240d\320*=\270Q\340\r\021\220\021\330\014\017\210{\230#\230Q\330\020\033\2304\230q\330\020\033\2304\230q\330\020\030\230\004\230A\330\020\034\230A\340\020\033\2304\230q\330\020\033\2304\230q\330\020\030\230\004\230A\330\020\034\230A\340\010\027\220z\240\023\240D\320(9\270\021\270*""\300A\330\010\024\220D\320\030)\250\021\250'\260\021\330\010\027\220t\320\033,\250A\250Z\260q\360\006\000\t\014\210=\230\003\2301\330\014\017\210}\230D\240\t\250\026\250z\270\021\330\020\027\220q\330\014\023\2201\360\006\000\t\014\2101\330\014\023\2201\360\006\000\t\014\2104\320\0170\260\003\2604\260u\270M\310\023\310A\330\014\023\2201\360\006\000\t\020\210q\320\000 \240\001\340\004\005\330\004\007\320\007\033\2303\230a\330\010\036\320\0364\260A\330\004\013\2101\320\0044\260A\330\010\022\220\"\220G\2301\330\010\t\330\023\024\330\017\020\330\014\023\2201\330\010\014\210H\220F\230-\240q\250\001\250\027\260\013\2701\330\014\r\330\020\023\2204\220u\230A\230W\240C\240q\330\024\025\330\020\032\230#\230U\240!\2404\240u\250A\250[\270\003\2703\270f\300A\330\020\030\230\004\230E\240\021\240(\250#\250S\260\006\260a\330\020\033\2303\230i\240q\250\001\330\020\036\230a\330\024\033\2301\330\024\032\320\032*\250&\260\017\270v\300Q\330\020\021\330\010\017\210q\320\004)\250\021\360\022\000\t\014\2104\210t\220;\230a\330\014\023\2201\340\010\t\330\014\017\210t\220;\230c\240\021\330\020\027\220t\320\0330\260\001\330\021\025\220[\240\003\2401\330\020\027\220t\320\033.\250a\330\021\025\220[\240\003\2401\330\020\027\220t\320\033.\250a\330\010\017\210}\230A\330\014\022\220&\230\001\320\031L\310A\330\014\023\2201\340\010\017\210q\320\004*\250!\340\010\013\2104\210t\220;\230a\330\014\023\2201\330\010\t\330\014\017\210t\220;\230c\240\021\330\020\027\220t\320\0331\260\021\330\014\023\2204\320\027/\250q\330\010\017\210}\230A\330\014\022\220&\230\001\320\031S\320ST\330\014\023\2201\320\004;\2708\3001\340\010\016\210d\220%\220q\330\010\014\210D\220\002\220$\320\0263\2602\260T\270\021\330\014\r\330\010\014\320\014*\250!\340\010\t\330\014\026\220a\330\014\025\220Q\330\014\027\220q\330\t\r\210Q\210d\220,\230a\340\010\016\210h\220a\330\014\r\340\014\r\330\014\r\320\0049\270\021\340\017\020\330\010\r\210^\230:\240W\250I\260[\300\007\300q\340\010\021\220\026\220u\230A\230V\2405\250\r\260Q\260a\330\010""\020\220\006\220e\2301\230F\240%\240}\260A\260Q\330\010\013\2104\210w\220c\230\024\230Q\330\014\026\220a\340\010\022\220!\340\010\033\2301\330\014\027\220q\330\021\035\230Q\330\021\031\230\026\230q\330\021\030\230\001\330\021\037\230q\330\021\034\230A\330\021 \240\001\330\021\034\230A\360\006\000\t\017\210m\230<\240q\250\006\250a\330\010\016\210m\230;\240a\330\010\016\210n\230L\250\001\250\021\330\010\r\210_\230L\250\001\250\031\260'\270\021\270(\300'\310\021\310!\330\010\r\210^\230<\240q\250\t\260\027\270\007\270q\300\001\330\010\r\210^\230;\240g\250Q\250a\330\010\r\320\r\036\230l\250!\2507\260!\2601\340\010\022\220&\230\r\240Q\240a\330\010\013\2104\210q\330\014\026\220a\340\010\033\2301\330\010\t\330\014\023\2208\2305\240\001\240\024\240U\250!\2501\330\014\021\220\037\240\001\240\031\250%\250q\260\010\270\005\270Q\270a\330\014\027\220u\230A\230Q\330\014\026\220e\230>\250\021\250)\2603\260e\2701\270A\330\014\017\210q\330\020\024\220I\230U\240!\2408\2501\330\024\033\2307\240!\2406\250\021\330\024\034\230D\240\007\240q\250\t\260\036\270z\310\021\330\024\027\220x\230s\240%\240v\250Q\330\030\033\2304\230q\240\007\240q\250\006\250a\330\020\025\320\025&\240a\240q\340\014\022\220.\240\001\240\021\330\010\017\210q\200A\340\010\t\330\014\020\220\010\230\001\330\017\020\200A\340\r\021\220\021\330\014\020\320\0201\260\021\330\014\020\320\020.\250a\330\014\020\320\0201\260\021\330\014\020\320\020.\250a\330\014\020\320\020.\250a\330\014\020\320\020+\2501\200A\360\016\000\t\034\2303\230c\240\024\240Q\330\010\030\230\003\2303\230c\240\024\240T\250\021\330\010\025\220T\320\031.\250a\330\010\013\2104\210q\330\014\022\220(\230!\2301\330\014\r\340\010\016\210d\220$\220a\330\014!\240\021\330\014\023\2201\330\014\r\330\020\027\220z\240\026\240q\330\024\025\220\\\240\034\250Q\330\024\033\230:\240Q\330\024\033\230:\240Q\330\024\031\230\021\330\024\034\230A\330\024\030\230\002\230(\240%\240q\340\020\024\320\024-\250Q\330\020\024\320\0244\260A\330\020\026\220e\2301\330\024\025\330\032\033""\2304\230q\360\006\000\021\030\220t\2308\2407\250!\330\020\024\220H\230D\240\001\330\024\027\220t\2301\330\030\031\340\024\037\230t\2406\250\021\330\024\"\240\"\240F\250!\320+@\300\001\330\024\027\220q\330\030-\250S\260\001\260\033\270F\300!\3001\330\030\031\340\024#\2402\240V\2501\320,F\300a\330\024\027\220}\240D\320(;\2707\300!\330\030#\2403\240a\240|\2606\270\021\270!\330\030\036\230d\240%\240q\330\035!\240\021\330\034\037\230y\250\003\2504\250q\330 #\320#6\260c\270\021\330$(\320(I\310\021\330%8\270\003\2701\330$(\320(F\300a\340 #\320#6\260c\270\021\330$(\320(F\300a\330%8\270\003\2701\330$(\320(C\3001\330\030-\250Q\330\023\024\330\020\026\220h\230a\230q\330\020\021\330\014\023\220=\240\001\330\020\026\220h\230a\320\037D\300A\340\020\024\320\0244\260A\330\020\023\2205\230\007\230u\240D\250\004\250E\260\023\260C\260q\330\024\025\330\030\034\230J\240a\330\033\034\340\020\024\320\024-\250Q\340\014\017\210t\2204\220q\330\020\026\220h\230a\230q\330\020\024\220F\230!\2301\320\004$\240A\340\010\t\330\014\023\2204\320\0270\260\001\260\021\330\017\020\330\014\023\2201\200A\360\016\000\t\n\330\014\020\320\020+\2504\320/P\320PQ\330\014\017\210t\2201\330\020\024\320\0240\260\001\340\020\026\220h\230a\230q\340\014\r\330\027\030\330\020\024\320\024.\250a\330\020\024\320\024%\240Q\330\020\031\230\024\320\0357\260q\330\020\023\2201\330\024\030\320\0302\260!\330\024\032\230%\230q\330\030\031\330\030\031\360\006\000\025\033\230(\240!\2401\330\023\024\330\020\026\220h\230a\230q\340\014\020\220\014\230D\240\001\240\024\320%;\2703\270d\300!\330\014\017\210t\2201\330\020\026\220e\2301\330\024\025\340\024\027\220q\230\004\230A\330\032\033\2304\230q\330\024\030\230\001\360\006\000\021\027\220h\230a\230q\330\010\017\210}\230A\330\014\022\220(\230!\320\033P\320PQ\330\014\020\220\014\230A\200A\360\016\000\t\014\2104\210{\230#\230Q\330\014\r\340\010\016\210e\2201\220A\330\010\014\210O\2301\330\010\014\210F\220!\2201\330\010\014\320\014%\240Q\330\010\014\320\014$\240A\330\010\014\210O\2301""\330\010\014\320\014\036\230a\330\010\016\210e\2201\330\014\r\340\014\017\210q\220\004\220A\330\014\020\220\001\330\014\020\220\001\200A\340\010\013\2104\320\017%\240T\250\024\320-B\300)\3101\330\014\r\340\010\014\320\014$\240I\250W\260A\330\014\023\2204\220q\330\014\023\2201\330\014\021\220\021\340\010\014\320\014!\240\026\240q\330\010\014\210F\220!\2201\200A\340\010\013\2104\210t\2201\330\014\r\330\010\013\2104\320\017$\240D\250\004\320,@\300\t\310\021\330\014\r\340\010\014\320\014#\2409\250G\2601\330\014\023\2204\220q\330\014\023\2201\330\014\021\220\021\340\010\014\320\014 \240\006\240a\320\004$\240A\340\010\013\2104\210t\2201\330\014\023\2207\230!\340\010\020\220\004\220A\330\010\021\220\025\220a\330\010\031\230\021\330\010\026\220a\330\010\016\210d\220%\220q\340\010\014\210J\220d\230!\330\014\r\330\020\024\220I\230V\2405\250\001\330\031\035\230Q\330\030\033\2305\240\006\240c\250\026\250q\330\034-\250Q\330\034 \320 A\300\021\330\035\"\240&\250\004\250F\260)\2706\300\021\330\034*\250!\330\034 \320 >\270a\330\023\024\340\014\023\220;\230a\330\020\026\220f\230A\320\035A\300\026\300w\310a\340\010\017\320\017\037\230q\320\004,\250A\360\022\000\t\014\2104\210t\220;\230a\330\014\023\2201\340\010\t\330\014\017\210t\220;\230c\240\021\330\020\027\220t\320\0333\2601\330\021\025\220[\240\003\2401\330\020\027\220t\320\0331\260\021\330\021\025\220[\240\003\2401\330\020\027\220t\320\0331\260\021\330\010\017\210}\230A\330\014\022\220&\230\001\320\031L\310A\330\014\023\2201\340\010\017\210q\210A\330\020\021\330\024\033\2306\240\031\250%\250q\260\001\330\024\032\320\032*\250!\330\030 \240\013\2506\260\026\260v\270Q\270g\300Q\340\024\027\220t\2307\240\"\320$;\2702\270V\3007\310!\3101\330\030\031\330\024\032\230&\320 5\260Q\260d\270!\330\024\032\230&\320 0\260\001\330\030 \240\013\2505\260\006\260f\270A\270W\300A\340\024\027\220t\2303\230f\240I\250U\260\"\260B\260a\330\030\031\330\024\035\230^\320+<\270A\270Q\330\024\027\220v\230X\240S\250\001\330\030\031\330\024\034\230H\320$5""\260Q\260e\2701\330\024\032\230$\230e\2401\330\031\035\230Q\330\030\034\320\034:\270!\330\030\033\2305\240\017\250s\260/\300\022\3001\330\034 \320 >\270a\330\030\033\2305\240\017\250r\260\021\330\034 \320 =\270Q\330\030\033\2305\240\010\250\003\2505\260\001\330\034 \320 =\270Q\330\027\030\200A\340\010\t\360\010\000\r\016\330\027\030\330\020\024\320\024,\250A\330\020\024\320\0240\260\001\330\020\024\220L\240\001\330\020\026\220e\2301\330\024\025\340\020\021\330\023\024\330\020\024\320\0240\260\001\360\006\000\r\016\340\020\031\230\026\230u\240A\240Q\360\006\000\021)\250\001\330\0204\260A\330\020.\250a\330\020:\270!\360\006\000\021\025\320\0243\260=\300\006\300m\320ST\330\020\024\320\0240\260\r\270V\300=\320PQ\330\020\024\220O\2409\250E\260\021\360\006\000\021\025\220A\330\024-\250Q\330\0249\270\021\340\020\024\320\024%\240Q\360\010\000\021\022\340\024/\250q\330\024,\250A\360\006\000\025'\240a\330\024$\240A\330\024)\250\021\330\024,\250A\330\024-\250Q\360\006\000\025*\250\026\250z\270\021\330\030\036\230a\330\030\036\230a\330\030\036\230a\330\030\036\230a\330\030\036\230a\360\010\000\025\026\360<\000\025$\320#5\260Q\260a\360\006\000\025#\240\"\240C\320'8\270\003\2702\270S\300\017\310q\330!#\2403\320&:\270#\270R\270s\320BY\320Y\\\320\\^\320^a\320ab\360\010\000\025\033\320\032+\250<\260q\330\030\036\230a\330\030\036\230a\330\030\036\230a\330\030\036\230a\330\030\031\330\030\036\230a\340\024\032\320\032+\250;\260f\270A\360\006\000\025\033\320\032+\250<\260q\270\006\270k\310\026\310q\330\024\032\320\032+\250;\260f\270A\360\006\000\025\033\320\0326\260l\300!\3006\310\033\320TZ\320Z[\330\024\032\320\0326\260k\300\026\300q\360\010\000\025!\240\006\320&7\260q\330\030\031\330\030\031\330\030\031\330\030\031\330\030\031\330\030\031\360\006\000\025\030\220z\240\024\240Z\250s\260!\340\030\"\240&\320(9\270\021\270+\300Q\330\030\033\2301\330\034 \320 4\260A\330\034 \320 =\270Q\330\034 \320 ;\2701\330\034\"\240%\240q\250\001\340\034\"\240(\250!\2501\330\034 \320 ;\2701\360\006\000""\031\037\230h\240a\240q\330\030\034\320\0347\260q\340\020\027\220}\240A\330\024\032\230&\240\001\320![\320[\\\330\024\030\320\0303\2601\340\014\023\220=\240\001\330\020\026\220h\230a\320\037F\300a\330\020\024\320\024/\250q\340\014\017\210t\2201\330\020\024\220L\240\001\340\020\024\220L\240\001\330\020\026\220e\2301\230A\340\010\017\210}\230A\330\014\022\220(\230!\320\033P\320PQ\330\014\020\220\014\230A\200A\340\025\026\330\010\024\220A\330\t\n\360\014\000\t\014\2104\210t\220;\230a\330\014\023\2201\330\010\013\210<\220s\230!\330\014\020\320\020.\250a\330\014\022\220%\220q\330\020\021\330\020\021\340\014\020\320\0201\260\021\260!\330\014\023\2201\330\010\017\210q\200A\340\017\020\340\010\020\220\004\220A\330\010\021\220\025\220a\330\010\021\220\021\220&\230\007\230t\2407\250$\250j\270\004\270A\330\010\013\2104\210q\330\014\r\340\010\016\210e\2201\320\024J\310#\310Q\310a\340\010\016\210d\220$\220a\330\014\r\330\020\032\230#\230T\240\026\240w\250a\250t\2601\260F\270%\270u\300D\310\004\310A\330\020\026\220d\230%\230q\330\020\024\220F\230!\330\024\030\230\t\240\026\240q\250\003\2505\260\001\330\035!\240\021\330\034\037\230u\240F\250#\250V\2601\330 $\320$E\300Q\330!&\240f\250D\260\006\260i\270v\300Q\330 $\320$B\300!\330\014\023\220=\240\001\330\020\026\220f\230A\320\035=\270Q\330\020\024\220F\230!\2301\200A\360(\000\t\r\320\014-\250\\\270\026\270}\310A\330\010\014\320\014*\250,\260f\270M\310\021\330\010\014\320\014,\250A\330\010\014\320\014)\250\021\330\010\014\320\014-\250Q\330\010\014\320\014*\250!\330\010\014\320\014*\250!\330\010\014\320\014*\250!\330\010\014\320\014)\250\021\330\010\014\320\014*\250!\330\010\014\320\014%\240V\2501\330\010\014\320\014\037\230v\240Q\330\010\014\320\014\035\230Y\240e\2501\360\006\000\t\027\220i\230v\240Q\330\010\023\2201\220A\340\010\014\320\014\034\230I\240W\250A\330\014\023\2204\220q\330\014\022\220-\230q\330\014\023\2201\330\014\021\220\021\340\010\014\210M\230\026\230q\360\006\000\t\014\2104\210{\230%\230q\240\010\250\005\250S\260""\004\260H\270A\270Q\330\014\022\220(\230!\2301\330\014\020\220\014\230A\330\014\r\340\010\014\210L\230\001\330\010\016\210e\2201\330\014\r\200A\330\010\014\210L\230\001\330\010\014\210M\230\030\240\027\250\001\330\010\014\320\014\034\230A\360\006\000\t\r\320\014\036\230a\330\010\014\320\014%\240Q\330\010\014\320\014$\240E\250\026\250q\330\010\014\320\014-\250\\\270\026\270}\310A\330\010\014\320\014*\250,\260f\270M\310\021\330\010\014\320\014,\250A\330\010\014\320\014)\250\021\330\010\014\320\014-\250Q\330\010\014\320\014*\250!\330\010\014\320\014*\250!\330\010\014\320\014*\250!\330\010\014\320\014)\250\021\330\010\014\320\014*\250!\330\010\014\320\014(\250\005\250Q\250g\260Q\330\010\014\320\014%\240Q\330\010\014\320\014'\240q\330\010\014\320\014(\250\001\330\010\014\320\014$\240A\330\010\014\320\014&\240a\330\010\014\320\014#\2401\330\010\014\210O\2309\240E\250\021\330\010\014\320\014-\250Q\330\010\014\320\014*\250!\330\010\014\320\014-\250Q\330\010\014\320\014*\250!\330\010\014\320\014*\250!\330\010\014\320\014'\240q\330\010\014\320\0144\260A\330\010\014\320\014%\240Q\330\010\014\320\014$\240A\330\010\014\320\014,\250A\330\010\014\320\014#\2401\330\010\014\320\014)\250\021\330\010\014\320\014\"\240!\330\010\014\210A\330\014\r\330\014\r\330\014\r\330\014\r\330\014\r\330\014\r\340\010\014\320\014)\250\021\330\010\014\320\014-\250Q\330\010\014\320\014)\250\021\330\010\014\320\014*\250!\330\010\014\320\014+\2501\330\010\014\210O\2301\360\006\000\t\r\320\014'\240q\330\010\014\320\014)\250\021\360\006\000\t\n\330\014!\240\026\240q\320(M\320M`\320`a\330\014\017\320\017\"\240#\240Q\330\020\026\220e\2301\230A\330\020\021\330\017\020\360\n\000\t\r\210L\230\001\200A\340\010\014\210O\2301\340\010\013\2104\210{\230#\230Z\240t\2504\250q\330\014\r\330\020\031\230\024\230_\250D\260\001\260\021\330\020\023\2201\330\024\027\220{\240#\240T\250\021\330\030\036\320\0362\260!\2604\3207M\310Q\310a\330\024\027\220x\230s\240$\240a\330\030\036\320\0362\260!\2604\3207M\310Q\310a\330\014\023""\220=\240\001\330\020\026\220f\230A\320\035D\300A\340\010\013\2104\210{\230#\230Y\240d\250'\260\021\260&\270\001\330\014\r\330\020\023\2204\320\0270\260\004\260G\2701\270F\320BS\320SW\320W[\320[\\\330\024\035\230T\240\021\340\024\032\320\032+\2501\250D\3200C\3001\360\006\000\025\031\230\006\230a\230q\340\024\030\320\030,\250A\330\024\030\320\0303\2601\330\024\032\230&\240\001\240\021\330\014\023\220=\240\001\330\020\026\220f\230A\320\035F\300a\340\020\024\320\024/\250q\330\020\023\2207\230!\2306\240\021\330\024\030\320\030,\250A\340\010\013\2104\210{\230#\230Q\330\014\020\320\020)\250\021\320\004,\250A\340\010\016\210d\220%\220q\330\010\014\210D\220\002\220$\320\0262\260\"\260D\270\001\330\014\023\2204\220q\330\010\021\220\021\330\010\t\330\014\017\210t\220;\230c\240\021\330\020\031\230\024\320\035>\270a\330\021\025\220[\240\003\2401\330\020\031\230\024\320\035@\300\001\330\010\017\210}\230A\330\014\022\220&\230\001\320\031?\270q\330\010\014\320\014-\250Q\330\010\014\320\014)\250\021\330\010\017\210q\200A\340\017\020\330\020\021\330\t\n\360\016\000\t\017\210d\220%\220q\330\010\021\220\021\220$\220b\230\n\240+\250Q\330\010\022\220!\2204\220r\230\033\240L\260\001\340\010\024\220G\2307\240%\240t\2507\260\"\260A\330\010\025\220X\230W\240E\250\024\250X\260R\260q\340\010\013\210:\220U\230$\230k\250\023\250F\260#\260Q\330\014\023\2201\330\010\013\210;\220e\2304\230z\250\023\250G\2602\260Q\330\014\023\2201\330\010\017\210q\220A\330\030\031\330\034\037\230q\340 ,\250F\3202N\310a\330$*\250)\2601\260A\330$%\360\006\000!0\250t\2605\270\001\360\006\000&*\250\021\330$'\240{\260$\3206G\300q\330(,\250A\330,9\270\021\330,9\270\021\340)4\260D\3208L\320L]\320]l\360\000\000m\001D\002\360\000\000D\002E\002\330(,\250A\330,9\270\021\330,9\270\021\340\037 \360\010\000\031 \230q\200A\340\010\017\210t\2201\330\010\013\2105\220\007\220u\230D\240\004\240E\250\023\250C\250q\330\014\r\330\020\024\220J\230a\330\020\024\220E\230\021\230(\240!\330\023\024\330\020\021\330\024\030\230\005\230Q\330""\027\030\340\010\014\320\014%\240Q\330\010\014\320\014,\250A\340\010\014\210J\220d\230!\330\014\r\330\020\026\220f\230A\330\023\024\340\010\014\320\014#\2401\320\004$\240A\340\010\t\330\014\017\210t\2204\220q\330\020\027\220q\340\021\025\220Q\330\020\035\230T\320!9\270\025\270a\340\014\033\2304\230u\240A\360\006\000\r\020\210z\230\024\230Q\230m\2505\260\r\270R\270z\310\021\310.\320XZ\320Z[\330\020\034\230J\240d\250!\2501\330\020\023\220:\230W\240A\340\024\027\220z\240\023\240A\330\030\037\230q\340\030\037\230q\360\006\000\r\024\2201\340\017\020\330\014\023\2201\320\004\034\230A\340\010\017\210t\220:\230T\240\024\240Q\200A\340\010\t\330\014\017\210t\220;\230c\240\021\330\020\024\320\024(\250\001\330\021\025\220[\240\003\2401\330\020\024\320\024&\240a\330\021\025\220[\240\003\2401\330\020\024\320\024&\240a\340\020\026\220h\230a\320\037P\320PT\320TU\330\020\024\220L\240\001\330\010\017\210}\230A\330\014\022\220(\230!\320\033Q\320QR\330\014\022\220(\230!\2301\330\014\020\220\014\230A\340\014\020\320\020 \240\001\210A\330\020\021\330\024\027\220v\230S\240\001\330\030!\240\023\240A\240Q\330\030\033\2307\240#\240Q\330\034!\240\026\240u\250A\250X\260V\2708\3001\320DT\320TU\330\034\037\230u\240B\240g\250R\250q\330 '\240v\250_\270A\270V\3007\310(\320RS\330\030\035\230V\2405\250\001\250\030\260\026\260x\270q\320@P\320PQ\330\030#\2404\240q\250\002\250'\260\022\2601\330\030\036\230d\240%\240q\330\030$\240G\2504\250\177\270a\330\030\"\240'\250\023\250A\330\030\033\2301\330\034'\240q\330\035!\240\021\330\034 \240\001\330 ,\250A\330 -\250Q\340\034\037\230q\330 $\320$B\300!\330 #\2404\240q\330$(\320(E\300Q\330!\"\330 $\320$B\300!\330!\"\360\006\000!%\320$A\300\021\330\027\030\340\020\027\220v\230_\250A\250V\2607\270(\300!\210A\330\020\021\330\024\027\220v\230S\240\001\330\030\035\230V\2405\250\001\250\030\260\026\260x\270q\320@Q\320QR\330\030#\2404\240q\250\002\250'\260\022\2601\330\030\"\240#\240Q\240a\330\030\"\240(\250$\250l\270!\330\030 \240\010\250\004\250J\260a\330\030\036""\230d\240%\240q\330\035!\240\021\330\034&\240c\250\021\250\"\250A\330\034(\250\010\260\004\260H\270C\270t\3001\330\034\037\230q\330 $\320$7\260t\2701\270A\330!\"\330 $\320$7\260x\270q\300\001\330\034 \240\001\330 ,\250A\330 -\250Q\340\034\037\230q\330 $\320$E\300Q\340 $\320$D\300A\330\034\037\230x\240s\250!\330 $\320$=\270W\300A\330$/\250q\330$1\260\023\260A\260R\260q\330$/\250q\330$-\250Q\330$1\260\021\330$0\260\001\330$1\260\021\340\027\030\340\020\027\220v\230_\250A\250V\2607\270(\300!\320\004)\250\021\360\014\000\t\n\330\021\025\220Q\330\020\030\230\004\230A\330\020\031\230\024\230Q\330\014\023\2204\320\027.\250a\250w\260a\330\017\020\330\014\023\2201\230!\230a\320\004&\240a\340\010\013\2104\210q\330\014\023\2204\220q\330\010\014\210M\230\021\330\014\022\220&\230\001\230\021\330\014\r\330\014\r\340\014\017\210z\230\024\230R\230u\240G\2501\250K\260t\2702\270W\300A\300[\320PR\320RS\330\020\024\320\024*\250!\330\020\027\220q\330\010\017\210q\320\004.\250a\340\010\013\2104\210t\220;\230a\330\014\023\2201\330\010\t\330\014\017\210t\220;\230c\240\021\330\020\027\220t\320\0335\260Q\330\014\023\2204\320\027/\250q\330\010\017\210}\230A\330\014\022\220&\230\001\320\031W\320WX\330\014\023\2201\320\004.\250a\340\010\013\2104\210t\220;\230c\240\023\240D\250\013\2603\260a\330\014\023\2201\330\r\021\220\021\330\014\023\2205\230\001\230\024\230Q\320\004&\240a\360\014\000\t\n\330\014\022\220$\220e\2301\330\021\025\220Q\330\020\030\230\004\230A\330\020\031\230\024\230Q\330\020\031\230\024\230Q\340\014\027\220t\320\0332\260!\2607\270!\330\014\017\210y\230\003\2301\330\020\027\220q\340\014\031\230\027\240\005\240T\250\022\2508\2602\260Q\330\014\031\230\027\240\005\240T\250\022\2508\2602\260Q\340\014\017\210{\230$\230e\240;\250d\260'\270\023\270A\330\020\027\220q\330\014\017\210q\330\020\027\220q\330\014\017\210t\320\023.\250a\330\020\027\220q\330\014\017\210y\230\003\2301\330\020\027\220q\330\014\023\2201\330\017\020\330\014\023\2201\320\004'\240q\340\010\t\330\014\023\2204\320""\0270\260\001\260\021\330\017\020\330\014\023\2201\320\004/\250q\360\020\000\t\n\330\014\020\220\004\220K\230q\330\014\017\210t\220;\230c\240\021\330\014\017\210t\2207\230!\2306\240\021\340\014\023\2201\330\010\t\330\021\025\220Q\330\020\031\230\024\230Q\230d\240!\330\020\024\320\024-\250V\2601\330\014\023\2201\330\010\017\210}\230A\330\014\022\220&\230\001\320\031H\310\001\330\014\023\2201\320\004'\240q\340\010\t\330\014\022\220$\220e\2301\330\021\025\220Q\330\020\034\230D\240\001\330\020\030\230\004\230A\330\020\031\230\024\230Q\330\014\017\210z\230\025\230d\240\"\240K\250r\260\021\330\020\027\220q\330\014\023\2204\320\027.\250a\250w\260a\330\017\020\330\014\023\2201\320\004'\240q\340\010\t\330\014\017\210t\2204\220q\330\020\027\220q\340\021\025\220Q\330\020\035\230T\320!<\270E\300\021\340\014\033\2304\230u\240A\360\006\000\r\020\210z\230\024\230Q\230m\2505\260\r\270R\270z\310\021\310.\320XZ\320Z[\330\020\034\230J\240d\250!\2501\330\020\023\220:\230W\240A\360\006\000\025\030\220z\240\023\240A\330\030\037\230q\340\030\037\230q\360\006\000\r\024\2201\340\017\020\330\014\023\2201\200\001\340\004\005\330\004\007\200q\330\010\t\330\014\037\230x\240q\330\014\"\240!\330\014\022\220&\230\001\230\021\330\010\017\210}\230A\330\014\022\220(\230!\320\033N\310a\320\004#\240<\250z\270\021\330\010\017\210t\2201\220D\230\005\230T\240\022\2404\240r\250\024\250Q";
    PyObject *data = NULL;
    CYTHON_UNUSED_VAR(__Pyx_DecompressString);
    #endif
    PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
    Py_ssize_t pos = 0;
    for (int i = 0; i < 666; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
      if (likely(string) && i >= 88) PyUnicode_InternInPlace(&string);
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
      stringtab[i] = string;
      pos += bytes_length;
    }
    for (int i = 666; i < 722; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
      stringtab[i] = string;
      pos += bytes_length;
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    Py_XDECREF(data);
    for (Py_ssize_t i = 0; i < 722; i++) {
      if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    #if CYTHON_IMMORTAL_CONSTANTS
    {
      PyObject **table = stringtab + 666;
      for (Py_ssize_t i=0; i<56; ++i) {
        #if PY_VERSION_HEX >= 0x030F0000
        PyUnstable_SetImmortal(table[i]);
        #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
        if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
        #if PY_VERSION_HEX < 0x030E0000
        if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
        #else
        if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
        #endif
        {
          Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
        }
        #else
        if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
        Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
        #endif
      }
    }
    #endif
  }
  {
    PyObject **numbertab = __pyx_mstate->__pyx_number_tab;
    double const c_constants[] = {0.0,0.2,0.3,0.4,0.5,2.0,3.0,0.04,0.05,0.10,0.15,0.75,60.0};
    for (int i = 0; i < 13; i++) {
      numbertab[i] = PyFloat_FromDouble(c_constants[i]);
      if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  {
    PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 13;
    int8_t const cint_constants_1[] = {0,-1,1,2,3,4,5,6,10,11,13,14,15,16,17,63};
    int16_t const cint_constants_2[] = {255,512,1024,2048};
    for (int i = 0; i < 20; i++) {
      numbertab[i] = PyLong_FromLong((i < 16 ? cint_constants_1[i - 0] : cint_constants_2[i - 16]));
      if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_number_tab;
    for (Py_ssize_t i=0; i<33; ++i) {
      #if PY_VERSION_HEX >= 0x030F0000
      PyUnstable_SetImmortal(table[i]);
      #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
      }
      #else
      if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_codeobjects ### */
typedef struct {
    unsigned int argcount : 3;
    unsigned int num_posonly_args : 1;
    unsigned int num_kwonly_args : 1;
    unsigned int nlocals : 6;
    unsigned int flags : 10;
    unsigned int first_line : 11;
} __Pyx_PyCode_New_function_description;
/* NewCodeObj.proto */
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        PyObject *line_table,
        PyObject *tuple_dedup_map
);


static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
  PyObject* tuple_dedup_map = PyDict_New();
  if (unlikely(!tuple_dedup_map)) return -1;
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 376};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_nCode, __pyx_mstate->__pyx_n_u_wParam, __pyx_mstate->__pyx_n_u_lParam, __pyx_mstate->__pyx_n_u_kb, __pyx_mstate->__pyx_n_u_injected, __pyx_mstate->__pyx_n_u_message, __pyx_mstate->__pyx_n_u_is_down, __pyx_mstate->__pyx_n_u_is_up, __pyx_mstate->__pyx_n_u_now, __pyx_mstate->__pyx_n_u_vk_code, __pyx_mstate->__pyx_n_u_is_repeat};
    __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_low_level_keyboard_proc, __pyx_mstate->__pyx_kp_b_iso88591_A_vS_V5_xq_QQR_4q_1_Qa_l_Ja_d_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 414};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_nCode, __pyx_mstate->__pyx_n_u_wParam, __pyx_mstate->__pyx_n_u_lParam, __pyx_mstate->__pyx_n_u_wparam, __pyx_mstate->__pyx_n_u_ms, __pyx_mstate->__pyx_n_u_injected, __pyx_mstate->__pyx_n_u_now, __pyx_mstate->__pyx_n_u_is_scroll, __pyx_mstate->__pyx_n_u_is_move};
    __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_low_level_mouse_proc, __pyx_mstate->__pyx_kp_b_iso88591_A_vS_AQ_7_Q_uAXV81DTTU_uBgRq_v_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 511};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_lParam, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_buf, __pyx_mstate->__pyx_n_u_got, __pyx_mstate->__pyx_n_u_header, __pyx_mstate->__pyx_n_u_mouse, __pyx_mstate->__pyx_n_u_now};
    __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_record_raw_mouse_input, __pyx_mstate->__pyx_kp_b_iso88591_A_6_q_6_vQgQ_t7_2V7_1_5Qd_0_5_fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 673};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_proxy, __pyx_mstate->__pyx_n_u_event_type, __pyx_mstate->__pyx_n_u_event, __pyx_mstate->__pyx_n_u_user_info, __pyx_mstate->__pyx_n_u_source_id, __pyx_mstate->__pyx_n_u_current_time};
    __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_event_tap_callback, __pyx_mstate->__pyx_kp_b_iso88591_A_q_F2Na_1A_0t5_6Gq_A_9_9_4D8LL, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 949};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_marker};
    __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 966};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_marker};
    __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 52};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_validation_enabled};
    __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_L_M_A_a_Q_E_q_A_fM_A_Q_QgQ_Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 124};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_del, __pyx_mstate->__pyx_kp_b_iso88591_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 131};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_user32, __pyx_mstate->__pyx_n_u_e, __pyx_mstate->__pyx_n_u_quartz};
    __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_cleanup, __pyx_mstate->__pyx_kp_b_iso88591_A_O1_4_Zt4q__D_1_T_2_47MQa_xs_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 169};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_proc, __pyx_mstate->__pyx_n_u_device};
    __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_linux_teardown_monitors, __pyx_mstate->__pyx_kp_b_iso88591_A_t1_5_uD_E_Cq_Ja_E_Q_Q_A_Jd_fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 191};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_linux_reset_timestamps, __pyx_mstate->__pyx_kp_b_iso88591_A_1_a_1_a_a_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 201};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_reinitialize_linux, __pyx_mstate->__pyx_kp_b_iso88591_A_4_Q_e1A_O1_F_1_Q_A_O1_a_e1_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 226};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_initialize, __pyx_mstate->__pyx_kp_b_iso88591_A_t_c_1_a_1_a_ha_PPTTU_L_A_QQR_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 245};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_hook_ready, __pyx_mstate->__pyx_n_u_hook_ok};
    __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_initialize_windows, __pyx_mstate->__pyx_kp_b_iso88591_A_A_fM_A_Q_V1_vQ_Ye1_ivQ_1A_IWA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 41, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 303};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ready_event, __pyx_mstate->__pyx_n_u_ok_flag, __pyx_mstate->__pyx_n_u_user32, __pyx_mstate->__pyx_n_u_kernel32, __pyx_mstate->__pyx_n_u_WH_KEYBOARD_LL, __pyx_mstate->__pyx_n_u_WH_MOUSE_LL, __pyx_mstate->__pyx_n_u_WM_MOUSEWHEEL, __pyx_mstate->__pyx_n_u_WM_MOUSEHWHEEL, __pyx_mstate->__pyx_n_u_WM_KEYDOWN, __pyx_mstate->__pyx_n_u_WM_KEYUP, __pyx_mstate->__pyx_n_u_WM_SYSKEYDOWN, __pyx_mstate->__pyx_n_u_WM_SYSKEYUP, __pyx_mstate->__pyx_n_u_LLKHF_INJECTED, __pyx_mstate->__pyx_n_u_LLMHF_INJECTED, __pyx_mstate->__pyx_n_u_HC_ACTION, __pyx_mstate->__pyx_n_u_HOOKPROC, __pyx_mstate->__pyx_n_u_KBDLLHOOKSTRUCT, __pyx_mstate->__pyx_n_u_MSLLHOOKSTRUCT, __pyx_mstate->__pyx_n_u_low_level_keyboard_proc, __pyx_mstate->__pyx_n_u_low_level_keyboard_proc, __pyx_mstate->__pyx_n_u_low_level_mouse_proc, __pyx_mstate->__pyx_n_u_low_level_mouse_proc, __pyx_mstate->__pyx_n_u_keyboard_proc, __pyx_mstate->__pyx_n_u_mouse_proc, __pyx_mstate->__pyx_n_u_hmod, __pyx_mstate->__pyx_n_u_keyboard_hook, __pyx_mstate->__pyx_n_u_mouse_hook, __pyx_mstate->__pyx_n_u_RIM_TYPEMOUSE, __pyx_mstate->__pyx_n_u_RID_INPUT, __pyx_mstate->__pyx_n_u_RIDEV_INPUTSINK, __pyx_mstate->__pyx_n_u_RAWINPUTDEVICE, __pyx_mstate->__pyx_n_u_RAWINPUTHEADER, __pyx_mstate->__pyx_n_u_RAWMOUSE, __pyx_mstate->__pyx_n_u_raw_input_header_size, __pyx_mstate->__pyx_n_u_record_raw_mouse_input, __pyx_mstate->__pyx_n_u_record_raw_mouse_input, __pyx_mstate->__pyx_n_u_rdi, __pyx_mstate->__pyx_n_u_e, __pyx_mstate->__pyx_n_u_msg, __pyx_mstate->__pyx_n_u_ret};
    __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_windows_hook_thread, __pyx_mstate->__pyx_kp_b_iso88591_00J_vWA_vWA_Q_Q_Q_Q_Q_Q_Q_Q_Q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 23, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 608};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_Quartz, __pyx_mstate->__pyx_n_u_quartz, __pyx_mstate->__pyx_n_u_kCGEventSourceStateID, __pyx_mstate->__pyx_n_u_kCGEventSourceStateHIDSystemStat, __pyx_mstate->__pyx_n_u_kCGEventSourceStatePrivate, __pyx_mstate->__pyx_n_u_kCGEventSourceStateCombinedSessi, __pyx_mstate->__pyx_n_u_kCGEventTapOptionDefault, __pyx_mstate->__pyx_n_u_kCGHeadInsertEventTap, __pyx_mstate->__pyx_n_u_kCGEventKeyDown, __pyx_mstate->__pyx_n_u_kCGEventKeyUp, __pyx_mstate->__pyx_n_u_kCGEventMouseMoved, __pyx_mstate->__pyx_n_u_kCGEventLeftMouseDown, __pyx_mstate->__pyx_n_u_kCGEventRightMouseDown, __pyx_mstate->__pyx_n_u_CGEventTapCallBack, __pyx_mstate->__pyx_n_u_event_tap_callback, __pyx_mstate->__pyx_n_u_event_tap_callback, __pyx_mstate->__pyx_n_u_callback_ref, __pyx_mstate->__pyx_n_u_event_mask, __pyx_mstate->__pyx_n_u_event_tap, __pyx_mstate->__pyx_n_u_enabled_2, __pyx_mstate->__pyx_n_u_e2, __pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_initialize_macos, __pyx_mstate->__pyx_kp_b_iso88591_A_A_0_L_e1_0_uAQ_4A_a_3_mST_0_V, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 774};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_evdev, __pyx_mstate->__pyx_n_u_opened, __pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_initialize_linux, __pyx_mstate->__pyx_kp_b_iso88591_A_4_PPQ_t1_0_haq_a_Q_7q_1_2_q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 819};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_candidate};
    __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_linux_xinput_binary, __pyx_mstate->__pyx_kp_b_iso88591_a_4q_4q_M_z_RuG1Kt2WA_PRRS_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 833};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ids, __pyx_mstate->__pyx_n_u_xinput_bin, __pyx_mstate->__pyx_n_u_output, __pyx_mstate->__pyx_n_u_line, __pyx_mstate->__pyx_n_u_match, __pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_linux_discover_xtest_device_ids, __pyx_mstate->__pyx_kp_b_iso88591_2_1_T_a_1_A_Q_q_HF_Q_xwd_BgQm1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 21, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 866};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ctypes, __pyx_mstate->__pyx_n_u_c_void_p, __pyx_mstate->__pyx_n_u_c_int, __pyx_mstate->__pyx_n_u_POINTER, __pyx_mstate->__pyx_n_u_Structure, __pyx_mstate->__pyx_n_u_byref, __pyx_mstate->__pyx_n_u_c_bool, __pyx_mstate->__pyx_n_u_libx11, __pyx_mstate->__pyx_n_u_libxi, __pyx_mstate->__pyx_n_u_Display, __pyx_mstate->__pyx_n_u_XIDeviceInfo, __pyx_mstate->__pyx_n_u_display, __pyx_mstate->__pyx_n_u_ids, __pyx_mstate->__pyx_n_u_major, __pyx_mstate->__pyx_n_u_minor, __pyx_mstate->__pyx_n_u_ndevices, __pyx_mstate->__pyx_n_u_devices, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_label};
    __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_linux_discover_xtest_device_ids_2, __pyx_mstate->__pyx_kp_b_iso88591_9_WI_q_uAV5_Qa_e1F_AQ_4wc_Q_a_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 918};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_now, __pyx_mstate->__pyx_n_u_active, __pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_automation_process_active, __pyx_mstate->__pyx_kp_b_iso88591_A_d_q_D_2_D_4q_t_c_a_1_A_q_Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 935};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_own_pid, __pyx_mstate->__pyx_n_u_cmdline_path, __pyx_mstate->__pyx_n_u_pid, __pyx_mstate->__pyx_n_u_handle, __pyx_mstate->__pyx_n_u_cmdline, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr};
    __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_scan_linux_automation_processes, __pyx_mstate->__pyx_kp_b_iso88591_2_G1_D_Qa_c_fAT_t3a_fE_81IU_S_b, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 953};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_own_pid, __pyx_mstate->__pyx_n_u_psutil, __pyx_mstate->__pyx_n_u_proc, __pyx_mstate->__pyx_n_u_cmdline, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_haystack, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr};
    __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_scan_windows_automation_process, __pyx_mstate->__pyx_kp_b_iso88591_4A_G1_1_HF_q_1_4uAWCq_U_4uA_3fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 972};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_linux_automation_process_active, __pyx_mstate->__pyx_kp_b_iso88591_2_t_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 976};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_evdev, __pyx_mstate->__pyx_n_u_ecodes, __pyx_mstate->__pyx_n_u_opened, __pyx_mstate->__pyx_n_u_path, __pyx_mstate->__pyx_n_u_device, __pyx_mstate->__pyx_n_u_name_lower, __pyx_mstate->__pyx_n_u_caps, __pyx_mstate->__pyx_n_u_key_codes, __pyx_mstate->__pyx_n_u_is_keyboard, __pyx_mstate->__pyx_n_u_is_mouse, __pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_linux_open_evdev_devices, __pyx_mstate->__pyx_kp_b_iso88591_1_A_a_HE_a_l_1_fF_S_a_S_3is_v_8, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1009};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_start_linux_evdev_reader, __pyx_mstate->__pyx_kp_b_iso88591_A_4t1_4_D_9G1_4q_1_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1023};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_select, __pyx_mstate->__pyx_n_u_evdev, __pyx_mstate->__pyx_n_u_ecodes, __pyx_mstate->__pyx_n_u_fd_map, __pyx_mstate->__pyx_n_u_readable, __pyx_mstate->__pyx_n_u__8, __pyx_mstate->__pyx_n_u_now, __pyx_mstate->__pyx_n_u_fd, __pyx_mstate->__pyx_n_u_event, __pyx_mstate->__pyx_n_u_e, __pyx_mstate->__pyx_n_u_device};
    __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_linux_evdev_reader_thread, __pyx_mstate->__pyx_kp_b_iso88591_A_A_a_t7_j_A_4q_e1_J_Qa_d_a_T_wa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1050};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_start_linux_xinput_monitor, __pyx_mstate->__pyx_kp_b_iso88591_A_4_T_B_1_IWA_4q_1_q_F_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1063};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_keyboard_events, __pyx_mstate->__pyx_n_u_mouse_events, __pyx_mstate->__pyx_n_u_xinput_bin, __pyx_mstate->__pyx_n_u_current_event_type, __pyx_mstate->__pyx_n_u_proc, __pyx_mstate->__pyx_n_u_line, __pyx_mstate->__pyx_n_u_stripped, __pyx_mstate->__pyx_n_u_event_match, __pyx_mstate->__pyx_n_u_device_match, __pyx_mstate->__pyx_n_u_slave_id, __pyx_mstate->__pyx_n_u_now, __pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_linux_xinput_monitor_thread, __pyx_mstate->__pyx_kp_b_iso88591_A_3c_Q_3c_T_T_a_4q_1_d_a_1_z_q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1141};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_evdev, __pyx_mstate->__pyx_n_u_ecodes, __pyx_mstate->__pyx_n_u_found_keyboard, __pyx_mstate->__pyx_n_u_found_mouse, __pyx_mstate->__pyx_n_u_now, __pyx_mstate->__pyx_n_u_device, __pyx_mstate->__pyx_n_u_event, __pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_linux_drain_evdev, __pyx_mstate->__pyx_kp_b_iso88591_A_4t1_7_A_a_a_d_q_Jd_IV5_Q_5_c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1169};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_is_enabled, __pyx_mstate->__pyx_kp_b_iso88591_A_t_T_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1173};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_event, __pyx_mstate->__pyx_n_u_quartz, __pyx_mstate->__pyx_n_u_source_id, __pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_classify_macos_cg_event, __pyx_mstate->__pyx_kp_b_iso88591_0_4_Q_1_T_wc_1_2_6_z_F_q_1_A_DA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1200};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_is_hardware, __pyx_mstate->__pyx_n_u_input_kind};
    __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_should_count_activity, __pyx_mstate->__pyx_kp_b_iso88591_A_A_4t_a_1_s_a_q_1_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1222};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_event, __pyx_mstate->__pyx_n_u_input_kind};
    __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_should_count_macos_cg_event, __pyx_mstate->__pyx_kp_b_iso88591_1_Oq_4t_c_D_A_1_t_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1231};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_input_kind, __pyx_mstate->__pyx_n_u_now, __pyx_mstate->__pyx_n_u_platform_hint};
    __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_notify_synthetic_input_filtered, __pyx_mstate->__pyx_kp_b_iso88591_81_d_q_D_32T_a_Q_q_Qd_a_ha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1251};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_is_hardware_keyboard_event, __pyx_mstate->__pyx_kp_b_iso88591_A_4t_a_1_t_c_t_31_1_t_1_1_t_1_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1276};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_events, __pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_drain_windows_keyboard_events, __pyx_mstate->__pyx_kp_b_iso88591_q_Kq_t_c_t7_6_1_Q_Qd_V1_1_A_H_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1299};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_is_hardware_scroll_event, __pyx_mstate->__pyx_kp_b_iso88591_4t_a_1_t_c_t_1_4_q_A_SST_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1311};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[38] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_get_last_hw_scroll_timestamp, __pyx_mstate->__pyx_kp_b_iso88591_a_4t_c_D_3a_1_5_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1318};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_is_hardware_mouse_event, __pyx_mstate->__pyx_kp_b_iso88591_4t_a_1_t_c_t_0_1_t_a_1_t_a_A_LA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1343};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[40] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_is_hardware_mouse_move_event, __pyx_mstate->__pyx_kp_b_iso88591_a_4t_a_1_t_c_t_5Q_4_q_A_WWX_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1355};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_hw_ts, __pyx_mstate->__pyx_n_u_syn_ts, __pyx_mstate->__pyx_n_u_now, __pyx_mstate->__pyx_n_u_hw_age, __pyx_mstate->__pyx_n_u_syn_age, __pyx_mstate->__pyx_n_u_hw_recent, __pyx_mstate->__pyx_n_u_syn_recent};
    __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_resolve_windows_input, __pyx_mstate->__pyx_kp_b_iso88591_A_d_q_b_Q_4r_L_G7_t7_A_XWE_XRq_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1379};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_hw_ts, __pyx_mstate->__pyx_n_u_syn_ts};
    __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_check_windows_keyboard, __pyx_mstate->__pyx_kp_b_iso88591_Q_A_Q_4_awa_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1393};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_now, __pyx_mstate->__pyx_n_u_hw_ts, __pyx_mstate->__pyx_n_u_syn_ts, __pyx_mstate->__pyx_n_u_raw_ts, __pyx_mstate->__pyx_n_u_resolved, __pyx_mstate->__pyx_n_u_syn_recent, __pyx_mstate->__pyx_n_u_raw_recent};
    __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_check_windows_mouse, __pyx_mstate->__pyx_kp_b_iso88591_a_e1_Q_A_Q_Q_t_2_7_y_1_q_T_82Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1425};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_now, __pyx_mstate->__pyx_n_u_syn_ts, __pyx_mstate->__pyx_n_u_raw_ts, __pyx_mstate->__pyx_n_u_syn_recent, __pyx_mstate->__pyx_n_u_raw_recent};
    __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_check_windows_mouse_move, __pyx_mstate->__pyx_kp_b_iso88591_1_e1_Q_Q_Q_T_82Q_T_82Q_q_q_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1452};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_now, __pyx_mstate->__pyx_n_u_scroll_ts, __pyx_mstate->__pyx_n_u_hw_ts, __pyx_mstate->__pyx_n_u_syn_ts};
    __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_check_windows_scroll, __pyx_mstate->__pyx_kp_b_iso88591_q_e1_Q_D_A_Q_z_d_Kr_q_4_awa_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1466};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_event_data, __pyx_mstate->__pyx_n_u_current_time, __pyx_mstate->__pyx_n_u_source_id};
    __pyx_mstate_global->__pyx_codeobj_tab[46] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_check_macos_keyboard, __pyx_mstate->__pyx_kp_b_iso88591_q_t4q_q_Q_T_E_4uA_z_Qm5_Rz_XZZ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1494};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_event_data, __pyx_mstate->__pyx_n_u_current_time, __pyx_mstate->__pyx_n_u_source_id};
    __pyx_mstate_global->__pyx_codeobj_tab[47] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_check_macos_mouse, __pyx_mstate->__pyx_kp_b_iso88591_A_t4q_q_Q_T_9_a_4uA_z_Qm5_Rz_XZ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1521};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ts, __pyx_mstate->__pyx_n_u_now};
    __pyx_mstate_global->__pyx_codeobj_tab[48] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_linux_ts_recent, __pyx_mstate->__pyx_kp_b_iso88591_z_t1D_T_4r_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1524};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_input_kind, __pyx_mstate->__pyx_n_u_now, __pyx_mstate->__pyx_n_u_keyboard_found, __pyx_mstate->__pyx_n_u_mouse_found, __pyx_mstate->__pyx_n_u_evdev_ts, __pyx_mstate->__pyx_n_u_xtest_ts, __pyx_mstate->__pyx_n_u_hw_ts, __pyx_mstate->__pyx_n_u_evdev_now, __pyx_mstate->__pyx_n_u_evdev_recent, __pyx_mstate->__pyx_n_u_hw_recent, __pyx_mstate->__pyx_n_u_xtest_recent};
    __pyx_mstate_global->__pyx_codeobj_tab[49] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_check_linux_input_event, __pyx_mstate->__pyx_kp_b_iso88591_381_d_q_d_Q_Q_4q_4q_A_A_4q_4q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[49])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1569};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[50] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_check_linux_keyboard, __pyx_mstate->__pyx_kp_b_iso88591_q_4_0_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[50])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1576};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[51] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_check_linux_mouse, __pyx_mstate->__pyx_kp_b_iso88591_A_4_0_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1587};
    PyObject* const varnames[] = {0};
    __pyx_mstate_global->__pyx_codeobj_tab[52] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_get_hardware_validator, __pyx_mstate->__pyx_kp_b_iso88591_3a_4A_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[52])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1594};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[53] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ws_package_utils_hardware_event_2, __pyx_mstate->__pyx_n_u_cleanup_hardware_validator, __pyx_mstate->__pyx_kp_b_iso88591_q_xq_A_Na, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) goto bad;
  }
  Py_DECREF(tuple_dedup_map);
  return 0;
  bad:
  Py_DECREF(tuple_dedup_map);
  return -1;
}
/* #### Code section: init_globals ### */

static int __Pyx_InitGlobals(void) {
  /* PythonCompatibility.init */
  if (likely(__Pyx_init_co_variables() == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CommonTypesMetaclass.init */
  if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CachedMethodType.init */
  #if CYTHON_COMPILING_IN_LIMITED_API
  {
      PyObject *typesModule=NULL;
      typesModule = PyImport_ImportModule("types");
      if (typesModule) {
          __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
          Py_DECREF(typesModule);
      }
  } // error handling follows
  #endif
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CythonFunctionShared.init */
  if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* AssertionsEnabled.init */
  if (likely(__Pyx_init_assertions_enabled() == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* Generator.init */
  if (likely(__pyx_Generator_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#ifdef _MSC_VER
#pragma warning( push )
/* Warning 4127: conditional expression is constant
 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
 * compile-time, so this warning is not useful
 */
#pragma warning( disable : 4127 )
#endif



/* #### Code section: utility_code_def ### */

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* PyErrFetchRestore (used by PyObjectGetAttrStrNoError) */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *tmp_value;
    assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
    if (value) {
        #if CYTHON_COMPILING_IN_CPYTHON
        if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
        #endif
            PyException_SetTraceback(value, tb);
    }
    tmp_value = tstate->current_exception;
    tstate->current_exception = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
#else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject* exc_value;
    exc_value = tstate->current_exception;
    tstate->current_exception = 0;
    *value = exc_value;
    *type = NULL;
    *tb = NULL;
    if (exc_value) {
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        #if CYTHON_COMPILING_IN_CPYTHON
        *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
        Py_XINCREF(*tb);
        #else
        *tb = PyException_GetTraceback(exc_value);
        #endif
    }
#else
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#endif
}
#endif

/* PyObjectGetAttrStr (used by PyObjectGetAttrStrNoError) */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
            "name '%U' is not defined", name);
    }
    return result;
}

/* TupleAndListFromArray (used by fastcall) */
#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    Py_ssize_t i;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    for (i = 0; i < n; i++) {
        Py_INCREF(src[i]);
        if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
            Py_DECREF(res);
            return NULL;
        }
    }
    return res;
}
#elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* BytesEquals (used by UnicodeEquals) */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\
        !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS)
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals (used by fastcall) */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length, length2;
        int kind;
        void *data1, *data2;
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        #endif
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length < 0)) return -1;
        #endif
        length2 = __Pyx_PyUnicode_GET_LENGTH(s2);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length2 < 0)) return -1;
        #endif
        if (length != length2) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    return (equals == Py_EQ);
return_ne:
    return (equals == Py_NE);
#endif
}

/* fastcall */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(n == -1)) return NULL;
    #endif
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        if (s == namei) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;
            return kwvalues[i];
        }
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs;
    PyObject *dict;
#if !CYTHON_ASSUME_SAFE_SIZE
    nkwargs = PyTuple_Size(kwnames);
    if (unlikely(nkwargs < 0)) return NULL;
#else
    nkwargs = PyTuple_GET_SIZE(kwnames);
#endif
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
#if !CYTHON_ASSUME_SAFE_MACROS
        PyObject *key = PyTuple_GetItem(kwnames, i);
        if (!key) goto bad;
#else
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
#endif
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* PyObjectCall (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
    self = __Pyx_CyOrPyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectFastCall (used by PyObjectCallOneArg) */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API
  #if PY_VERSION_HEX < 0x03090000
    #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable)
  #elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
    PyTypeObject *tp = Py_TYPE(callable);
    #if defined(__Pyx_CyFunction_USED) && CYTHON_METH_FASTCALL
    if (__Pyx_CyFunction_CheckExact(callable)) {
        return __Pyx_CyFunction_func_vectorcall(callable);
    }
    #endif
    if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
        return NULL;
    }
    assert(PyCallable_Check(callable));
    Py_ssize_t offset = tp->tp_vectorcall_offset;
    assert(offset > 0);
    vectorcallfunc ptr;
    memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
    return ptr;
}
  #else
    #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
  #endif
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
            return __Pyx_PyObject_CallMethO(func, NULL);
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
            return __Pyx_PyObject_CallMethO(func, args[0]);
    }
#endif
    if (kwargs == NULL) {
        #if CYTHON_VECTORCALL
          #if CYTHON_COMPILING_IN_LIMITED_API
            return PyObject_Vectorcall(func, args, _nargs, NULL);
          #else
            vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
            if (f) {
                return f(func, args, _nargs, NULL);
            }
          #endif
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
    }
    #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
    #else
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #endif
}

/* PyObjectCallOneArg (used by CallUnboundCMethod0) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* UnpackUnboundCMethod (used by CallUnboundCMethod0) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
    PyObject *result;
    PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
    if (unlikely(!selfless_args)) return NULL;
    result = PyObject_Call(method, selfless_args, kwargs);
    Py_DECREF(selfless_args);
    return result;
}
#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) {
        return _PyObject_Vectorcall
            (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames);
}
#else
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
    return
#if PY_VERSION_HEX < 0x03090000
    _PyObject_Vectorcall
#else
    PyObject_Vectorcall
#endif
        (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
}
#endif
static PyMethodDef __Pyx_UnboundCMethod_Def = {
     "CythonUnboundCMethod",
     __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
     METH_VARARGS | METH_KEYWORDS,
#else
     METH_FASTCALL | METH_KEYWORDS,
#endif
     NULL
};
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method, *result=NULL;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    result = method;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    } else
#endif
#if CYTHON_COMPILING_IN_PYPY
#else
    if (PyCFunction_Check(method))
#endif
    {
        PyObject *self;
        int self_found;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        self = PyObject_GetAttrString(method, "__self__");
        if (!self) {
            PyErr_Clear();
        }
#else
        self = PyCFunction_GET_SELF(method);
#endif
        self_found = (self && self != Py_None);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        Py_XDECREF(self);
#endif
        if (self_found) {
            PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
            if (unlikely(!unbound_method)) return -1;
            Py_DECREF(method);
            result = unbound_method;
        }
    }
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    if (unlikely(target->method)) {
        Py_DECREF(result);
    } else
#endif
    target->method = result;
    return 0;
}

/* CallUnboundCMethod0 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        if (likely(cfunc->flag == METH_NOARGS))
            return __Pyx_CallCFunction(cfunc, self, NULL);
        if (likely(cfunc->flag == METH_FASTCALL))
            return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
        if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
            return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
        if (cfunc->flag == METH_VARARGS)
            return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
        return __Pyx__CallUnboundCMethod0(cfunc, self);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *result;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
    result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
    return result;
}

/* py_dict_items (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
}

/* py_dict_values (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
}

/* OwnedDictNext (used by ParseKeywordsImpl) */
#if CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
    PyObject *next = NULL;
    if (!*ppos) {
        if (pvalue) {
            PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
            if (unlikely(!dictview)) goto bad;
            *ppos = PyObject_GetIter(dictview);
            Py_DECREF(dictview);
        } else {
            *ppos = PyObject_GetIter(p);
        }
        if (unlikely(!*ppos)) goto bad;
    }
    next = PyIter_Next(*ppos);
    if (!next) {
        if (PyErr_Occurred()) goto bad;
        return 0;
    }
    if (pkey && pvalue) {
        *pkey = __Pyx_PySequence_ITEM(next, 0);
        if (unlikely(*pkey)) goto bad;
        *pvalue = __Pyx_PySequence_ITEM(next, 1);
        if (unlikely(*pvalue)) goto bad;
        Py_DECREF(next);
    } else if (pkey) {
        *pkey = next;
    } else {
        assert(pvalue);
        *pvalue = next;
    }
    return 1;
  bad:
    Py_XDECREF(next);
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
    PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
#else
    PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
#endif
    if (pkey) *pkey = NULL;
    if (pvalue) *pvalue = NULL;
    return 0;
}
#else // !CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
    int result = PyDict_Next(p, ppos, pkey, pvalue);
    if (likely(result == 1)) {
        if (pkey) Py_INCREF(*pkey);
        if (pvalue) Py_INCREF(*pvalue);
    }
    return result;
}
#endif

/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
}

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
        }
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        PyObject *result = NULL;
        PyObject *args = PyTuple_New(2);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
        return result;
    }
#endif
    {
        PyObject *args[4] = {NULL, self, arg1, arg2};
        return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
    }
}

/* ParseKeywordsImpl (used by ParseKeywords) */
static int __Pyx_ValidateDuplicatePosArgs(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char* function_name)
{
    PyObject ** const *name = argnames;
    while (name != first_kw_arg) {
        PyObject *key = **name;
        int found = PyDict_Contains(kwds, key);
        if (unlikely(found)) {
            if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
            goto bad;
        }
        name++;
    }
    return 0;
bad:
    return -1;
}
#if CYTHON_USE_UNICODE_INTERNALS
static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
    int kind;
    Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
    if (len != PyUnicode_GET_LENGTH(s2)) return 0;
    kind = PyUnicode_KIND(s1);
    if (kind != PyUnicode_KIND(s2)) return 0;
    const void *data1 = PyUnicode_DATA(s1);
    const void *data2 = PyUnicode_DATA(s2);
    return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
}
#endif
static int __Pyx_MatchKeywordArg_str(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    #if CYTHON_USE_UNICODE_INTERNALS
    Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
    if (unlikely(key_hash == -1)) {
        key_hash = PyObject_Hash(key);
        if (unlikely(key_hash == -1))
            goto bad;
    }
    #endif
    name = first_kw_arg;
    while (*name) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) {
                *index_found = (size_t) (name - argnames);
                return 1;
            }
        }
        #endif
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
            if (__Pyx_UnicodeKeywordsEqual(name_str, key))
                goto arg_passed_twice;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            if (unlikely(name_str == key)) goto arg_passed_twice;
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) goto arg_passed_twice;
        }
        #endif
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
bad:
    return -1;
}
static int __Pyx_MatchKeywordArg_nostr(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
    name = first_kw_arg;
    while (*name) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (cmp == 1) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        if (unlikely(cmp == -1)) goto bad;
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (unlikely(cmp != 0)) {
            if (cmp == 1) goto arg_passed_twice;
            else goto bad;
        }
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
bad:
    return -1;
}
static CYTHON_INLINE int __Pyx_MatchKeywordArg(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    return likely(PyUnicode_CheckExact(key)) ?
        __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
        __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
}
static void __Pyx_RejectUnknownKeyword(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char *function_name)
{
    #if CYTHON_AVOID_BORROWED_REFS
    PyObject *pos = NULL;
    #else
    Py_ssize_t pos = 0;
    #endif
    PyObject *key = NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(kwds);
    while (
        #if CYTHON_AVOID_BORROWED_REFS
        __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL)
        #else
        PyDict_Next(kwds, &pos, &key, NULL)
        #endif
    ) {
        PyObject** const *name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (!*name) {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp != 1) {
                if (cmp == 0) {
                    PyErr_Format(PyExc_TypeError,
                        "%s() got an unexpected keyword argument '%U'",
                        function_name, key);
                }
                #if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(key);
                #endif
                break;
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        #endif
    }
    __Pyx_END_CRITICAL_SECTION();
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(pos);
    #endif
    assert(PyErr_Occurred());
}
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t extracted = 0;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    name = first_kw_arg;
    while (*name && num_kwargs > extracted) {
        PyObject * key = **name;
        PyObject *value;
        int found = 0;
        #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        found = PyDict_GetItemRef(kwds, key, &value);
        #else
        value = PyDict_GetItemWithError(kwds, key);
        if (value) {
            Py_INCREF(value);
            found = 1;
        } else {
            if (unlikely(PyErr_Occurred())) goto bad;
        }
        #endif
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            extracted++;
        }
        name++;
    }
    if (num_kwargs > extracted) {
        if (ignore_unknown_kwargs) {
            if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
                goto bad;
        } else {
            __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
            goto bad;
        }
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t len;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    if (PyDict_Update(kwds2, kwds) < 0) goto bad;
    name = first_kw_arg;
    while (*name) {
        PyObject *key = **name;
        PyObject *value;
#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
        int found = PyDict_Pop(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
        }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        int found = PyDict_GetItemRef(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
        }
#else
    #if CYTHON_COMPILING_IN_CPYTHON
        value = _PyDict_Pop(kwds2, key, kwds2);
    #else
        value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
    #endif
        if (value == kwds2) {
            Py_DECREF(value);
        } else {
            if (unlikely(!value)) goto bad;
            values[name-argnames] = value;
        }
#endif
        name++;
    }
    len = PyDict_Size(kwds2);
    if (len > 0) {
        return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
    } else if (unlikely(len == -1)) {
        goto bad;
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject *key = NULL;
    PyObject** const * name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
#if CYTHON_AVOID_BORROWED_REFS
        key = __Pyx_PySequence_ITEM(kwds, pos);
#else
        key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
#endif
#if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!key)) goto bad;
#endif
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            PyObject *value = kwvalues[pos];
            values[name-argnames] = __Pyx_NewRef(value);
        } else {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp == 1) {
                PyObject *value = kwvalues[pos];
                values[index_found] = __Pyx_NewRef(value);
            } else {
                if (unlikely(cmp == -1)) goto bad;
                if (kwds2) {
                    PyObject *value = kwvalues[pos];
                    if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                } else if (!ignore_unknown_kwargs) {
                    goto invalid_keyword;
                }
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        key = NULL;
        #endif
    }
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    goto bad;
bad:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(key);
    #endif
    return -1;
}

/* ParseKeywords */
static int __Pyx_ParseKeywords(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)))
        return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
    else if (kwds2)
        return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
    else
        return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
}

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* PyDictVersioning (used by GetModuleGlobalName) */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        if (!PyErr_Occurred())
            PyErr_SetNone(PyExc_NameError);
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
    PyErr_Clear();
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear();
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return result;
    }
#else
    result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* PyObjectVectorCallKwBuilder */
#if CYTHON_VECTORCALL
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_PyObject_FastCallDict;
    Py_INCREF(key);
    if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1;
    args[n] = value;
    return 0;
}
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_VectorcallBuilder_AddArgStr;
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n);
}
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    PyObject *pyKey = PyUnicode_FromString(key);
    if (!pyKey) return -1;
    return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n);
}
#else // CYTHON_VECTORCALL
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) {
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return PyDict_SetItem(builder, key, value);
}
#endif

/* GetTopmostException (used by SaveResetException) */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    PyObject *exc_value = exc_info->exc_value;
    if (exc_value == NULL || exc_value == Py_None) {
        *value = NULL;
        *type = NULL;
        *tb = NULL;
    } else {
        *value = exc_value;
        Py_INCREF(*value);
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        *tb = PyException_GetTraceback(exc_value);
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #endif
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    PyObject *tmp_value = exc_info->exc_value;
    exc_info->exc_value = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
  #else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
  #endif
}
#endif

/* PyObjectFastCallMethod */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
    PyObject *result;
    PyObject *attr = PyObject_GetAttr(args[0], name);
    if (unlikely(!attr))
        return NULL;
    result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
    Py_DECREF(attr);
    return result;
}
#endif

/* DictGetItem */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error
        if (unlikely(PyTuple_Check(key))) {
            PyObject* args = PyTuple_Pack(1, key);
            if (likely(args)) {
                PyErr_SetObject(PyExc_KeyError, args);
                Py_DECREF(args);
            }
        } else {
            PyErr_SetObject(PyExc_KeyError, key);
        }
    }
    return value;
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type = NULL, *local_value, *local_tb = NULL;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if PY_VERSION_HEX >= 0x030C0000
    local_value = tstate->current_exception;
    tstate->current_exception = 0;
  #else
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
  #endif
#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    local_value = PyErr_GetRaisedException();
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    if (likely(local_value)) {
        local_type = (PyObject*) Py_TYPE(local_value);
        Py_INCREF(local_type);
        local_tb = PyException_GetTraceback(local_value);
    }
#else
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
#endif // __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
      #if PY_VERSION_HEX >= 0x030B00a4
        tmp_value = exc_info->exc_value;
        exc_info->exc_value = local_value;
        tmp_type = NULL;
        tmp_tb = NULL;
        Py_XDECREF(local_type);
        Py_XDECREF(local_tb);
      #else
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
      #endif
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    PyErr_SetHandledException(local_value);
    Py_XDECREF(local_value);
    Py_XDECREF(local_type);
    Py_XDECREF(local_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
#endif
}

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_value = exc_info->exc_value;
    exc_info->exc_value = *value;
    if (tmp_value == NULL || tmp_value == Py_None) {
        Py_XDECREF(tmp_value);
        tmp_value = NULL;
        tmp_type = NULL;
        tmp_tb = NULL;
    } else {
        tmp_type = (PyObject*) Py_TYPE(tmp_value);
        Py_INCREF(tmp_type);
        #if CYTHON_COMPILING_IN_CPYTHON
        tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
        Py_XINCREF(tmp_tb);
        #else
        tmp_tb = PyException_GetTraceback(tmp_value);
        #endif
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
  #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
  #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* HasAttr */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!PyUnicode_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_PyObject_GetAttrStrNoError(o, n);
    if (!r) {
        return (unlikely(PyErr_Occurred())) ? -1 : 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}
#endif

/* PyObjectVectorCallMethodKwBuilder */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
    PyObject *result;
    PyObject *obj = PyObject_GetAttr(args[0], name);
    if (unlikely(!obj))
        return NULL;
    result = __Pyx_Object_Vectorcall_CallFromBuilder(obj, args+1, nargsf-1, kwnames);
    Py_DECREF(obj);
    return result;
}
#endif

/* PyObjectLookupSpecial */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else if (with_error) {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#endif

/* ArgTypeTestFunc (used by ArgTypeTest) */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    __Pyx_TypeName type_name;
    __Pyx_TypeName obj_type_name;
    PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
    int from_annotation_subclass = 0;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (!exact) {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    } else if (exact == 2) {
        if (__Pyx_TypeCheck(obj, type)) {
            from_annotation_subclass = 1;
            extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
        }
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
        ", got " __Pyx_FMT_TYPENAME ")"
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        "%s%U"
#endif
        , name, type_name, obj_type_name
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        , (from_annotation_subclass ? ". " : ""), extra_info
#endif
        );
#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    if (exact == 2 && from_annotation_subclass) {
        PyObject *res;
        PyObject *vargs[2];
        vargs[0] = PyErr_GetRaisedException();
        vargs[1] = extra_info;
        res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
        Py_XDECREF(res);
        PyErr_SetRaisedException(vargs[0]);
    }
#endif
    __Pyx_DECREF_TypeName(type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* RaiseClosureNameError */
static void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* PyObjectCall2Args (used by PyObjectCallMethod1) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args[3] = {NULL, arg1, arg2};
    return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectGetMethod (used by PyObjectCallMethod1) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    __Pyx_TypeName type_name;
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(tp);
    PyErr_Format(PyExc_AttributeError,
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}
#endif

/* PyObjectCallMethod1 (used by append) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
#endif
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[2] = {obj, arg};
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_Call2Args;
    return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
#endif
}

/* append */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_mstate_global->__pyx_n_u_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* Py3UpdateBases */
static PyObject*
__Pyx_PEP560_update_bases(PyObject *bases)
{
    Py_ssize_t i, j, size_bases;
    PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL;
#if CYTHON_ASSUME_SAFE_SIZE
    size_bases = PyTuple_GET_SIZE(bases);
#else
    size_bases = PyTuple_Size(bases);
    if (size_bases < 0) return NULL;
#endif
    for (i = 0; i < size_bases; i++) {
#if CYTHON_AVOID_BORROWED_REFS
        Py_CLEAR(base);
#endif
#if CYTHON_ASSUME_SAFE_MACROS
        base = PyTuple_GET_ITEM(bases, i);
#else
        base = PyTuple_GetItem(bases, i);
        if (!base) goto error;
#endif
#if CYTHON_AVOID_BORROWED_REFS
        Py_INCREF(base);
#endif
        if (PyType_Check(base)) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries);
        if (!meth && PyErr_Occurred()) {
            goto error;
        }
        if (!meth) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        new_base = __Pyx_PyObject_CallOneArg(meth, bases);
        Py_DECREF(meth);
        if (!new_base) {
            goto error;
        }
        if (!PyTuple_Check(new_base)) {
            PyErr_SetString(PyExc_TypeError,
                            "__mro_entries__ must return a tuple");
            Py_DECREF(new_base);
            goto error;
        }
        if (!new_bases) {
            if (!(new_bases = PyList_New(i))) {
                goto error;
            }
            for (j = 0; j < i; j++) {
                PyObject *base_from_list;
#if CYTHON_ASSUME_SAFE_MACROS
                base_from_list = PyTuple_GET_ITEM(bases, j);
                PyList_SET_ITEM(new_bases, j, base_from_list);
                Py_INCREF(base_from_list);
#else
                base_from_list = PyTuple_GetItem(bases, j);
                if (!base_from_list) goto error;
                Py_INCREF(base_from_list);
                if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error;
#endif
            }
        }
#if CYTHON_ASSUME_SAFE_SIZE
        j = PyList_GET_SIZE(new_bases);
#else
        j = PyList_Size(new_bases);
        if (j < 0) goto error;
#endif
        if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
            goto error;
        }
        Py_DECREF(new_base);
    }
    if (!new_bases) {
        Py_INCREF(bases);
        return bases;
    }
    result = PyList_AsTuple(new_bases);
    Py_DECREF(new_bases);
#if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(base);
#endif
    return result;
error:
    Py_XDECREF(new_bases);
#if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(base);
#endif
    return NULL;
}

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases;
#if CYTHON_ASSUME_SAFE_SIZE
    nbases = PyTuple_GET_SIZE(bases);
#else
    nbases = PyTuple_Size(bases);
    if (nbases < 0) return NULL;
#endif
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
#if CYTHON_ASSUME_SAFE_MACROS
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *tmp = PyTuple_GetItem(bases, i);
        if (!tmp) return NULL;
#endif
        tmptype = Py_TYPE(tmp);
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
        metaclass = &PyType_Type;
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* Py3ClassCreate */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare);
        if (prep) {
            PyObject *pargs[3] = {NULL, name, bases};
            ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
            Py_DECREF(prep);
        } else {
            if (unlikely(PyErr_Occurred()))
                return NULL;
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result;
    PyObject *owned_metaclass = NULL;
    PyObject *margs[4] = {NULL, name, bases, dict};
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
    Py_XDECREF(owned_metaclass);
    return result;
}

/* dict_setdefault (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
    PyObject* value;
#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
    PyDict_SetDefaultRef(d, key, default_value, &value);
#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    PyObject *args[] = {d, key, default_value};
    value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#elif CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
#else
    value = PyDict_SetDefault(d, key, default_value);
    if (unlikely(!value)) return NULL;
    Py_INCREF(value);
#endif
    return value;
}

/* LimitedApiGetTypeDict (used by SetItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static Py_ssize_t __Pyx_GetTypeDictOffset(void) {
    PyObject *tp_dictoffset_o;
    Py_ssize_t tp_dictoffset;
    tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__");
    if (unlikely(!tp_dictoffset_o)) return -1;
    tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
    Py_DECREF(tp_dictoffset_o);
    if (unlikely(tp_dictoffset == 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' doesn't have a dictoffset");
        return -1;
    } else if (unlikely(tp_dictoffset < 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' has an unexpected negative dictoffset. "
            "Please report this as Cython bug");
        return -1;
    }
    return tp_dictoffset;
}
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
    static Py_ssize_t tp_dictoffset = 0;
    if (unlikely(tp_dictoffset == 0)) {
        tp_dictoffset = __Pyx_GetTypeDictOffset();
        if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
            tp_dictoffset = 0; // try again next time?
            return NULL;
        }
    }
    return *(PyObject**)((char*)tp + tp_dictoffset);
}
#endif

/* SetItemOnTypeDict (used by FixUpExtensionType) */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_SetItem(tp_dict, k, v);
    if (likely(!result)) {
        PyType_Modified(tp);
        if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
            PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name,  (PyObject *) tp, k, NULL);
            if (!setNameResult) return -1;
            Py_DECREF(setNameResult);
        }
    }
    return result;
}

/* FixUpExtensionType (used by FetchCommonType) */
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if __PYX_LIMITED_VERSION_HEX > 0x030900B1
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#else
    const PyType_Slot *slot = spec->slots;
    int changed = 0;
#if !CYTHON_COMPILING_IN_LIMITED_API
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
#if !CYTHON_COMPILING_IN_CPYTHON
        const
#endif  // !CYTHON_COMPILING_IN_CPYTHON)
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
                if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_weaklistoffset = memb->offset;
                    changed = 1;
                }
                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_dictoffset = memb->offset;
                    changed = 1;
                }
#if CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_vectorcall_offset = memb->offset;
                    changed = 1;
                }
#endif  // CYTHON_METH_FASTCALL
#if !CYTHON_COMPILING_IN_PYPY
                else if (strcmp(memb->name, "__module__") == 0) {
                    PyObject *descr;
                    assert(memb->type == T_OBJECT);
                    assert(memb->flags == 0 || memb->flags == READONLY);
                    descr = PyDescr_NewMember(type, memb);
                    if (unlikely(!descr))
                        return -1;
                    int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                    Py_DECREF(descr);
                    if (unlikely(set_item_result < 0)) {
                        return -1;
                    }
                    changed = 1;
                }
#endif  // !CYTHON_COMPILING_IN_PYPY
            }
            memb++;
        }
    }
#endif  // !CYTHON_COMPILING_IN_LIMITED_API
#if !CYTHON_COMPILING_IN_PYPY
    slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_getset)
        slot++;
    if (slot && slot->slot == Py_tp_getset) {
        PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc;
        while (getset && getset->name) {
            if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) {
                PyObject *descr = PyDescr_NewGetSet(type, getset);
                if (unlikely(!descr))
                    return -1;
                #if CYTHON_COMPILING_IN_LIMITED_API
                PyObject *pyname = PyUnicode_FromString(getset->name);
                if (unlikely(!pyname)) {
                    Py_DECREF(descr);
                    return -1;
                }
                int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr);
                Py_DECREF(pyname);
                #else
                CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
                int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                #endif
                Py_DECREF(descr);
                if (unlikely(set_item_result < 0)) {
                    return -1;
                }
                changed = 1;
            }
            ++getset;
        }
    }
#else
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#endif  // !CYTHON_COMPILING_IN_PYPY
    if (changed)
        PyType_Modified(type);
#endif  // PY_VERSION_HEX > 0x030900B1
    return 0;
}

/* AddModuleRef (used by FetchSharedCythonModule) */
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
      PyObject *module_dict = PyImport_GetModuleDict();
      PyObject *m;
      if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
          return NULL;
      }
      if (m != NULL && PyModule_Check(m)) {
          return m;
      }
      Py_XDECREF(m);
      m = PyModule_NewObject(name);
      if (m == NULL)
          return NULL;
      if (PyDict_CheckExact(module_dict)) {
          PyObject *new_m;
          (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
          Py_DECREF(m);
          return new_m;
      } else {
           if (PyObject_SetItem(module_dict, name, m) != 0) {
                Py_DECREF(m);
                return NULL;
            }
            return m;
      }
  }
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *py_name = PyUnicode_FromString(name);
      if (!py_name) return NULL;
      PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
      Py_DECREF(py_name);
      return module;
  }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#endif

/* FetchSharedCythonModule (used by FetchCommonType) */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
}

/* FetchCommonType (used by CommonTypesMetaclass) */
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
    if (result && metaclass) {
        PyObject *old_tp = (PyObject*)Py_TYPE(result);
    Py_INCREF((PyObject*)metaclass);
#if __PYX_LIMITED_VERSION_HEX >= 0x03090000
        Py_SET_TYPE(result, metaclass);
#else
        result->ob_type = metaclass;
#endif
        Py_DECREF(old_tp);
    }
    return result;
}
#else
#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
#endif
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t expected_basicsize) {
    Py_ssize_t basicsize;
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (expected_basicsize == 0) {
        return 0; // size is inherited, nothing useful to check
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
    if (unlikely(!py_basicsize)) return -1;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = NULL;
    if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
#else
    basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
#endif
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
    int get_item_ref_result;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    py_object_name = PyUnicode_FromString(object_name);
    if (!py_object_name) return NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) goto done;
    abi_module_dict = PyModule_GetDict(abi_module);
    if (!abi_module_dict) goto done;
    get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
    if (get_item_ref_result == 1) {
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else if (unlikely(get_item_ref_result == -1)) {
        goto bad;
    }
    cached_type = __Pyx_PyType_FromMetaclass(
        metaclass,
        CYTHON_USE_MODULE_STATE ? module : abi_module,
        spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
    new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
    if (unlikely(new_cached_type != cached_type)) {
        if (unlikely(!new_cached_type)) goto bad;
        Py_DECREF(cached_type);
        cached_type = new_cached_type;
        if (__Pyx_VerifyCachedType(
                cached_type,
                object_name,
                spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else {
        Py_DECREF(new_cached_type);
    }
done:
    Py_XDECREF(abi_module);
    Py_DECREF(py_object_name);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CommonTypesMetaclass (used by CythonFunctionShared) */
static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
    return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
}
#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
    PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types");
    return NULL;
}
static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
    PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable");
    return -1;
}
#endif
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
    {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
    {0, 0, 0, 0, 0}
};
static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
    {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
    #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
    {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call},
    {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call},
    {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr},
    #endif
    {0, 0}
};
static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
    __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
    0,
    0,
    Py_TPFLAGS_IMMUTABLETYPE |
    Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT,
    __pyx_CommonTypesMetaclass_slots
};
static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    PyObject *bases = PyTuple_Pack(1, &PyType_Type);
    if (unlikely(!bases)) {
        return -1;
    }
    mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
    Py_DECREF(bases);
    if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
        return -1;
    }
    return 0;
}

/* CallTypeTraverse (used by CythonFunctionShared) */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
    if (__Pyx_get_runtime_version() < 0x03090000) return 0;
    #endif
    if (!always_call) {
        PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
        unsigned long flags = PyType_GetFlags(base);
        if (flags & Py_TPFLAGS_HEAPTYPE) {
            return 0;
        }
    }
    Py_VISIT((PyObject*)Py_TYPE(o));
    return 0;
}
#endif

/* PyMethodNew (used by CythonFunctionShared) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    PyObject *result;
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    {
        PyObject *args[] = {func, self};
        result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
    }
    #else
    result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
    #endif
    return result;
}
#else
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    return PyMethod_New(func, self);
}
#endif

/* PyVectorcallFastCallDict (used by CythonFunctionShared) */
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    PyObject *res = NULL;
    PyObject *kwnames;
    PyObject **newargs;
    PyObject **kwvalues;
    Py_ssize_t i;
    #if CYTHON_AVOID_BORROWED_REFS
    PyObject *pos;
    #else
    Py_ssize_t pos;
    #endif
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    #if !CYTHON_ASSUME_SAFE_SIZE
    Py_ssize_t nkw = PyDict_Size(kw);
    if (unlikely(nkw == -1)) return NULL;
    #else
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    #endif
    newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
    if (unlikely(newargs == NULL)) {
        PyErr_NoMemory();
        return NULL;
    }
    for (j = 0; j < nargs; j++) newargs[j] = args[j];
    kwnames = PyTuple_New(nkw);
    if (unlikely(kwnames == NULL)) {
        PyMem_Free(newargs);
        return NULL;
    }
    kwvalues = newargs + nargs;
    pos = 0;
    i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
        keys_are_strings &=
        #if CYTHON_COMPILING_IN_LIMITED_API
            PyType_GetFlags(Py_TYPE(key));
        #else
            Py_TYPE(key)->tp_flags;
        #endif
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
        #else
        PyTuple_SET_ITEM(kwnames, i, key);
        #endif
        kwvalues[i] = value;
        i++;
    }
    if (unlikely(!keys_are_strings)) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        goto cleanup;
    }
    res = vc(func, newargs, nargs, kwnames);
cleanup:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(pos);
    #endif
    Py_DECREF(kwnames);
    for (i = 0; i < nkw; i++)
        Py_DECREF(kwvalues[i]);
    PyMem_Free(newargs);
    return res;
}
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    Py_ssize_t kw_size =
        likely(kw == NULL) ?
        0 :
#if !CYTHON_ASSUME_SAFE_SIZE
        PyDict_Size(kw);
#else
        PyDict_GET_SIZE(kw);
#endif
    if (kw_size == 0) {
        return vc(func, args, nargs, NULL);
    }
#if !CYTHON_ASSUME_SAFE_SIZE
    else if (unlikely(kw_size == -1)) {
        return NULL;
    }
#endif
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared (used by CythonFunction) */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
    if (__Pyx_CyFunction_Check(func)) {
        return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
    } else if (PyCFunction_Check(func)) {
        return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
        int result;
        PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
        if (unlikely(!newFunc)) {
            PyErr_Clear(); // It's only an optimization, so don't throw an error
            return 0;
        }
        result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
        Py_DECREF(newFunc);
        return result;
    }
    return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if (PyMethod_Check(func)) {
        func = PyMethod_GET_FUNCTION(func);
    }
    return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
}
#endif
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    __Pyx_Py_XDECREF_SET(
        __Pyx_CyFunction_GetClassObj(f),
            ((classobj) ? __Pyx_NewRef(classobj) : NULL));
#else
    __Pyx_Py_XDECREF_SET(
        ((PyCMethodObject *) (f))->mm_class,
        (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
#endif
}
static PyObject *
__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_doc == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
        if (unlikely(!op->func_doc)) return NULL;
#else
        if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
#endif
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) {
    PyObject *result;
    CYTHON_UNUSED_VAR(closure);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_doc_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_name = PyObject_GetAttrString(op->func, "__name__");
#else
        op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_name_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    PyObject *result;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    Py_INCREF(op->func_qualname);
    result = op->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
#endif
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_defaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_kwdefaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value || value == Py_None) {
        value = NULL;
    } else if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    __Pyx_END_CRITICAL_SECTION();
    if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists((PyObject*) op, Py_None) < 0)) return -1;
    return 0;
}
static int
__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
    /* Return 1 if the function dict exists, 0 otherwise.  This cannot fail:
     * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */
#if CYTHON_COMPILING_IN_PYPY
    *dict = PyObject_GenericGetDict(op_in, NULL);
#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
    *dict = ((__pyx_CyFunctionObject*) op_in)->func_dict;
#else
    PyObject **dictptr = _PyObject_GetDictPtr(op_in);
    *dict = likely(dictptr) ? *dictptr : NULL;
#endif
    return *dict ? 1 : 0;
}
static int
__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
    PyObject *dict;
    int dict_found;
    *annotate = NULL;
    dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
    if (!dict_found) return 0;
    return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
}
static int
__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
    PyObject *dict;
    int dict_found;
    dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
    if (!dict_found) return 0;
    return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
}
static int
__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
    PyObject *dict;
    int result;
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    dict = __Pyx_CyFunction_get_dict((__pyx_CyFunctionObject*) op_in, NULL);
#else
    dict = PyObject_GenericGetDict(op_in, NULL);
#endif
    if (unlikely(!dict)) return -1;
    result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
    Py_DECREF(dict);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_annotations(PyObject *op_in, void *context) {
    PyObject *annotate = NULL;
    PyObject *result = NULL;
    __pyx_CyFunctionObject *op = (__pyx_CyFunctionObject*) op_in;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    result = __Pyx_XNewRef(op->func_annotations);
    __Pyx_END_CRITICAL_SECTION();
    if (result) return result;
    if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
    if (!annotate || annotate == Py_None) {
        Py_XDECREF(annotate);
        __Pyx_BEGIN_CRITICAL_SECTION(op_in);
        result = __Pyx_CyFunction_get_annotations_locked(op);
        __Pyx_END_CRITICAL_SECTION();
        return result;
    }
    PyObject *format = PyLong_FromLong(1L);  // annotationlib.Format.VALUE
    if (likely(format)) {
        result = __Pyx_PyObject_CallOneArg(annotate, format);
        Py_DECREF(format);
    }
    Py_DECREF(annotate);
    if (unlikely(!result)) return NULL;
    if (unlikely(!PyDict_Check(result))) {
        PyErr_SetString(PyExc_TypeError, "__annotate__ must return a dict");
        Py_DECREF(result);
        return NULL;
    }
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *args) {
    CYTHON_UNUSED_VAR(args);
    if (unlikely(!self)) {
        PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument");
    }
    Py_XINCREF(self);
    return self;
}
static PyMethodDef __Pyx_CyFunction_annotate_method = {
    "__annotate__",
    (PyCFunction)(void (*)(void))__Pyx_CyFunction_annotate_impl,
    METH_VARARGS,
    "Placeholder __annotate__ function to allow 'functools.wraps' to work "
    "on Cython functions."
};
static PyObject *
__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) {
    PyObject *annotate = NULL;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
    if (annotate) return annotate;
    PyObject *annotations = __Pyx_CyFunction_get_annotations(op_in, NULL);
    if (unlikely(!annotations)) return NULL;
    PyObject *method = PyCFunction_New(
        &__Pyx_CyFunction_annotate_method,
        annotations);
    Py_DECREF(annotations);
    return method;
}
static int
__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted");
        return -1;
    }
    if (unlikely(value != Py_None && !PyCallable_Check(value))) {
        PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None");
        return -1;
    }
    if (value != Py_None) {
        __pyx_CyFunctionObject *op = (__pyx_CyFunctionObject*) op_in;
        __Pyx_BEGIN_CRITICAL_SECTION(op_in);
        Py_CLEAR(op->func_annotations);
        __Pyx_END_CRITICAL_SECTION();
    }
    return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
    int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
    if (is_coroutine) {
        PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
#if CYTHON_ASSUME_SAFE_MACROS
        PyList_SET_ITEM(fromlist, 0, marker);
#else
        if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
            Py_DECREF(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(is_coroutine_value)) {
            return is_coroutine_value;
        }
ignore:
        PyErr_Clear();
    }
    return __Pyx_PyBool_FromLong(is_coroutine);
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    PyObject *result;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    result = __Pyx_CyFunction_get_is_coroutine_value(op);
    if (unlikely(!result))
        return NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    if (op->func_is_coroutine) {
        Py_DECREF(result);
        result = __Pyx_NewRef(op->func_is_coroutine);
    } else {
        op->func_is_coroutine = __Pyx_NewRef(result);
    }
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        py_name, message, size);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        name, message, size);
#endif
}
static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s",
        py_name, message);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s",
        name, message);
#endif
}
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_GetAttrString(op->func, "__module__");
}
static int
__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_SetAttrString(op->func, "__module__", value);
}
#endif
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
    {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
#else
    {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
    {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
#endif
    {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
    {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
#if !CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#endif
#if CYTHON_METH_FASTCALL
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(args);
    __Pyx_BEGIN_CRITICAL_SECTION(m);
    Py_INCREF(m->func_qualname);
    result = m->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyCFunctionObject *cf = (PyCFunctionObject*) op;
#endif
    if (unlikely(op == NULL))
        return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
    if (unlikely(!op->func)) return NULL;
#endif
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
#if !CYTHON_COMPILING_IN_LIMITED_API
    cf->m_ml = ml;
    cf->m_self = (PyObject *) op;
#endif
    Py_XINCREF(closure);
    op->func_closure = closure;
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_XINCREF(module);
    cf->m_module = module;
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_dict = NULL;
#endif
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_classobj = NULL;
#else
    ((PyCMethodObject*)op)->mm_class = NULL;
#endif
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    op->func_is_coroutine = NULL;
#if CYTHON_METH_FASTCALL
    switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
    case METH_NOARGS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
        break;
    case METH_O:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
        break;
    case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
        break;
    case METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
        break;
    case METH_VARARGS | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = NULL;
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        Py_DECREF(op);
        return NULL;
    }
#endif
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func);
#else
    Py_CLEAR(((PyCFunctionObject*)m)->m_module);
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func_dict);
#elif PY_VERSION_HEX < 0x030d0000
    _PyObject_ClearManagedDict((PyObject*)m);
#else
    PyObject_ClearManagedDict((PyObject*)m);
#endif
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    Py_CLEAR(m->defaults);
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    __Pyx_PyHeapTypeObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    {
        int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg);
        if (e) return e;
    }
    Py_VISIT(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func);
#else
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func_dict);
#else
    {
        int e =
#if PY_VERSION_HEX < 0x030d0000
            _PyObject_VisitManagedDict
#else
            PyObject_VisitManagedDict
#endif
                ((PyObject*)m, visit, arg);
        if (e != 0) return e;
    }
#endif
    __Pyx_VISIT_CONST(m->func_name);
    __Pyx_VISIT_CONST(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    __Pyx_VISIT_CONST(m->func_code);
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_annotations);
    Py_VISIT(m->func_is_coroutine);
    Py_VISIT(m->defaults);
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
    PyObject *repr;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
    __Pyx_END_CRITICAL_SECTION();
    return repr;
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
    PyCFunction meth;
    int flags;
    meth = PyCFunction_GetFunction(f);
    if (unlikely(!meth)) return NULL;
    flags = PyCFunction_GetFlags(f);
    if (unlikely(flags < 0)) return NULL;
#else
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    int flags = f->m_ml->ml_flags;
#endif
    Py_ssize_t size;
    switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 0))
                return (*meth)(self, NULL);
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes no arguments", size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes exactly one argument", size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
    __Pyx_CyFunction_raise_type_error(
        (__pyx_CyFunctionObject*)func, "takes no keyword arguments");
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *self, *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
    if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
    self = ((PyCFunctionObject*)func)->m_self;
#endif
    result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
    return result;
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
        return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
#else
        (void) &__Pyx_PyVectorcall_FastCallDict;
        return PyVectorcall_Call(func, args, kw);
#endif
    }
#endif
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
#if CYTHON_ASSUME_SAFE_SIZE
        argc = PyTuple_GET_SIZE(args);
#else
        argc = PyTuple_Size(args);
        if (unlikely(argc < 0)) return NULL;
#endif
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
{
    int ret = 0;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        if (unlikely(nargs < 1)) {
            __Pyx_CyFunction_raise_type_error(
                cyfunc, "needs an argument");
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
        __Pyx_CyFunction_raise_type_error(
            cyfunc, "takes no keyword arguments");
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes no arguments", nargs);
        return NULL;
    }
    return meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes exactly one argument", nargs);
        return NULL;
    }
    return meth(self, args[0]);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    #if PY_VERSION_HEX < 0x030e00A6
    size_t nargs_value = (size_t) nargs;
    #else
    Py_ssize_t nargs_value = nargs;
    #endif
    return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
}
#endif
static PyType_Slot __pyx_CyFunctionType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
    {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
    {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
    {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
    {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
    {Py_tp_methods, (void *)__pyx_CyFunction_methods},
    {Py_tp_members, (void *)__pyx_CyFunction_members},
    {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
    {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
    {0, 0},
};
static PyType_Spec __pyx_CyFunctionType_spec = {
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if CYTHON_METH_FASTCALL
#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
    Py_TPFLAGS_HAVE_VECTORCALL |
#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
#endif // CYTHON_METH_FASTCALL
#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_TPFLAGS_MANAGED_DICT |
#endif
    Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
static int __pyx_CyFunction_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
        mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
    if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
    if (unlikely(!m->defaults))
        return NULL;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* SetItemInt */
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (unlikely(!j)) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared))) {
            Py_INCREF(v);
            return PyList_SetItem(o, n, v);
        } else if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
            PyObject* old;
            Py_INCREF(v);
            old = PyList_GET_ITEM(o, n);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 0;
        }
    } else
#endif
#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
    {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (!is_list && mm && mm->mp_ass_subscript) {
            int r;
            PyObject *key = PyLong_FromSsize_t(i);
            if (unlikely(!key)) return -1;
            r = mm->mp_ass_subscript(o, key, v);
            Py_DECREF(key);
            return r;
        }
        if (is_list || likely(sm && sm->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return sm->sq_ass_item(o, i, v);
        }
    }
#else
    if (is_list || !PyMapping_Check(o)) {
        return PySequence_SetItem(o, i, v);
    }
#endif
    (void)wraparound;
    (void)boundscheck;
    return __Pyx_SetItemInt_Generic(o, PyLong_FromSsize_t(i), v);
}

/* PyLongCompare */
static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        return 1;
    }
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        const digit* digits = __Pyx_PyLong_Digits(op1);
        if (intval == 0) {
            return (__Pyx_PyLong_IsZero(op1) == 1);
        } else if (intval < 0) {
            if (__Pyx_PyLong_IsNonNeg(op1))
                return 0;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                return 0;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        return (unequal == 0);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = __Pyx_PyFloat_AS_DOUBLE(op1);
        return ((double)a == (double)b);
    }
    return __Pyx_PyObject_IsTrueAndDecref(
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* ImportImpl (used by Import) */
static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
    PyObject *imported_module = PyImport_GetModule(qualname);
    if (unlikely(!imported_module)) {
        *module = NULL;
        if (PyErr_Occurred()) {
            return -1;
        }
        return 0;
    }
    *module = imported_module;
    return 1;
}
static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
    PyObject *imported_module;
    PyObject *top_level_package_name;
    Py_ssize_t i;
    int status, module_found;
    Py_ssize_t dot_index;
    module_found = __Pyx__Import_GetModule(qualname, &imported_module);
    if (unlikely(!module_found || module_found == -1)) {
        *module = NULL;
        return module_found;
    }
    if (imported_names) {
        for (i = 0; i < len_imported_names; i++) {
            PyObject *imported_name = imported_names[i];
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
            int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
#else
            int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
            if (unlikely(has_imported_attribute == -1)) goto error;
#endif
            if (!has_imported_attribute) {
                goto not_found;
            }
        }
        *module = imported_module;
        return 1;
    }
    dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
    if (dot_index == -1) {
        *module = imported_module;
        return 1;
    }
    if (unlikely(dot_index == -2)) goto error;
    top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
    if (unlikely(!top_level_package_name)) goto error;
    Py_DECREF(imported_module);
    status = __Pyx__Import_GetModule(top_level_package_name, module);
    Py_DECREF(top_level_package_name);
    return status;
error:
    Py_DECREF(imported_module);
    *module = NULL;
    return -1;
not_found:
    Py_DECREF(imported_module);
    *module = NULL;
    return 0;
}
static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *from_list = 0;
    int module_found;
    if (!qualname) {
        qualname = name;
    }
    module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
    if (likely(module_found == 1)) {
        return module;
    } else if (unlikely(module_found == -1)) {
        return NULL;
    }
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    if (imported_names) {
#if CYTHON_COMPILING_IN_CPYTHON
        from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
        if (unlikely(!from_list))
            goto bad;
#else
        from_list = PyList_New(len_imported_names);
        if (unlikely(!from_list)) goto bad;
        for (Py_ssize_t i=0; i<len_imported_names; ++i) {
            if (PyList_SetItem(from_list, i, __Pyx_NewRef(imported_names[i])) < 0) goto bad;
        }
#endif
    }
    if (level == -1) {
        const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
        if (package_sep != (0)) {
            module = PyImport_ImportModuleLevelObject(
                name, moddict, empty_dict, from_list, 1);
            if (unlikely(!module)) {
                if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
                    goto bad;
                PyErr_Clear();
            }
        }
        level = 0;
    }
    if (!module) {
        module = PyImport_ImportModuleLevelObject(
            name, moddict, empty_dict, from_list, level);
    }
bad:
    Py_XDECREF(from_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
    return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
}

/* PyLongCompare */
static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        return 0;
    }
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        const digit* digits = __Pyx_PyLong_Digits(op1);
        if (intval == 0) {
            return (__Pyx_PyLong_IsZero(op1) != 1);
        } else if (intval < 0) {
            if (__Pyx_PyLong_IsNonNeg(op1))
                return 1;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                return 1;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        return (unequal != 0);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = __Pyx_PyFloat_AS_DOUBLE(op1);
        return ((double)a != (double)b);
    }
    return __Pyx_PyObject_IsTrueAndDecref(
        PyObject_RichCompare(op1, op2, Py_NE));
}

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
                 expected, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        const char* module_name_str = 0;
        PyObject* module_name = 0;
        PyObject* module_dot = 0;
        PyObject* full_name = 0;
        PyErr_Clear();
        module_name_str = PyModule_GetName(module);
        if (unlikely(!module_name_str)) { goto modbad; }
        module_name = PyUnicode_FromString(module_name_str);
        if (unlikely(!module_name)) { goto modbad; }
        module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u_);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400) ||\
                CYTHON_COMPILING_IN_GRAAL
        {
            PyObject *modules = PyImport_GetModuleDict();
            if (unlikely(!modules))
                goto modbad;
            value = PyObject_GetItem(modules, full_name);
        }
        #else
        value = PyImport_GetModule(full_name);
        #endif
      modbad:
        Py_XDECREF(full_name);
        Py_XDECREF(module_dot);
        Py_XDECREF(module_name);
    }
    if (unlikely(!value)) {
        PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
    }
    return value;
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (unlikely(!j)) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static PyObject *__Pyx_GetItemInt_Generic_size(PyObject *o, Py_ssize_t i) {
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_AVOID_BORROWED_REFS
    CYTHON_UNUSED_VAR(boundscheck);
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        Py_ssize_t size = __Pyx_PyList_GET_SIZE(o);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(size < 0)) return NULL;
        #endif
        wrapped_i += size;
    }
    return __Pyx_PyList_GetItemRef(o, wrapped_i);
#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
    Py_ssize_t wrapped_i = i;
    Py_ssize_t size = (wraparound | boundscheck) ? PyList_GET_SIZE(o) : -1;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += size;
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
        return __Pyx_PyList_GET_ITEM_REF(o, wrapped_i, unsafe_shared);
    }
    return __Pyx_GetItemInt_Generic_size(o, i);
#else
    (void)wraparound;
    (void)boundscheck;
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_AVOID_BORROWED_REFS
    CYTHON_UNUSED_VAR(boundscheck);
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(o);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(size < 0)) return NULL;
        #endif
        wrapped_i += size;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_LIMITED_API
    return PySequence_ITEM(o, wrapped_i);
    #else
    if (unlikely(wrapped_i < 0)) {
        PyErr_SetString(PyExc_IndexError, "tuple index out of range");
        return NULL;
    }
    return PySequence_GetItem(o, wrapped_i);
    #endif
#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
    Py_ssize_t wrapped_i = i;
    Py_ssize_t size = (wraparound | boundscheck) ? PyTuple_GET_SIZE(o) : -1;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += size;
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
        return __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(o, wrapped_i));
    }
    return __Pyx_GetItemInt_Generic_size(o, i);
#else
    (void)wraparound;
    (void)boundscheck;
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        return boundscheck ? __Pyx_PyList_GetItemRef(o, n) : __Pyx_PyList_GET_ITEM_REF(o, n, unsafe_shared);
    } else
    #if !CYTHON_AVOID_BORROWED_REFS
    if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            return __Pyx_NewRef(PyTuple_GET_ITEM(o, n));
        }
    } else
    #endif
#else
    if ((!wraparound || i >= 0) & PyList_CheckExact(o)) {
        return boundscheck ? __Pyx_PyList_GetItemRef(o, i) : __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared);
    } else
#endif
#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
    {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (!is_list && mm && mm->mp_subscript) {
            PyObject *r, *key = PyLong_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (is_list || likely(sm && sm->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return sm->sq_item(o, i);
        }
    }
#else
    if (is_list || !PyMapping_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    (void)wraparound;
    (void)boundscheck;
    return __Pyx_GetItemInt_Generic_size(o, i);
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
    PyObject *runerr = NULL;
    Py_ssize_t key_value;
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(index));
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError,
            "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
        __Pyx_DECREF_TypeName(index_type_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
    __Pyx_TypeName obj_type_name;
    if (likely(PyType_Check(obj))) {
        #if __PYX_LIMITED_VERSION_HEX >= 0x03090000
        if ((PyTypeObject*)obj == &PyType_Type) {
            return Py_GenericAlias(obj, key);
        }
        #endif
        PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
        if (!meth) {
            PyErr_Clear();
        } else {
            PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
            Py_DECREF(meth);
            return result;
        }
    }
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
    PyTypeObject *tp = Py_TYPE(obj);
    PyMappingMethods *mm = tp->tp_as_mapping;
    PySequenceMethods *sm = tp->tp_as_sequence;
    if (likely(mm && mm->mp_subscript)) {
        return mm->mp_subscript(obj, key);
    }
    if (likely(sm && sm->sq_item)) {
        return __Pyx_PyObject_GetIndex(obj, key);
    }
    return __Pyx_PyObject_GetItem_Slow(obj, key);
}
#endif

/* RaiseUnboundLocalError */
static void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* pep479 */
static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) {
    PyObject *exc, *val, *tb, *cur_exc, *new_exc;
    __Pyx_PyThreadState_declare
    int is_async_stopiteration = 0;
    CYTHON_MAYBE_UNUSED_VAR(in_async_gen);
    __Pyx_PyThreadState_assign
    cur_exc = __Pyx_PyErr_CurrentExceptionType();
    if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) {
        if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopAsyncIteration))) {
            is_async_stopiteration = 1;
        } else {
            return;
        }
    }
    __Pyx_GetException(&exc, &val, &tb);
    Py_XDECREF(exc);
    Py_XDECREF(tb);
    new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s",
        is_async_stopiteration ? "async generator raised StopAsyncIteration" :
        in_async_gen ? "async generator raised StopIteration" :
        "generator raised StopIteration");
    if (!new_exc) {
        Py_XDECREF(val);
        return;
    }
    PyException_SetCause(new_exc, val); // steals ref to val
    PyErr_SetObject(PyExc_RuntimeError, new_exc);
    Py_DECREF(new_exc);
}

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (cls == a || cls == b) return 1;
    mro = cls->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            PyObject *base = PyTuple_GET_ITEM(mro, i);
            if (base == (PyObject *)a || base == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
}
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    if (max_char > 1114111) max_char = 1114111;
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_DATA(result_uval);
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
        goto overflow;
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = values[i];
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (__Pyx_PyUnicode_READY(uval) == (-1))
            goto bad;
        #endif
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(ulength < 0)) goto bad;
        #endif
        if (unlikely(!ulength))
            continue;
        if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (ukind == result_ukind) {
            memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if PY_VERSION_HEX >= 0x030d0000
            if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
            #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    Py_ssize_t i;
    PyObject *result = NULL;
    PyObject *value_tuple = PyTuple_New(value_count);
    if (unlikely(!value_tuple)) return NULL;
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    for (i=0; i<value_count; i++) {
        Py_INCREF(values[i]);
        if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0)) goto bad;
    }
    result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
bad:
    Py_DECREF(value_tuple);
    return result;
#endif
}

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op2);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } else {
        switch (size) {
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    calculate_long:
        {
            long x;
            x = a + b;
            return PyLong_FromLong(x);
        }
    calculate_long_long:
        {
            PY_LONG_LONG llx;
            llx = lla + llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) + (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace);
}
#endif

/* pybuiltin_invalid (used by pyint_simplify) */
static void __Pyx_PyBuiltin_Invalid(PyObject *obj, const char *type_name, const char *argname) {
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    if (argname) {
        PyErr_Format(PyExc_TypeError,
            "Argument '%.200s' has incorrect type (expected %.200s, got " __Pyx_FMT_TYPENAME ")",
            argname, type_name, obj_type_name
        );
    } else {
        PyErr_Format(PyExc_TypeError,
            "Expected %.200s, got " __Pyx_FMT_TYPENAME,
            type_name, obj_type_name
        );
    }
    __Pyx_DECREF_TypeName(obj_type_name);
}

/* pyint_simplify */
static CYTHON_INLINE int __Pyx_PyInt_FromNumber(PyObject **number_var, const char *argname, int accept_none) {
    PyObject *number = *number_var;
    if (likely((accept_none && number == Py_None) || PyLong_CheckExact(number))) {
        return 0;
    }
    PyObject *int_object;
    if (likely(PyNumber_Check(number))) {
        int_object = PyNumber_Long(number);
        if (unlikely(!int_object)) goto bad;
    } else {
        __Pyx_PyBuiltin_Invalid(number, "int", argname);
        goto bad;
    }
    *number_var = int_object;
    Py_DECREF(number);
    return 0;
bad:
    *number_var = NULL;
    Py_DECREF(number);
    return -1;
}

/* py_dict_keys */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_keys, d);
}

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return -1;
        __Pyx_PyErr_Clear();
        return 0;
    }
    return 0;
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    }
    return __Pyx_IterFinish();
}

/* RaiseException */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if PY_VERSION_HEX >= 0x030C00A6
        PyException_SetTraceback(value, tb);
#elif CYTHON_FAST_THREAD_STATE
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#else
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}

/* PyObjectCallNoArg (used by pyfrozenset_new) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg[2] = {NULL, NULL};
    return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* pyfrozenset_new (used by PySetContains) */
static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
    if (it) {
        PyObject* result;
#if CYTHON_COMPILING_IN_PYPY
        PyObject* args;
        args = PyTuple_Pack(1, it);
        if (unlikely(!args))
            return NULL;
        result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL);
        Py_DECREF(args);
        return result;
#else
        if (PyFrozenSet_CheckExact(it)) {
            Py_INCREF(it);
            return it;
        }
        result = PyFrozenSet_New(it);
        if (unlikely(!result))
            return NULL;
        if ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
#if CYTHON_COMPILING_IN_LIMITED_API
            || __Pyx_get_runtime_version() >= 0x030A0000
#endif
            )
            return result;
        {
            Py_ssize_t size = __Pyx_PySet_GET_SIZE(result);
            if (likely(size > 0))
                return result;
#if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely(size < 0)) {
                Py_DECREF(result);
                return NULL;
            }
#endif
        }
        Py_DECREF(result);
#endif
    }
    return __Pyx_PyObject_CallNoArg((PyObject*) &PyFrozenSet_Type);
}

/* PySetContains */
static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) {
    int result = -1;
    if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) {
        PyObject *tmpkey;
        PyErr_Clear();
        tmpkey = __Pyx_PyFrozenSet_New(key);
        if (tmpkey != NULL) {
            result = PySet_Contains(set, tmpkey);
            Py_DECREF(tmpkey);
        }
    }
    return result;
}
static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) {
    int result = PySet_Contains(set, key);
    if (unlikely(result < 0)) {
        result = __Pyx_PySet_ContainsUnhashable(set, key);
    }
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* CallUnboundCMethod1 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    int was_initialized =  __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return __Pyx_CallCFunction(cfunc, self, arg);
        } else if (flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, &arg, 1);
        } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, &arg, 1, NULL);
        }
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod1(&tmp_cfunc, self, arg);
    }
#endif
    PyObject* result = __Pyx__CallUnboundCMethod1(cfunc, self, arg);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        PyObject *args = PyTuple_New(1);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
    } else
#endif
    {
        result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg);
    }
    return result;
}

/* dict_getitem_default */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (unlikely(PyErr_Occurred()))
            return NULL;
        value = default_value;
    }
    Py_INCREF(value);
    if ((1));
#else
    if (PyBytes_CheckExact(key) || PyUnicode_CheckExact(key) || PyLong_CheckExact(key)) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            value = default_value;
        }
        Py_INCREF(value);
    }
#endif
    else {
        if (default_value == Py_None)
            value = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key);
        else
            value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key, default_value);
    }
    return value;
}

/* pybytes_as_double (used by pynumber_float) */
static double __Pyx_SlowPyString_AsDouble(PyObject *obj) {
    PyObject *float_value = PyFloat_FromString(obj);
    if (likely(float_value)) {
        double value = __Pyx_PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
    return (double)-1;
}
static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) {
    int last_was_punctuation = 1;
    int parse_error_found = 0;
    Py_ssize_t i;
    for (i=0; i < length; i++) {
        char chr = start[i];
        int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E');
        *buffer = chr;
        buffer += (chr != '_');
        parse_error_found |= last_was_punctuation & is_punctuation;
        last_was_punctuation = is_punctuation;
    }
    parse_error_found |= last_was_punctuation;
    *buffer = '\0';
    return unlikely(parse_error_found) ? NULL : buffer;
}
static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) {
    int matches = 1;
    char sign = start[0];
    int is_signed = (sign == '+') | (sign == '-');
    start += is_signed;
    length -= is_signed;
    switch (start[0]) {
        #ifdef Py_NAN
        case 'n':
        case 'N':
            if (unlikely(length != 3)) goto parse_failure;
            matches &= (start[1] == 'a' || start[1] == 'A');
            matches &= (start[2] == 'n' || start[2] == 'N');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_NAN : Py_NAN;
        #endif
        case 'i':
        case 'I':
            if (unlikely(length < 3)) goto parse_failure;
            matches &= (start[1] == 'n' || start[1] == 'N');
            matches &= (start[2] == 'f' || start[2] == 'F');
            if (likely(length == 3 && matches))
                return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
            if (unlikely(length != 8)) goto parse_failure;
            matches &= (start[3] == 'i' || start[3] == 'I');
            matches &= (start[4] == 'n' || start[4] == 'N');
            matches &= (start[5] == 'i' || start[5] == 'I');
            matches &= (start[6] == 't' || start[6] == 'T');
            matches &= (start[7] == 'y' || start[7] == 'Y');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
        case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
            break;
        default:
            goto parse_failure;
    }
    return 0.0;
parse_failure:
    return -1.0;
}
static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) {
    return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd));
}
CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) {
    double value;
    Py_ssize_t i, digits;
    const char *last = start + length;
    char *end;
    while (__Pyx__PyBytes_AsDouble_IsSpace(*start))
        start++;
    while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1]))
        last--;
    length = last - start;
    if (unlikely(length <= 0)) goto fallback;
    value = __Pyx__PyBytes_AsDouble_inf_nan(start, length);
    if (unlikely(value == -1.0)) goto fallback;
    if (value != 0.0) return value;
    digits = 0;
    for (i=0; i < length; digits += start[i++] != '_');
    if (likely(digits == length)) {
        value = PyOS_string_to_double(start, &end, NULL);
    } else if (digits < 40) {
        char number[40];
        last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
        if (unlikely(!last)) goto fallback;
        value = PyOS_string_to_double(number, &end, NULL);
    } else {
        char *number = (char*) PyMem_Malloc((digits + 1) * sizeof(char));
        if (unlikely(!number)) goto fallback;
        last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
        if (unlikely(!last)) {
            PyMem_Free(number);
            goto fallback;
        }
        value = PyOS_string_to_double(number, &end, NULL);
        PyMem_Free(number);
    }
    if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
        return value;
    }
fallback:
    return __Pyx_SlowPyString_AsDouble(obj);
}

/* pynumber_float */
static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj) {
    double val;
    if (PyLong_CheckExact(obj)) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (likely(__Pyx_PyLong_IsCompact(obj))) {
            val = (double) __Pyx_PyLong_CompactValue(obj);
            goto no_error;
        }
#endif
        val = PyLong_AsDouble(obj);
    } else if (PyUnicode_CheckExact(obj)) {
        val = __Pyx_PyUnicode_AsDouble(obj);
    } else if (PyBytes_CheckExact(obj)) {
        val = __Pyx_PyBytes_AsDouble(obj);
    } else if (PyByteArray_CheckExact(obj)) {
        val = __Pyx_PyByteArray_AsDouble(obj);
    } else {
        return PyNumber_Float(obj);
    }
    if (unlikely(val == -1 && PyErr_Occurred())) {
        return NULL;
    }
#if CYTHON_USE_PYLONG_INTERNALS
no_error:
#endif
    return PyFloat_FromDouble(val);
}

/* AllocateExtensionType */
static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) {
    if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
        allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc);
        return alloc_func(t, 0);
    } else {
        newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (!tp_new) {
            PyObject *new_str = PyUnicode_FromString("__new__");
            if (likely(new_str)) {
                PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL);
                Py_DECREF(new_str);
                return o;
            } else
                return NULL;
        } else
    #endif
        return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
    }
}

/* PyObjectCallMethod0 (used by PyType_Ready) */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[1] = {obj};
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_CallNoArg;
    return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
#endif
}

/* ValidateBasesTuple (used by PyType_Ready) */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
    Py_ssize_t i, n;
#if CYTHON_ASSUME_SAFE_SIZE
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (unlikely(n < 0)) return -1;
#endif
    for (i = 1; i < n; i++)
    {
        PyTypeObject *b;
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *b0 = PySequence_GetItem(bases, i);
        if (!b0) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        PyObject *b0 = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *b0 = PyTuple_GetItem(bases, i);
        if (!b0) return -1;
#endif
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
            PyErr_Format(PyExc_TypeError,
                "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
            __Pyx_DECREF_TypeName(b_name);
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
        if (dictoffset == 0)
        {
            Py_ssize_t b_dictoffset = 0;
#if CYTHON_USE_TYPE_SLOTS
            b_dictoffset = b->tp_dictoffset;
#else
            PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
            if (!py_b_dictoffset) goto dictoffset_return;
            b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
            Py_DECREF(py_b_dictoffset);
            if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
#endif
            if (b_dictoffset) {
                {
                    __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
                    PyErr_Format(PyExc_TypeError,
                        "extension type '%.200s' has no __dict__ slot, "
                        "but base type '" __Pyx_FMT_TYPENAME "' has: "
                        "either add 'cdef dict __dict__' to the extension type "
                        "or add '__slots__ = [...]' to the base type",
                        type_name, b_name);
                    __Pyx_DECREF_TypeName(b_name);
                }
#if !CYTHON_USE_TYPE_SLOTS
              dictoffset_return:
#endif
#if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(b0);
#endif
                return -1;
            }
        }
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b0);
#endif
    }
    return 0;
}
#endif

/* PyType_Ready */
CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
    while (t) {
        PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
        if (bases) {
            return 1;
        }
        t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
    }
    return 0;
}
static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || defined(PYSTON_MAJOR_VERSION)
    (void)__Pyx_PyObject_CallMethod0;
#if CYTHON_USE_TYPE_SPECS
    (void)__Pyx_validate_bases_tuple;
#endif
    return PyType_Ready(t);
#else
    int r;
    if (!__Pyx_PyType_HasMultipleInheritance(t)) {
        return PyType_Ready(t);
    }
    PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
    if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
        return -1;
#if !defined(PYSTON_MAJOR_VERSION)
    {
        int gc_was_enabled;
    #if PY_VERSION_HEX >= 0x030A00b1
        gc_was_enabled = PyGC_Disable();
        (void)__Pyx_PyObject_CallMethod0;
    #else
        PyObject *ret, *py_status;
        PyObject *gc = NULL;
        #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
                !CYTHON_COMPILING_IN_GRAAL
        gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
        if (unlikely(!py_status)) {
            Py_DECREF(gc);
            return -1;
        }
        gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
        Py_DECREF(py_status);
        if (gc_was_enabled > 0) {
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
            if (unlikely(!ret)) {
                Py_DECREF(gc);
                return -1;
            }
            Py_DECREF(ret);
        } else if (unlikely(gc_was_enabled == -1)) {
            Py_DECREF(gc);
            return -1;
        }
    #endif
        t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
#if PY_VERSION_HEX >= 0x030A0000
        t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
#endif
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if !defined(PYSTON_MAJOR_VERSION)
        t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
    #if PY_VERSION_HEX >= 0x030A00b1
        if (gc_was_enabled)
            PyGC_Enable();
    #else
        if (gc_was_enabled) {
            PyObject *tp, *v, *tb;
            PyErr_Fetch(&tp, &v, &tb);
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
            if (likely(ret || r == -1)) {
                Py_XDECREF(ret);
                PyErr_Restore(tp, v, tb);
            } else {
                Py_XDECREF(tp);
                Py_XDECREF(v);
                Py_XDECREF(tb);
                r = -1;
            }
        }
        Py_DECREF(gc);
    #endif
    }
#endif
    return r;
#endif
}

/* CLineInTraceback (used by AddTraceback) */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
#else
PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
    PyObject **dict_ptr = _PyObject_GetDictPtr(o);
    return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
}
#endif
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline = NULL;
    PyObject *ptype, *pvalue, *ptraceback;
    PyObject *cython_runtime_dict;
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
    cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, cython_runtime_dict,
            __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
    }
    if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    Py_XDECREF(use_cline);
    Py_XDECREF(cython_runtime_dict);
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache (used by AddTraceback) */
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
    __Pyx_CachedCodeObjectType* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
    if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = code_cache->entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__find_code_object;
    return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
    if (old_count < 0) {
        __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
        return NULL;
    }
#endif
    __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
#endif
    return result;
#endif
}
static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
{
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            code_cache->entries = entries;
            code_cache->max_count = 64;
            code_cache->count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
    if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
        __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_INCREF(code_object);
        Py_DECREF(tmp);
        return;
    }
    if (code_cache->count == code_cache->max_count) {
        int new_max = code_cache->max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        code_cache->entries = entries;
        code_cache->max_count = new_max;
    }
    for (i=code_cache->count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    code_cache->count++;
    Py_INCREF(code_object);
}
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__insert_code_object;
    return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type expected = 0;
    if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
        return;
    }
#endif
    __pyx__insert_code_object(code_cache, code_line, code_object);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
#endif
#endif
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
    PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
    PyObject *exc_type, *exc_value, *exc_traceback;
    int success = 0;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!code_object) {
        code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
        if (unlikely(!code_object)) goto bad;
        py_py_line = PyLong_FromLong(py_line);
        if (unlikely(!py_py_line)) goto bad;
        if (c_line) {
            py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        } else {
            py_funcname = PyUnicode_FromString(funcname);
        }
        if (unlikely(!py_funcname)) goto bad;
        dict = PyDict_New();
        if (unlikely(!dict)) goto bad;
        {
            PyObject *old_code_object = code_object;
            code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
            Py_DECREF(old_code_object);
        }
        if (unlikely(!code_object)) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
    } else {
        dict = PyDict_New();
    }
    getframe = PySys_GetObject("_getframe");
    if (unlikely(!getframe)) goto bad;
    if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
    frame = PyEval_EvalCode(code_object, dict, dict);
    if (unlikely(!frame) || frame == Py_None) goto bad;
    success = 1;
  bad:
    PyErr_Restore(exc_type, exc_value, exc_traceback);
    Py_XDECREF(code_object);
    Py_XDECREF(py_py_line);
    Py_XDECREF(py_funcname);
    Py_XDECREF(dict);
    Py_XDECREF(replace);
    if (success) {
        PyTraceBack_Here(
            (struct _frame*)frame);
    }
    Py_XDECREF(frame);
}
#else
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = NULL;
    PyObject *py_funcname = NULL;
    if (c_line) {
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
    }
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    Py_XDECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject *ptype, *pvalue, *ptraceback;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_mstate_global->__pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
#endif

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* FormatTypeName */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
static __Pyx_TypeName
__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
{
    PyObject *module = NULL, *name = NULL, *result = NULL;
    #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
    name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_qualname);
    #else
    name = PyType_GetQualName(tp);
    #endif
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
    module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_module);
    if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
    if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
        result = name;
        name = NULL;
        goto done;
    }
    result = PyUnicode_FromFormat("%U.%U", module, name);
    if (unlikely(result == NULL)) goto bad;
  done:
    Py_XDECREF(name);
    Py_XDECREF(module);
    return result;
  bad:
    PyErr_Clear();
    if (name) {
        result = name;
        name = NULL;
    } else {
        result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__6);
    }
    goto done;
}
#endif

/* CIntFromPyVerify (used by CIntFromPy) */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyLong_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (long) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(long) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
        } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(long) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
        } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        long val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (long) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (long) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (long) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (long) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((long) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((long) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (long) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyLong_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (int) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(int) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
        } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(int) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
        } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        int val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* GetRuntimeVersion */
#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
void __Pyx_init_runtime_version(void) {
    if (__Pyx_cached_runtime_version == 0) {
        const char* rt_version = Py_GetVersion();
        unsigned long version = 0;
        unsigned long factor = 0x01000000UL;
        unsigned int digit = 0;
        int i = 0;
        while (factor) {
            while ('0' <= rt_version[i] && rt_version[i] <= '9') {
                digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
                ++i;
            }
            version += factor * digit;
            if (rt_version[i] != '.')
                break;
            digit = 0;
            factor >>= 8;
            ++i;
        }
        __Pyx_cached_runtime_version = version;
    }
}
#endif
static unsigned long __Pyx_get_runtime_version(void) {
#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    return Py_Version & ~0xFFUL;
#else
    return __Pyx_cached_runtime_version;
#endif
}

/* IterNextPlain (used by CoroutineBase) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void) {
    if (unlikely(!__pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache))
        __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next);
    return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) {
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    PyObject *result;
    PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI();
    if (unlikely(!next)) return NULL;
    result = PyObject_CallFunctionObjArgs(next, iterator, NULL);
    return result;
#else
    (void)__Pyx_GetBuiltinName; // only for early limited API
    iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator);
    assert(iternext);
    return iternext(iterator);
#endif
}

/* ReturnWithStopIteration (used by CoroutineBase) */
static void __Pyx__ReturnWithStopIteration(PyObject* value, int async);
static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) {
    if (value == Py_None) {
        if (async || !iternext)
            PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration);
        return;
    }
    __Pyx__ReturnWithStopIteration(value, async);
}
static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) {
#if CYTHON_COMPILING_IN_CPYTHON
    __Pyx_PyThreadState_declare
#endif
    PyObject *exc;
    PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration;
#if CYTHON_COMPILING_IN_CPYTHON
    if ((PY_VERSION_HEX >= (0x030C00A6)) || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) {
        if (PY_VERSION_HEX >= (0x030e00A1)) {
            exc = __Pyx_PyObject_CallOneArg(exc_type, value);
        } else {
            PyObject *args_tuple = PyTuple_New(1);
            if (unlikely(!args_tuple)) return;
            Py_INCREF(value);
            PyTuple_SET_ITEM(args_tuple, 0, value);
            exc = PyObject_Call(exc_type, args_tuple, NULL);
            Py_DECREF(args_tuple);
        }
        if (unlikely(!exc)) return;
    } else {
        Py_INCREF(value);
        exc = value;
    }
    #if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    #if CYTHON_USE_EXC_INFO_STACK
    if (!__pyx_tstate->exc_info->exc_value)
    #else
    if (!__pyx_tstate->exc_type)
    #endif
    {
        Py_INCREF(exc_type);
        __Pyx_ErrRestore(exc_type, exc, NULL);
        return;
    }
    #endif
#else
    exc = __Pyx_PyObject_CallOneArg(exc_type, value);
    if (unlikely(!exc)) return;
#endif
    PyErr_SetObject(exc_type, exc);
    Py_DECREF(exc);
}

/* CoroutineBase (used by Generator) */
#if !CYTHON_COMPILING_IN_LIMITED_API
#include <frameobject.h>
#if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#endif // CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE void
__Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) {
#if CYTHON_USE_AM_SEND
    gen->yieldfrom_am_send = NULL;
#endif
    Py_CLEAR(gen->yieldfrom);
}
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    CYTHON_UNUSED_VAR(__pyx_tstate);
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
        else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) {
            #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
            value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value);
            if (unlikely(!value)) goto limited_api_failure;
            #else
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            #endif
            Py_DECREF(ev);
        }
        else if (unlikely(PyTuple_Check(ev))) {
            Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely(tuple_size < 0)) {
                Py_XDECREF(tb);
                Py_DECREF(ev);
                Py_DECREF(et);
                return -1;
            }
            #endif
            if (tuple_size >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#elif CYTHON_ASSUME_SAFE_MACROS
                value = PySequence_ITEM(ev, 0);
#else
                value = PySequence_GetItem(ev, 0);
                if (!value) goto limited_api_failure;
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value);
#else
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
#endif
    Py_DECREF(ev);
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!value)) return -1;
#endif
    *pvalue = value;
    return 0;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS
  limited_api_failure:
    Py_XDECREF(et);
    Py_XDECREF(tb);
    Py_XDECREF(ev);
    return -1;
#endif
}
static CYTHON_INLINE
__Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) {
    if (*retval) {
        return PYGEN_NEXT;
    } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) {
        return PYGEN_RETURN;
    } else {
        return PYGEN_ERROR;
    }
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_CLEAR(exc_state->exc_value);
#else
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
#endif
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) {
    const char *msg;
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
static void __Pyx_Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    CYTHON_MAYBE_UNUSED_VAR(closing);
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
__Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(__Pyx_Coroutine_get_is_running(self));  // Callers should ensure is_running
    if (unlikely(self->resume_label == -1)) {
        __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
        return PYGEN_ERROR;
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_value) {
        #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        #else
        PyObject *exc_tb;
        #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
        exc_tb = PyException_GetTraceback(exc_state->exc_value);
        #elif PY_VERSION_HEX >= 0x030B00a4
        exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback;
        #else
        exc_tb = exc_state->exc_traceback;
        #endif
        if (exc_tb) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
            PyFrameObject *f = tb->tb_frame;
            assert(f->f_back == NULL);
            #if PY_VERSION_HEX >= 0x030B00A1
            f->f_back = PyThreadState_GetFrame(tstate);
            #else
            Py_XINCREF(tstate->frame);
            f->f_back = tstate->frame;
            #endif
            #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
            Py_DECREF(exc_tb);
            #endif
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    retval = self->body(self, tstate, value);
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    *result = retval;
    if (self->resume_label == -1) {
        return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR;
    }
    return PYGEN_NEXT;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED_VAR(exc_state);
#else
    PyObject *exc_tb;
    #if PY_VERSION_HEX >= 0x030B00a4
    if (!exc_state->exc_value) return;
    exc_tb = PyException_GetTraceback(exc_state->exc_value);
    #else
    exc_tb = exc_state->exc_traceback;
    #endif
    if (likely(exc_tb)) {
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
        #if PY_VERSION_HEX >= 0x030B00a4
        Py_DECREF(exc_tb);
        #endif
    }
#endif
}
#define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval, iternext)\
    ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval, iternext))
static PyObject *
__Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval, int iternext) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if (likely(result == PYGEN_RETURN)) {
        int is_async = 0;
        #ifdef __Pyx_AsyncGen_USED
        is_async = __Pyx_AsyncGen_CheckExact(gen);
        #endif
        __Pyx_ReturnWithStopIteration(retval, is_async, iternext);
        Py_XDECREF(retval);
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE
PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
#if PY_VERSION_HEX <= 0x030A00A1
    return _PyGen_Send(gen, arg);
#else
    PyObject *result;
    if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
        if (PyAsyncGen_CheckExact(gen)) {
            assert(result == Py_None);
            PyErr_SetNone(PyExc_StopAsyncIteration);
        }
        else if (result == Py_None) {
            PyErr_SetNone(PyExc_StopIteration);
        }
        else {
#if PY_VERSION_HEX < 0x030d00A1
            _PyGen_SetStopIterationValue(result);
#else
            if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) {
                PyErr_SetObject(PyExc_StopIteration, result);
            } else {
                PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result);
                if (likely(exc != NULL)) {
                    PyErr_SetObject(PyExc_StopIteration, exc);
                    Py_DECREF(exc);
                }
            }
#endif
        }
        Py_DECREF(result);
        result = NULL;
    }
    return result;
#endif
}
#endif
static CYTHON_INLINE __Pyx_PySendResult
__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) {
    __Pyx_PySendResult result;
    PyObject *val = NULL;
    assert(__Pyx_Coroutine_get_is_running(gen));
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    result = __Pyx_Coroutine_SendEx(gen, val, retval, 0);
    Py_XDECREF(val);
    return result;
}
#if CYTHON_USE_AM_SEND
static __Pyx_PySendResult
__Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) {
    PyObject *ret = NULL;
    __Pyx_PySendResult delegate_result, result;
    assert(__Pyx_Coroutine_get_is_running(gen));
    delegate_result = gen_am_send(gen->yieldfrom, value, &ret);
    if (delegate_result == PYGEN_NEXT) {
        assert (ret != NULL);
        *retval = ret;
        return PYGEN_NEXT;
    }
    assert (delegate_result != PYGEN_ERROR || ret == NULL);
    __Pyx_Coroutine_Undelegate(gen);
    result = __Pyx_Coroutine_SendEx(gen, ret, retval, 0);
    Py_XDECREF(ret);
    return result;
}
#endif
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval = NULL;
    __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval);
    return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0);
}
static __Pyx_PySendResult
__Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) {
    __Pyx_PySendResult result;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        *retval = __Pyx_Coroutine_AlreadyRunningError(gen);
        return PYGEN_ERROR;
    }
    #if CYTHON_USE_AM_SEND
    if (gen->yieldfrom_am_send) {
        result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval);
    } else
    #endif
    if (gen->yieldfrom) {
        PyObject *yf = gen->yieldfrom;
        PyObject *ret;
      #if !CYTHON_USE_AM_SEND
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        if (PyCoro_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
      #endif
        {
            #if !CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x03080000
            if (value == Py_None && PyIter_Check(yf))
                ret = __Pyx_PyIter_Next_Plain(yf);
            else
            #endif
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value);
        }
        if (likely(ret)) {
            __Pyx_Coroutine_unset_is_running(gen);
            *retval = ret;
            return PYGEN_NEXT;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, retval);
    } else {
        result = __Pyx_Coroutine_SendEx(gen, value, retval, 0);
    }
    __Pyx_Coroutine_unset_is_running(gen);
    return result;
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    __Pyx_PySendResult result;
    PyObject *retval = NULL;
    CYTHON_UNUSED_VAR(gen);
    assert(__Pyx_Coroutine_get_is_running(gen));
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        result = __Pyx_Coroutine_Close(yf, &retval);
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        result = __Pyx_Coroutine_Close(yf, &retval);
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
        result = PYGEN_RETURN;
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
        result = PYGEN_RETURN;
    } else
    #endif
    {
        PyObject *meth;
        result = PYGEN_RETURN;
        meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close);
        if (unlikely(!meth)) {
            if (unlikely(PyErr_Occurred())) {
                PyErr_WriteUnraisable(yf);
            }
        } else {
            retval = __Pyx_PyObject_CallNoArg(meth);
            Py_DECREF(meth);
            if (unlikely(!retval)) {
                result = PYGEN_ERROR;
            }
        }
    }
    Py_XDECREF(retval);
    return result == PYGEN_ERROR ? -1 : 0;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __Pyx_PySendResult result;
    PyObject *retval = NULL;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    }
    #if CYTHON_USE_AM_SEND
    if (gen->yieldfrom_am_send) {
        result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval);
    } else
    #endif
    if (gen->yieldfrom) {
        PyObject *yf = gen->yieldfrom;
        PyObject *ret;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
            ret = __Pyx_PyIter_Next_Plain(yf);
        if (likely(ret)) {
            __Pyx_Coroutine_unset_is_running(gen);
            return ret;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, &retval);
    } else {
        result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0);
    }
    __Pyx_Coroutine_unset_is_running(gen);
    return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 1);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) {
    PyObject *retval = NULL;
    __Pyx_PySendResult result;
    CYTHON_UNUSED_VAR(arg);
    result = __Pyx_Coroutine_Close(self, &retval);
    if (unlikely(result == PYGEN_ERROR))
        return NULL;
    Py_XDECREF(retval);
    Py_RETURN_NONE;
}
static __Pyx_PySendResult
__Pyx_Coroutine_Close(PyObject *self, PyObject **retval) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PySendResult result;
    PyObject *yf;
    int err = 0;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        *retval = __Pyx_Coroutine_AlreadyRunningError(gen);
        return PYGEN_ERROR;
    }
    yf = gen->yieldfrom;
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1);
    if (result == PYGEN_ERROR) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_Coroutine_unset_is_running(gen);
        if (!__Pyx_PyErr_Occurred()) {
            return PYGEN_RETURN;
        } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) {
            __Pyx_PyErr_Clear();
            return PYGEN_RETURN;
        }
        return PYGEN_ERROR;
    } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) {
        __Pyx_Coroutine_unset_is_running(gen);
        return PYGEN_RETURN;
    } else {
        const char *msg;
        Py_DECREF(*retval);
        *retval = NULL;
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
            msg = "async generator ignored GeneratorExit";
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        __Pyx_Coroutine_unset_is_running(gen);
        return PYGEN_ERROR;
    }
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen)))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    yf = gen->yieldfrom;
    if (yf) {
        __Pyx_PySendResult result;
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                goto propagate_exception;
            goto throw_here;
        }
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (unlikely(PyErr_Occurred())) {
                    __Pyx_Coroutine_unset_is_running(gen);
                    return NULL;
                }
                __Pyx_Coroutine_Undelegate(gen);
                goto throw_here;
            }
            if (likely(args)) {
                ret = __Pyx_PyObject_Call(meth, args, NULL);
            } else {
                PyObject *cargs[4] = {NULL, typ, val, tb};
                size_t nargs = 1U + (val != NULL) + (tb != NULL);
                ret = __Pyx_PyObject_FastCall(meth, cargs+1, nargs | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
            }
            Py_DECREF(meth);
        }
        Py_DECREF(yf);
        if (ret) {
            __Pyx_Coroutine_unset_is_running(gen);
            return ret;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, &ret);
        __Pyx_Coroutine_unset_is_running(gen);
        return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret, 0);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
propagate_exception:
    {
        PyObject *retval = NULL;
        __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0);
        __Pyx_Coroutine_unset_is_running(gen);
        return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0);
    }
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (unlikely(!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb)))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_VISIT(exc_state->exc_value);
#else
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
#endif
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    {
        int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg);
        if (e) return e;
    }
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_frame);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    if (gen->gi_weakreflist != NULL)
    #endif
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if CYTHON_USE_TP_FINALIZE
        if (unlikely(PyObject_CallFinalizerFromDealloc(self)))
#else
        {
            destructor del = __Pyx_PyObject_GetSlot(gen, tp_del, destructor);
            if (del) del(self);
        }
        if (unlikely(Py_REFCNT(self) > 0))
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    __Pyx_PyHeapTypeObject_GC_Del(gen);
}
#if CYTHON_USE_TP_FINALIZE
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *retval = NULL;
        __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval);
        if (result == PYGEN_ERROR) {
            PyErr_WriteUnraisable(self);
        } else {
            Py_XDECREF(retval);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
}
#endif
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_name;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_name, value);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_qualname;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_qualname, value);
    return 0;
}
#if !CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx__Coroutine_get_frame_locked(__pyx_CoroutineObject *self) {
    PyObject *frame;
    frame = self->gi_frame;
    if (!frame) {
        if (unlikely(!self->gi_code)) {
            Py_RETURN_NONE;
        }
        PyObject *globals = PyDict_New();
        if (unlikely(!globals)) return NULL;
        frame = (PyObject *) PyFrame_New(
            PyThreadState_Get(),            /*PyThreadState *tstate,*/
            (PyCodeObject*) self->gi_code,  /*PyCodeObject *code,*/
            globals,                        /*PyObject *globals,*/
            0                               /*PyObject *locals*/
        );
        Py_DECREF(globals);
        if (unlikely(!frame))
            return NULL;
        if (unlikely(self->gi_frame)) {
            Py_DECREF(frame);
            frame = self->gi_frame;
        } else {
            self->gi_frame = frame;
        }
    }
    Py_INCREF(frame);
    return frame;
}
#endif
static PyObject *
__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self)
{
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyObject *frame;
    __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)self);
    frame = __Pyx__Coroutine_get_frame_locked(self);
    __Pyx_END_CRITICAL_SECTION();
    return frame;
#else
    CYTHON_UNUSED_VAR(self);
    Py_RETURN_NONE;
#endif
}
static PyObject *
__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) {
    CYTHON_UNUSED_VAR(context);
    PyObject *frame = self->gi_frame;
    if (frame)
        return __Pyx_NewRef(frame);
    return __Pyx__Coroutine_get_frame(self);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->yieldfrom_am_send = NULL;
    #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API
    gen->gi_exc_state.exc_value = NULL;
    #else
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
    #endif
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    gen->gi_weakreflist = NULL;
#endif
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    gen->gi_frame = NULL;
#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE)
    memset(gen->__pyx_pymonitoring_state, 0, sizeof(gen->__pyx_pymonitoring_state));
    gen->__pyx_pymonitoring_version = 0;
#endif
    PyObject_GC_Track(gen);
    return gen;
}
static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen) {
    char result;
    __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen);
    result = gen->is_running;
    gen->is_running = 1;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen) {
    __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen);
    assert(gen->is_running);
    gen->is_running = 0;
    __Pyx_END_CRITICAL_SECTION();
}
static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen) {
    char result;
    __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen);
    result = gen->is_running;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) {
    CYTHON_UNUSED_VAR(closure);
    char result = __Pyx_Coroutine_get_is_running((__pyx_CoroutineObject*)gen);
    if (result) Py_RETURN_TRUE;
    else Py_RETURN_FALSE;
}
#if __PYX_HAS_PY_AM_SEND == 2
static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send) {
    Py_ssize_t ptr_offset = (char*)(type->tp_as_async) - (char*)type;
    if (ptr_offset < 0 || ptr_offset > type->tp_basicsize) {
        return;
    }
    memcpy((void*)static_amsend_methods, (void*)(type->tp_as_async), sizeof(*type->tp_as_async));
    static_amsend_methods->am_send = am_send;
    type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods);
}
#endif
static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg) {
    CYTHON_UNUSED_VAR(arg);
    __Pyx_TypeName self_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE((PyObject*)self));
    PyErr_Format(PyExc_TypeError, "cannot pickle '" __Pyx_FMT_TYPENAME "' object",
                         self_type_name);
    __Pyx_DECREF_TypeName(self_type_name);
    return NULL;
}

/* Generator */
static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0},
    {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     PyDoc_STR("object being iterated by 'yield from', or None")},
    {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0},
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     PyDoc_STR("name of the generator"), 0},
    {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     PyDoc_STR("qualified name of the generator"), 0},
    {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
     PyDoc_STR("Frame of the generator"), 0},
    {"gi_running", __Pyx_Coroutine_get_is_running_getter, NULL, NULL, NULL},
    {0, 0, 0, 0, 0}
};
static PyType_Slot __pyx_GeneratorType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc},
    {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse},
    {Py_tp_iter, (void *)PyObject_SelfIter},
    {Py_tp_iternext, (void *)__Pyx_Generator_Next},
    {Py_tp_methods, (void *)__pyx_Generator_methods},
    {Py_tp_members, (void *)__pyx_Generator_memberlist},
    {Py_tp_getset, (void *)__pyx_Generator_getsets},
    {Py_tp_getattro, (void *) PyObject_GenericGetAttr},
#if CYTHON_USE_TP_FINALIZE
    {Py_tp_finalize, (void *)__Pyx_Coroutine_del},
#endif
#if __PYX_HAS_PY_AM_SEND == 1
    {Py_am_send, (void *)__Pyx_Coroutine_AmSend},
#endif
    {0, 0},
};
static PyType_Spec __pyx_GeneratorType_spec = {
    __PYX_TYPE_MODULE_PREFIX "generator",
    sizeof(__pyx_CoroutineObject),
    0,
#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_TPFLAGS_MANAGED_WEAKREF |
#endif
    Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | __Pyx_TPFLAGS_HAVE_AM_SEND,
    __pyx_GeneratorType_slots
};
#if __PYX_HAS_PY_AM_SEND == 2
static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async;
#endif
static int __pyx_Generator_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(
        mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_GeneratorType_spec, NULL);
    if (unlikely(!mstate->__pyx_GeneratorType)) {
        return -1;
    }
#if __PYX_HAS_PY_AM_SEND == 2
    __Pyx_SetBackportTypeAmSend(mstate->__pyx_GeneratorType, &__pyx_Generator_as_async, &__Pyx_Coroutine_AmSend);
#endif
    return 0;
}
static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *retval = NULL;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    }
    __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0);
    __Pyx_Coroutine_unset_is_running(gen);
    (void) result;
    assert (result == PYGEN_RETURN || result == PYGEN_ERROR);
    assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL));
    return retval;
}

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
    const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
    if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
        return 0;
    if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
        return 1;
    {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compile time Python version %d.%d "
                      "of module '%.100s' "
                      "%s "
                      "runtime version %d.%d",
                       (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
                       __Pyx_MODULE_NAME,
                       (allow_newer) ? "was newer than" : "does not match",
                       (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
       );
        return PyErr_WarnEx(NULL, message, 1);
    }
}

/* NewCodeObj */
#if CYTHON_COMPILING_IN_LIMITED_API
    static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                       PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                       PyObject *fv, PyObject *cell, PyObject* fn,
                                       PyObject *name, int fline, PyObject *lnos) {
        PyObject *exception_table = NULL;
        PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
        #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
        PyObject *version_info;
        PyObject *py_minor_version = NULL;
        #endif
        long minor_version = 0;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
        minor_version = 11;
        #else
        if (!(version_info = PySys_GetObject("version_info"))) goto end;
        if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
        minor_version = PyLong_AsLong(py_minor_version);
        Py_DECREF(py_minor_version);
        if (minor_version == -1 && PyErr_Occurred()) goto end;
        #endif
        if (!(types_module = PyImport_ImportModule("types"))) goto end;
        if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
        if (minor_version <= 7) {
            (void)p;
            result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOOO", a, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else if (minor_version <= 10) {
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else {
            if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
        }
    end:
        Py_XDECREF(code_type);
        Py_XDECREF(exception_table);
        Py_XDECREF(types_module);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return result;
    }
#elif PY_VERSION_HEX >= 0x030B0000
  static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                         PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                         PyObject *fv, PyObject *cell, PyObject* fn,
                                         PyObject *name, int fline, PyObject *lnos) {
    PyCodeObject *result;
    result =
      #if PY_VERSION_HEX >= 0x030C0000
        PyUnstable_Code_NewWithPosOnlyArgs
      #else
        PyCode_NewWithPosOnlyArgs
      #endif
        (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
    if (likely(result))
        result->_co_firsttraceable = 0;
    #endif
    return result;
  }
#elif !CYTHON_COMPILING_IN_PYPY
  #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        PyObject *line_table,
        PyObject *tuple_dedup_map
) {
    PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
    Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
    PyObject *varnames_tuple = PyTuple_New(var_count);
    if (unlikely(!varnames_tuple)) return NULL;
    for (Py_ssize_t i=0; i < var_count; i++) {
        Py_INCREF(varnames[i]);
        if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
    }
    #if CYTHON_COMPILING_IN_LIMITED_API
    varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
    if (!varnames_tuple_dedup) {
        if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
        varnames_tuple_dedup = varnames_tuple;
    }
    #else
    varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
    if (unlikely(!varnames_tuple_dedup)) goto done;
    #endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(varnames_tuple_dedup);
    #endif
    if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
        Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(line_table_length == -1)) goto done;
        #endif
        Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
        code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
        if (unlikely(!code_bytes)) goto done;
        char* c_code_bytes = PyBytes_AsString(code_bytes);
        if (unlikely(!c_code_bytes)) goto done;
        memset(c_code_bytes, 0, (size_t) code_len);
    }
    code_obj = (PyObject*) __Pyx__PyCode_New(
        (int) descr.argcount,
        (int) descr.num_posonly_args,
        (int) descr.num_kwonly_args,
        (int) descr.nlocals,
        0,
        (int) descr.flags,
        code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        varnames_tuple_dedup,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        filename,
        funcname,
        (int) descr.first_line,
        (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
    );
done:
    Py_XDECREF(code_bytes);
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(varnames_tuple_dedup);
    #endif
    Py_DECREF(varnames_tuple);
    return code_obj;
}

/* DecompressString */
static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
    PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
    const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
    PyObject *methodname = PyUnicode_FromString("decompress");
    if (unlikely(!methodname)) return NULL;
    #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
    if (algo == 3) {
        PyObject *fromlist = Py_BuildValue("[O]", methodname);
        if (unlikely(!fromlist)) goto bad;
        module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
    } else
    #endif
        module = PyImport_ImportModule(module_name);
    if (unlikely(!module)) goto import_failed;
    decompress = PyObject_GetAttr(module, methodname);
    if (unlikely(!decompress)) goto import_failed;
    {
        #ifdef __cplusplus
            char *memview_bytes = const_cast<char*>(s);
        #else
            #if defined(__clang__)
              #pragma clang diagnostic push
              #pragma clang diagnostic ignored "-Wcast-qual"
            #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
              #pragma GCC diagnostic push
              #pragma GCC diagnostic ignored "-Wcast-qual"
            #endif
            char *memview_bytes = (char*) s;
            #if defined(__clang__)
              #pragma clang diagnostic pop
            #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
              #pragma GCC diagnostic pop
            #endif
        #endif
        #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
        int memview_flags = 0x100;
        #else
        int memview_flags = PyBUF_READ;
        #endif
        compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
    }
    if (unlikely(!compressed_bytes)) {
        Py_DECREF(decompress);
        goto bad;
    }
    decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
    Py_DECREF(compressed_bytes);
    Py_DECREF(decompress);
    Py_DECREF(module);
    Py_DECREF(methodname);
    return decompressed;
import_failed:
    PyErr_Format(PyExc_ImportError,
        "Failed to import '%.20s.decompress' - cannot initialise module strings. "
        "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
        module_name, algo);
bad:
    Py_XDECREF(module);
    Py_DECREF(methodname);
    return NULL;
}

#include <string.h>
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
    size_t len = strlen(s);
    if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
        PyErr_SetString(PyExc_OverflowError, "byte string is too long");
        return -1;
    }
    return (Py_ssize_t) len;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return PyByteArray_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    {
        const char* result;
        Py_ssize_t unicode_length;
        CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
        #else
        result = PyUnicode_AsUTF8AndSize(o, length);
        #endif
        #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        unicode_length = PyUnicode_GetLength(o);
        if (unlikely(unicode_length < 0)) return NULL;
        if (unlikely(unicode_length != *length)) {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
        #endif
        return result;
    }
#else
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
}
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
    if (PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
    if (PyByteArray_Check(o)) {
#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
#else
        *length = PyByteArray_Size(o);
        if (*length == -1) return NULL;
        return PyByteArray_AsString(o);
#endif
    } else
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ").  "
                "The ability to return an instance of a strict subclass of int is deprecated, "
                "and may be removed in a future version of Python.",
                result_type_name)) {
            __Pyx_DECREF_TypeName(result_type_name);
            Py_DECREF(result);
            return NULL;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
    PyErr_Format(PyExc_TypeError,
                 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
                 result_type_name);
    __Pyx_DECREF_TypeName(result_type_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  PyObject *res = NULL;
  if (likely(PyLong_Check(x)))
      return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  if (likely(m && m->nb_int)) {
      res = m->nb_int(x);
  }
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
      res = PyNumber_Long(x);
  }
#endif
  if (likely(res)) {
      if (unlikely(!PyLong_CheckExact(res))) {
          return __Pyx_PyNumber_LongWrongResultType(res);
      }
  }
  else if (!PyErr_Occurred()) {
      PyErr_SetString(PyExc_TypeError,
                      "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(__Pyx_PyLong_IsCompact(b))) {
        return __Pyx_PyLong_CompactValue(b);
    } else {
      const digit* digits = __Pyx_PyLong_Digits(b);
      const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyLong_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyLong_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
    CYTHON_UNUSED_VAR(b);
    return __Pyx_NewRef(Py_None);
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return __Pyx_NewRef(b ? Py_True: Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
    return PyLong_FromSize_t(ival);
}


/* MultiPhaseInitModuleState */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
#else
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
#endif
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
#error "Module state with PEP489 requires atomics. Currently that's one of\
 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
#endif
#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#define __Pyx_ModuleStateLookup_Lock()
#define __Pyx_ModuleStateLookup_Unlock()
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(__cplusplus) && __cplusplus >= 201103L
#include <mutex>
static std::mutex __Pyx_ModuleStateLookup_mutex;
#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
#include <threads.h>
static mtx_t __Pyx_ModuleStateLookup_mutex;
static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
    mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
}
#define __Pyx_ModuleStateLookup_Lock()\
  call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
  mtx_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(HAVE_PTHREAD_H)
#include <pthread.h>
static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(_WIN32)
#include <Windows.h>  // synchapi.h on its own doesn't work
static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#else
#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
 Requires C standard >= C11, or C++ standard >= C++11,\
 or pthreads, or the Windows 32 API, or Python >= 3.13."
#endif
typedef struct {
    int64_t id;
    PyObject *module;
} __Pyx_InterpreterIdAndModule;
typedef struct {
    char interpreter_id_as_index;
    Py_ssize_t count;
    Py_ssize_t allocated;
    __Pyx_InterpreterIdAndModule table[1];
} __Pyx_ModuleStateLookupData;
#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
#else
static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
#endif
static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
        __Pyx_InterpreterIdAndModule* table,
        Py_ssize_t count,
        int64_t interpreterId) {
    __Pyx_InterpreterIdAndModule* begin = table;
    __Pyx_InterpreterIdAndModule* end = begin + count;
    if (begin->id == interpreterId) {
        return begin;
    }
    while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
        __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
        if (halfway->id == interpreterId) {
            return halfway;
        }
        if (halfway->id < interpreterId) {
            begin = halfway;
        } else {
            end = halfway;
        }
    }
    for (; begin < end; ++begin) {
        if (begin->id >= interpreterId) return begin;
    }
    return begin;
}
static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return NULL;
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
    {
        __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        if (likely(data)) {
            __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
            if (likely(data == new_data)) {
                goto read_finished;
            }
        }
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        __Pyx_ModuleStateLookup_Lock();
        __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
        data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
        __Pyx_ModuleStateLookup_Unlock();
    }
  read_finished:;
#else
    __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_InterpreterIdAndModule* found = NULL;
    if (unlikely(!data)) goto end;
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            found = data->table+interpreter_id;
        }
    } else {
        found = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
    }
  end:
    {
        PyObject *result=NULL;
        if (found && found->id == interpreter_id) {
            result = found->module;
        }
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
#endif
        return result;
    }
}
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
    while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
}
#else
#define __Pyx_ModuleStateLookup_wait_until_no_readers()
#endif
static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
    Py_ssize_t to_allocate = (*old_data)->allocated;
    while (to_allocate <= interpreter_id) {
        if (to_allocate == 0) to_allocate = 1;
        else to_allocate *= 2;
    }
    __Pyx_ModuleStateLookupData *new_data = *old_data;
    if (to_allocate != (*old_data)->allocated) {
         new_data = (__Pyx_ModuleStateLookupData *)realloc(
            *old_data,
            sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
        if (!new_data) {
            PyErr_NoMemory();
            return -1;
        }
        for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
            new_data->table[i].id = i;
            new_data->table[i].module = NULL;
        }
        new_data->allocated = to_allocate;
    }
    new_data->table[interpreter_id].module = module;
    if (new_data->count < interpreter_id+1) {
        new_data->count = interpreter_id+1;
    }
    *old_data = new_data;
    return 0;
}
static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
    __Pyx_InterpreterIdAndModule *read = data->table;
    __Pyx_InterpreterIdAndModule *write = data->table;
    __Pyx_InterpreterIdAndModule *end = read + data->count;
    for (; read<end; ++read) {
        if (read->module) {
            write->id = read->id;
            write->module = read->module;
            ++write;
        }
    }
    data->count = write - data->table;
    for (; write<end; ++write) {
        write->id = 0;
        write->module = NULL;
    }
    data->interpreter_id_as_index = 0;
}
static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    int result = 0;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_ModuleStateLookupData *new_data = old_data;
    if (!new_data) {
        new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
        if (!new_data) {
            result = -1;
            PyErr_NoMemory();
            goto end;
        }
        new_data->allocated = 1;
        new_data->interpreter_id_as_index = 1;
    }
    __Pyx_ModuleStateLookup_wait_until_no_readers();
    if (new_data->interpreter_id_as_index) {
        if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
            result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
            goto end;
        }
        __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
    }
    {
        Py_ssize_t insert_at = 0;
        {
            __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
                new_data->table, new_data->count, interpreter_id);
            assert(lower_bound);
            insert_at = lower_bound - new_data->table;
            if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
                lower_bound->module = module;
                goto end;  // already in table, nothing more to do
            }
        }
        if (new_data->count+1 >= new_data->allocated) {
            Py_ssize_t to_allocate = (new_data->count+1)*2;
            new_data =
                (__Pyx_ModuleStateLookupData*)realloc(
                    new_data,
                    sizeof(__Pyx_ModuleStateLookupData) +
                    (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
            if (!new_data) {
                result = -1;
                new_data = old_data;
                PyErr_NoMemory();
                goto end;
            }
            new_data->allocated = to_allocate;
        }
        ++new_data->count;
        int64_t last_id = interpreter_id;
        PyObject *last_module = module;
        for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
            int64_t current_id = new_data->table[i].id;
            new_data->table[i].id = last_id;
            last_id = current_id;
            PyObject *current_module = new_data->table[i].module;
            new_data->table[i].module = last_module;
            last_module = current_module;
        }
    }
  end:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
#else
    __Pyx_ModuleStateLookup_data = new_data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return result;
}
static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
#endif
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            data->table[interpreter_id].module = NULL;
        }
        goto done;
    }
    {
        __Pyx_ModuleStateLookup_wait_until_no_readers();
        __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
        if (!lower_bound) goto done;
        if (lower_bound->id != interpreter_id) goto done;
        __Pyx_InterpreterIdAndModule *end = data->table+data->count;
        for (;lower_bound<end-1; ++lower_bound) {
            lower_bound->id = (lower_bound+1)->id;
            lower_bound->module = (lower_bound+1)->module;
        }
    }
    --data->count;
    if (data->count == 0) {
        free(data);
        data = NULL;
    }
  done:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
#else
    __Pyx_ModuleStateLookup_data = data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return 0;
}
#endif

/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
