MCPcopy Create free account
hub / github.com/Sally-SH/VSP-LLM / __Pyx_PyCode_New

Function __Pyx_PyCode_New

fairseq/fairseq/data/data_utils_fast.cpp:609–653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

607 #define __Pyx_DefaultClassType PyType_Type
608#if CYTHON_COMPILING_IN_LIMITED_API
609 static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
610 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
611 PyObject *fv, PyObject *cell, PyObject* fn,
612 PyObject *name, int fline, PyObject *lnos) {
613 PyObject *exception_table = NULL;
614 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
615 #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
616 PyObject *version_info;
617 PyObject *py_minor_version = NULL;
618 #endif
619 long minor_version = 0;
620 PyObject *type, *value, *traceback;
621 PyErr_Fetch(&type, &value, &traceback);
622 #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
623 minor_version = 11;
624 #else
625 if (!(version_info = PySys_GetObject("version_info"))) goto end;
626 if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
627 minor_version = PyLong_AsLong(py_minor_version);
628 Py_DECREF(py_minor_version);
629 if (minor_version == -1 && PyErr_Occurred()) goto end;
630 #endif
631 if (!(types_module = PyImport_ImportModule("types"))) goto end;
632 if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
633 if (minor_version <= 7) {
634 (void)p;
635 result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
636 c, n, v, fn, name, fline, lnos, fv, cell);
637 } else if (minor_version <= 10) {
638 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
639 c, n, v, fn, name, fline, lnos, fv, cell);
640 } else {
641 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
642 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
643 c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
644 }
645 end:
646 Py_XDECREF(code_type);
647 Py_XDECREF(exception_table);
648 Py_XDECREF(types_module);
649 if (type) {
650 PyErr_Restore(type, value, traceback);
651 }
652 return result;
653 }
654 #ifndef CO_OPTIMIZED
655 #define CO_OPTIMIZED 0x0001
656 #endif

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected