cpdef
cpdef is a keyword in Cython used to declare a function that is accessible from both Python and C code. When you write a cpdef function, Cython generates a C-level implementation (like a cdef function) and a Python-callable wrapper that allows the function to be invoked from Python code. The wrapper translates Python arguments to C types and forwards the call to the C implementation.
From C or from Cython code, you can call the underlying C-level function directly, bypassing the Python
cpdef differs from def and cdef in scope and visibility. def defines a Python function object only,
In extension types (cdef classes), cpdef methods are exposed as Python methods and can also be called