예제 #1
0
파일: _pointcloud.c 프로젝트: npinto/cgkit
static PyObject *__pyx_f_11_pointcloud_readDataPoints(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  long __pyx_v_readFuncLoc;
  long __pyx_v_ptcHandle;
  long __pyx_v_numPoints;
  long __pyx_v_pointBuf;
  int __pyx_v_pointStride;
  long __pyx_v_normalBuf;
  int __pyx_v_normalStride;
  long __pyx_v_radiusBuf;
  int __pyx_v_radiusStride;
  long __pyx_v_dataBuf;
  int __pyx_v_dataStride;
  __pyx_t_11_pointcloud_PtcReadDataPointPtr __pyx_v_PtcReadDataPoint;
  __pyx_t_11_pointcloud_PtcPointCloud __pyx_v_pointCloud;
  float *__pyx_v_pntPtr;
  float *__pyx_v_normalPtr;
  float *__pyx_v_radiusPtr;
  float *__pyx_v_dataPtr;
  int __pyx_v_n;
  int __pyx_v_res;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {"readFuncLoc","ptcHandle","numPoints","pointBuf","pointStride","normalBuf","normalStride","radiusBuf","radiusStride","dataBuf","dataStride",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "llllililili", __pyx_argnames, &__pyx_v_readFuncLoc, &__pyx_v_ptcHandle, &__pyx_v_numPoints, &__pyx_v_pointBuf, &__pyx_v_pointStride, &__pyx_v_normalBuf, &__pyx_v_normalStride, &__pyx_v_radiusBuf, &__pyx_v_radiusStride, &__pyx_v_dataBuf, &__pyx_v_dataStride)) return 0;

  /* "/Users/baas/src/cgkit/pyrex/pyx/_pointcloud.pyx":63 */
  __pyx_v_PtcReadDataPoint = (((__pyx_t_11_pointcloud_PtcReadDataPointPtr *)__pyx_v_readFuncLoc)[0]);

  /* "/Users/baas/src/cgkit/pyrex/pyx/_pointcloud.pyx":64 */
  __pyx_v_pointCloud = ((__pyx_t_11_pointcloud_PtcPointCloud)__pyx_v_ptcHandle);

  /* "/Users/baas/src/cgkit/pyrex/pyx/_pointcloud.pyx":73 */
  __pyx_v_pntPtr = ((float *)__pyx_v_pointBuf);

  /* "/Users/baas/src/cgkit/pyrex/pyx/_pointcloud.pyx":74 */
  __pyx_v_normalPtr = ((float *)__pyx_v_normalBuf);

  /* "/Users/baas/src/cgkit/pyrex/pyx/_pointcloud.pyx":75 */
  __pyx_v_radiusPtr = ((float *)__pyx_v_radiusBuf);

  /* "/Users/baas/src/cgkit/pyrex/pyx/_pointcloud.pyx":76 */
  __pyx_v_dataPtr = ((float *)__pyx_v_dataBuf);

  /* "/Users/baas/src/cgkit/pyrex/pyx/_pointcloud.pyx":79 */
  __pyx_v_n = 0;

  /* "/Users/baas/src/cgkit/pyrex/pyx/_pointcloud.pyx":80 */
  while (1) {
    __pyx_1 = (__pyx_v_n < __pyx_v_numPoints);
    if (!__pyx_1) break;

    /* "/Users/baas/src/cgkit/pyrex/pyx/_pointcloud.pyx":81 */
    __pyx_v_res = __pyx_v_PtcReadDataPoint(__pyx_v_pointCloud,__pyx_v_pntPtr,__pyx_v_normalPtr,__pyx_v_radiusPtr,__pyx_v_dataPtr);

    /* "/Users/baas/src/cgkit/pyrex/pyx/_pointcloud.pyx":82 */
    __pyx_1 = (__pyx_v_res == 0);
    if (__pyx_1) {
      __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; goto __pyx_L1;}
      Py_INCREF(__pyx_k1p);
      PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k1p);
      __pyx_3 = PyObject_CallObject(PyExc_IOError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      __Pyx_Raise(__pyx_3, 0, 0);
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/Users/baas/src/cgkit/pyrex/pyx/_pointcloud.pyx":84 */
    __pyx_v_pntPtr += __pyx_v_pointStride;

    /* "/Users/baas/src/cgkit/pyrex/pyx/_pointcloud.pyx":85 */
    __pyx_v_normalPtr += __pyx_v_normalStride;

    /* "/Users/baas/src/cgkit/pyrex/pyx/_pointcloud.pyx":86 */
    __pyx_v_radiusPtr += __pyx_v_radiusStride;

    /* "/Users/baas/src/cgkit/pyrex/pyx/_pointcloud.pyx":87 */
    __pyx_v_dataPtr += __pyx_v_dataStride;

    /* "/Users/baas/src/cgkit/pyrex/pyx/_pointcloud.pyx":88 */
    __pyx_v_n += 1;
  }

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("_pointcloud.readDataPoints");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}
예제 #2
0
/* Implementation of 'query' */
static char __pyx_k_main[] = "__main__";
static char __pyx_k_test[] = "__test__";
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_test;

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "query",
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  return 0;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initquery(void); /*proto*/
PyMODINIT_FUNC initquery(void)
#else
PyMODINIT_FUNC PyInit_query(void); /*proto*/
PyMODINIT_FUNC PyInit_query(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #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("PyMODINIT_FUNC PyInit_query(void)", 0);
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("query", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  if (__pyx_module_is_main_query) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "query")) {
      if (unlikely(PyDict_SetItemString(modules, "query", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "query.pxd":1
 * cdef extern from "../lib/marisa/query.h" namespace "marisa" nogil:             # <<<<<<<<<<<<<<
 * 
 *     cdef cppclass Query:
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init query", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init query");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}
예제 #3
0
  /* "zmq/utils/initthreads.pyx":33
 * # If we don't have this, pyzmq will segfault.
 * def init_threads():
 *     PyEval_InitThreads()             # <<<<<<<<<<<<<<
 * 
 * __all__ = ['init_threads']
 */
  PyEval_InitThreads();

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("initthreads"),
    __Pyx_DOCSTR(__pyx_k_1), /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_n_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 1},
  {&__pyx_n_s____all__, __pyx_k____all__, sizeof(__pyx_k____all__), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s__init_threads, __pyx_k__init_threads, sizeof(__pyx_k__init_threads), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  return 0;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants");
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initinitthreads(void); /*proto*/
PyMODINIT_FUNC initinitthreads(void)
#else
PyMODINIT_FUNC PyInit_initthreads(void); /*proto*/
PyMODINIT_FUNC PyInit_initthreads(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannyDeclarations
  #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("PyMODINIT_FUNC PyInit_initthreads(void)");
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __pyx_binding_PyCFunctionType_USED
  if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("initthreads"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_1), 0, PYTHON_API_VERSION);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  #if PY_MAJOR_VERSION < 3
  Py_INCREF(__pyx_m);
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_zmq__utils__initthreads) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "zmq/utils/initthreads.pyx":32
 * # by hand to get threads initialized. Not clear why this is the case though.
 * # If we don't have this, pyzmq will segfault.
 * def init_threads():             # <<<<<<<<<<<<<<
 *     PyEval_InitThreads()
 * 
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3zmq_5utils_11initthreads_init_threads, NULL, __pyx_n_s_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__init_threads, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "zmq/utils/initthreads.pyx":35
 *     PyEval_InitThreads()
 * 
 * __all__ = ['init_threads']             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__init_threads));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__init_threads));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__init_threads));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____all__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "zmq/utils/initthreads.pyx":1
 * """Utility to initialize threads."""             # <<<<<<<<<<<<<<
 * 
 * #
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  if (__pyx_m) {
    __Pyx_AddTraceback("init zmq.utils.initthreads", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init zmq.utils.initthreads");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}
예제 #4
0
/* Implementation of 'ext.sparsehash' */
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    __Pyx_NAMESTR("sparsehash"),
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  return 0;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initsparsehash(void); /*proto*/
PyMODINIT_FUNC initsparsehash(void)
#else
PyMODINIT_FUNC PyInit_sparsehash(void); /*proto*/
PyMODINIT_FUNC PyInit_sparsehash(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannyDeclarations
  #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("PyMODINIT_FUNC PyInit_sparsehash(void)", 0);
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("sparsehash"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "ext.sparsehash")) {
      if (unlikely(PyDict_SetItemString(modules, "ext.sparsehash", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_ext__sparsehash) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "sparsehash/sparsehash.pyx":1
             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  if (__pyx_m) {
    __Pyx_AddTraceback("init ext.sparsehash", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init ext.sparsehash");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}
예제 #5
0
/* Implementation of _pymfclib_winhttp */

static PyObject *__pyx_f_17_pymfclib_winhttp_getIEProxyConfigForCurrentUser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_17_pymfclib_winhttp_getIEProxyConfigForCurrentUser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  WINHTTP_CURRENT_USER_IE_PROXY_CONFIG __pyx_v_ieconfig;
  struct __pyx_obj_17_pymfclib_winhttp_CurrentUserIEProxyConfig *__pyx_v_ret;
  PyObject *__pyx_r;
  BOOL __pyx_1;
  PyObject *__pyx_2 = 0;
  int __pyx_3;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  __pyx_v_ret = ((struct __pyx_obj_17_pymfclib_winhttp_CurrentUserIEProxyConfig *)Py_None); Py_INCREF(Py_None);

  /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":62 */
  memset((&__pyx_v_ieconfig),0,(sizeof(__pyx_v_ieconfig)));

  /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":63 */
  __pyx_1 = WinHttpGetIEProxyConfigForCurrentUser((&__pyx_v_ieconfig));
  if (__pyx_1) {

    /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":64 */
    __pyx_2 = PyObject_CallObject(((PyObject *)__pyx_ptype_17_pymfclib_winhttp_CurrentUserIEProxyConfig), 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
    Py_DECREF(((PyObject *)__pyx_v_ret));
    __pyx_v_ret = ((struct __pyx_obj_17_pymfclib_winhttp_CurrentUserIEProxyConfig *)__pyx_2);
    __pyx_2 = 0;

    /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":65 */
    __pyx_2 = PyInt_FromLong(__pyx_v_ieconfig.fAutoDetect); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; goto __pyx_L1;}
    Py_DECREF(__pyx_v_ret->autodetect);
    __pyx_v_ret->autodetect = __pyx_2;
    __pyx_2 = 0;

    /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":66 */
    /*try:*/ {

      /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":67 */
      __pyx_3 = (__pyx_v_ieconfig.lpszAutoConfigUrl != 0);
      if (__pyx_3) {
        __pyx_2 = _fromWideChar(__pyx_v_ieconfig.lpszAutoConfigUrl); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; goto __pyx_L4;}
        Py_DECREF(__pyx_v_ret->autoconfigurl);
        __pyx_v_ret->autoconfigurl = __pyx_2;
        __pyx_2 = 0;
        goto __pyx_L6;
      }
      __pyx_L6:;

      /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":69 */
      __pyx_3 = (__pyx_v_ieconfig.lpszProxy != 0);
      if (__pyx_3) {
        __pyx_2 = _fromWideChar(__pyx_v_ieconfig.lpszProxy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; goto __pyx_L4;}
        Py_DECREF(__pyx_v_ret->proxy);
        __pyx_v_ret->proxy = __pyx_2;
        __pyx_2 = 0;
        goto __pyx_L7;
      }
      __pyx_L7:;

      /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":71 */
      __pyx_3 = (__pyx_v_ieconfig.lpszProxyBypass != 0);
      if (__pyx_3) {
        __pyx_2 = _fromWideChar(__pyx_v_ieconfig.lpszProxyBypass); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L4;}
        Py_DECREF(__pyx_v_ret->proxybypass);
        __pyx_v_ret->proxybypass = __pyx_2;
        __pyx_2 = 0;
        goto __pyx_L8;
      }
      __pyx_L8:;
    }
    /*finally:*/ {
      int __pyx_why;
      PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
      int __pyx_exc_lineno;
      __pyx_why = 0; goto __pyx_L5;
      __pyx_L4: {
        __pyx_why = 4;
        Py_XDECREF(__pyx_2); __pyx_2 = 0;
        PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
        __pyx_exc_lineno = __pyx_lineno;
        goto __pyx_L5;
      }
      __pyx_L5:;

      /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":74 */
      __pyx_3 = (__pyx_v_ieconfig.lpszAutoConfigUrl != 0);
      if (__pyx_3) {
        GlobalFree(__pyx_v_ieconfig.lpszAutoConfigUrl);
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":76 */
      __pyx_3 = (__pyx_v_ieconfig.lpszProxy != 0);
      if (__pyx_3) {
        GlobalFree(__pyx_v_ieconfig.lpszProxy);
        goto __pyx_L11;
      }
      __pyx_L11:;

      /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":78 */
      __pyx_3 = (__pyx_v_ieconfig.lpszProxyBypass != 0);
      if (__pyx_3) {
        GlobalFree(__pyx_v_ieconfig.lpszProxyBypass);
        goto __pyx_L12;
      }
      __pyx_L12:;
      switch (__pyx_why) {
        case 4: {
          PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
          __pyx_lineno = __pyx_exc_lineno;
          __pyx_exc_type = 0;
          __pyx_exc_value = 0;
          __pyx_exc_tb = 0;
          goto __pyx_L1;
        }
      }
    }

    /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":80 */
    Py_INCREF(((PyObject *)__pyx_v_ret));
    __pyx_r = ((PyObject *)__pyx_v_ret);
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_pymfclib_winhttp.getIEProxyConfigForCurrentUser");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_ret);
  return __pyx_r;
}
예제 #6
0
파일: Stemmer.c 프로젝트: buriy/pystemmer
static PyObject *__pyx_f_7Stemmer_7Stemmer_stemWords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_words = 0;
  PyObject *__pyx_v_result;
  PyObject *__pyx_v_word;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"words",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_words)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_words);
  __pyx_v_result = Py_None; Py_INCREF(Py_None);
  __pyx_v_word = Py_None; Py_INCREF(Py_None);

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":215 */
  __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;}
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_1;
  __pyx_1 = 0;

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":216 */
  __pyx_1 = PyObject_GetIter(__pyx_v_words); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;}
  for (;;) {
    __pyx_2 = PyIter_Next(__pyx_1);
    if (!__pyx_2) {
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;}
      break;
    }
    Py_DECREF(__pyx_v_word);
    __pyx_v_word = __pyx_2;
    __pyx_2 = 0;
    __pyx_2 = PyObject_GetAttr(__pyx_v_result, __pyx_n_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;}
    __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_stemWord); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;}
    Py_INCREF(__pyx_v_word);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_word);
    __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":218 */
  Py_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("Stemmer.Stemmer.stemWords");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_result);
  Py_DECREF(__pyx_v_word);
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_words);
  return __pyx_r;
}
예제 #7
0
  /* "cython_struct.pyx":12
 *     initStruct(&mst)
 *     showStruct(&mst)
 *     return mst             # <<<<<<<<<<<<<<
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert__to_py_myStruct(__pyx_v_mst); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cython_struct.test_struct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("cython_struct"),
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s__a, __pyx_k__a, sizeof(__pyx_k__a), 0, 0, 1, 1},
  {&__pyx_n_s__cython_struct, __pyx_k__cython_struct, sizeof(__pyx_k__cython_struct), 0, 0, 1, 1},
  {&__pyx_n_s__test_struct, __pyx_k__test_struct, sizeof(__pyx_k__test_struct), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  return 0;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants");
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initcython_struct(void); /*proto*/
PyMODINIT_FUNC initcython_struct(void)
#else
PyMODINIT_FUNC PyInit_cython_struct(void); /*proto*/
PyMODINIT_FUNC PyInit_cython_struct(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannyDeclarations
  #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("PyMODINIT_FUNC PyInit_cython_struct(void)");
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __pyx_binding_PyCFunctionType_USED
  if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("cython_struct"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  #if PY_MAJOR_VERSION < 3
  Py_INCREF(__pyx_m);
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_cython_struct) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "cython_struct.pyx":8
 *     cdef void showStruct(myStruct *mst)
 * 
 * def test_struct():             # <<<<<<<<<<<<<<
 *     cdef myStruct mst
 *     initStruct(&mst)
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13cython_struct_test_struct, NULL, __pyx_n_s__cython_struct); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__test_struct, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cython_struct.pyx":1
 * cdef extern from "struct_test.h":             # <<<<<<<<<<<<<<
 *     ctypedef struct myStruct:
 *         int a
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  if (__pyx_m) {
    __Pyx_AddTraceback("init cython_struct", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init cython_struct");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}
예제 #8
0
파일: fib.c 프로젝트: fepettersen/inf3331
static PyObject *__pyx_pf_3fib_fib(PyObject *__pyx_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_v_a = NULL;
  PyObject *__pyx_v_b = NULL;
  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("fib");
  __pyx_self = __pyx_self;

  /* "fib.pyx":2
 * def fib(n):
 * 	a ,b = 0,1             # <<<<<<<<<<<<<<
 * 	while b<n:
 * 		print b,
 */
  __pyx_t_1 = __pyx_int_0;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_int_1;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_a = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_b = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "fib.pyx":3
 * def fib(n):
 * 	a ,b = 0,1
 * 	while b<n:             # <<<<<<<<<<<<<<
 * 		print b,
 * 		a,b = b,b+a
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_b, __pyx_v_n, Py_LT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_3) break;

    /* "fib.pyx":4
 * 	a ,b = 0,1
 * 	while b<n:
 * 		print b,             # <<<<<<<<<<<<<<
 * 		a,b = b,b+a
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_b);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_b);
    __Pyx_GIVEREF(__pyx_v_b);
    if (__Pyx_Print(0, ((PyObject *)__pyx_t_2), 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

    /* "fib.pyx":5
 * 	while b<n:
 * 		print b,
 * 		a,b = b,b+a             # <<<<<<<<<<<<<<
 */
    __pyx_t_2 = __pyx_v_b;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = PyNumber_Add(__pyx_v_b, __pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v_a);
    __pyx_v_a = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_b);
    __pyx_v_b = __pyx_t_1;
    __pyx_t_1 = 0;
  }

  __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_AddTraceback("fib.fib", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_a);
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
예제 #9
0
파일: baas2.c 프로젝트: jwilk/Pyrex
/* Implementation of baas2 */

static PyObject *__pyx_f_5baas2_bar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5baas2_bar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_a;
  int __pyx_v_b;
  PyObject *__pyx_v_values;
  PyObject *__pyx_v_dummy;
  PyObject *__pyx_v_tup;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  int __pyx_4;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  __pyx_v_values = Py_None; Py_INCREF(Py_None);
  __pyx_v_dummy = Py_None; Py_INCREF(Py_None);
  __pyx_v_tup = Py_None; Py_INCREF(Py_None);

  /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/baas/baas2.pyx":4 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
  __pyx_1 = 0;
  __pyx_2 = 0;
  Py_DECREF(__pyx_v_values);
  __pyx_v_values = __pyx_3;
  __pyx_3 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/baas/baas2.pyx":5 */
  __pyx_1 = PyFloat_FromDouble(1.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
  Py_DECREF(__pyx_v_dummy);
  __pyx_v_dummy = __pyx_1;
  __pyx_1 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/baas/baas2.pyx":7 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_values, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_v_a = __pyx_4;

  /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/baas/baas2.pyx":8 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
  __pyx_2 = PyObject_GetItem(__pyx_v_values, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_v_b = __pyx_4;

  /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/baas/baas2.pyx":10 */
  __pyx_1 = PyInt_FromLong(__pyx_v_a); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(__pyx_v_b); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
  __pyx_1 = 0;
  __pyx_2 = 0;
  Py_DECREF(__pyx_v_tup);
  __pyx_v_tup = __pyx_3;
  __pyx_3 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/baas/baas2.pyx":11 */
  if (__Pyx_PrintItem(__pyx_v_tup) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; goto __pyx_L1;}
  if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; goto __pyx_L1;}

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("baas2.bar");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_values);
  Py_DECREF(__pyx_v_dummy);
  Py_DECREF(__pyx_v_tup);
  return __pyx_r;
}
예제 #10
0
파일: ssdeep.c 프로젝트: 0xDeva/pyssdeep
static PyObject *__pyx_f_6ssdeep_6ssdeep_hash_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_buf = 0;
  char (*__pyx_v_utext);
  PyObject *__pyx_v_res;
  PyObject *__pyx_r;
  char (*__pyx_1);
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  int __pyx_5;
  PyObject *__pyx_6 = 0;
  static char *__pyx_argnames[] = {"buf",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_buf);
  __pyx_v_res = Py_None; Py_INCREF(__pyx_v_res);

  /* "/home/jose/tmp/ssdeep-2.2/pyssdeep-read-only/ssdeep.pyx":42 */
  __pyx_1 = PyString_AsString(__pyx_v_buf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; goto __pyx_L1;}
  __pyx_v_utext = __pyx_1;

  /* "/home/jose/tmp/ssdeep-2.2/pyssdeep-read-only/ssdeep.pyx":43 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; goto __pyx_L1;}
  Py_INCREF(__pyx_v_buf);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_buf);
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_5 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_2 = PyString_FromString(fuzzy_hash_data(__pyx_v_utext,__pyx_5)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; goto __pyx_L1;}
  Py_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_2;
  __pyx_2 = 0;

  /* "/home/jose/tmp/ssdeep-2.2/pyssdeep-read-only/ssdeep.pyx":44 */
  __pyx_5 = PySequence_Contains(__pyx_v_res, __pyx_k5p); if (__pyx_5 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
  if (__pyx_5) {

    /* "/home/jose/tmp/ssdeep-2.2/pyssdeep-read-only/ssdeep.pyx":45 */
    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_SsdeepException); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;}
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_replace); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;}
    Py_INCREF(__pyx_k6p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k6p);
    Py_INCREF(__pyx_k7p);
    PyTuple_SET_ITEM(__pyx_2, 1, __pyx_k7p);
    __pyx_6 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __Pyx_Raise(__pyx_3, __pyx_v_res, __pyx_6);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;}
    goto __pyx_L2;
  }
  /*else*/ {
    Py_INCREF(__pyx_v_res);
    __pyx_r = __pyx_v_res;
    goto __pyx_L0;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_6);
  __Pyx_AddTraceback("ssdeep.ssdeep.hash_bytes");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_res);
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_buf);
  return __pyx_r;
}
예제 #11
0
파일: ssdeep.c 프로젝트: 0xDeva/pyssdeep
static PyObject *__pyx_f_6ssdeep_6ssdeep_hash_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_res;
  PyObject *__pyx_r;
  char (*__pyx_1);
  PyObject *__pyx_2 = 0;
  int __pyx_3;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  static char *__pyx_argnames[] = {"filename",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_filename)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_filename);
  __pyx_v_res = Py_None; Py_INCREF(__pyx_v_res);

  /* "/home/jose/tmp/ssdeep-2.2/pyssdeep-read-only/ssdeep.pyx":33 */
  __pyx_1 = PyString_AsString(__pyx_v_filename); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
  __pyx_2 = PyString_FromString(fuzzy_hash(__pyx_1)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
  Py_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_2;
  __pyx_2 = 0;

  /* "/home/jose/tmp/ssdeep-2.2/pyssdeep-read-only/ssdeep.pyx":35 */
  __pyx_3 = PySequence_Contains(__pyx_v_res, __pyx_k2p); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
  if (__pyx_3) {

    /* "/home/jose/tmp/ssdeep-2.2/pyssdeep-read-only/ssdeep.pyx":36 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_SsdeepException); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
    __pyx_4 = PyObject_GetAttr(__pyx_v_res, __pyx_n_replace); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
    Py_INCREF(__pyx_k3p);
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k3p);
    Py_INCREF(__pyx_k4p);
    PyTuple_SET_ITEM(__pyx_5, 1, __pyx_k4p);
    __pyx_6 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    __Pyx_Raise(__pyx_2, __pyx_6, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
    goto __pyx_L2;
  }
  /*else*/ {
    Py_INCREF(__pyx_v_res);
    __pyx_r = __pyx_v_res;
    goto __pyx_L0;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  __Pyx_AddTraceback("ssdeep.ssdeep.hash_file");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_res);
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_filename);
  return __pyx_r;
}
예제 #12
0
파일: hello.c 프로젝트: Globey/2013-480
static PyObject *__pyx_pf_5hello_say_hello_to(PyObject *__pyx_self, PyObject *__pyx_v_name) {
  int __pyx_v_n;
  int __pyx_v_m;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("say_hello_to");
  __pyx_self = __pyx_self;

  /* "hello.pyx":2
 * def say_hello_to(name):
 *     cdef int n = 18932808299             # <<<<<<<<<<<<<<
 *     cdef int m = n*n
 *     print("Hello %s! %s" % (name,m))
 */
  __pyx_v_n = 18932808299;

  /* "hello.pyx":3
 * def say_hello_to(name):
 *     cdef int n = 18932808299
 *     cdef int m = n*n             # <<<<<<<<<<<<<<
 *     print("Hello %s! %s" % (name,m))
 */
  __pyx_v_m = (__pyx_v_n * __pyx_v_n);

  /* "hello.pyx":4
 *     cdef int n = 18932808299
 *     cdef int m = n*n
 *     print("Hello %s! %s" % (name,m))             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_m); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  __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_AddTraceback("hello.say_hello_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
예제 #13
0
static PyObject *__pyx_f_11closestpair_closest_pair(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyListObject *__pyx_v_points = 0;
  float __pyx_v_min_d;
  PyObject *__pyx_v_min_p1;
  PyObject *__pyx_v_min_p2;
  PyObject *__pyx_v_i;
  PyObject *__pyx_v_point;
  PyObject *__pyx_v_point2;
  PyObject *__pyx_v_d;
  PyObject *__pyx_v_split;
  PyObject *__pyx_v_d1;
  PyObject *__pyx_v_p11;
  PyObject *__pyx_v_p12;
  PyObject *__pyx_v_d2;
  PyObject *__pyx_v_p21;
  PyObject *__pyx_v_p22;
  PyObject *__pyx_v_points_in_strip;
  PyObject *__pyx_v_split_at;
  PyObject *__pyx_v_max_i;
  PyObject *__pyx_v_sd;
  PyObject *__pyx_r;
  Py_ssize_t __pyx_1;
  int __pyx_2;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  PyObject *__pyx_8 = 0;
  PyObject *__pyx_9 = 0;
  PyObject *__pyx_10 = 0;
  float __pyx_11;
  int __pyx_12;
  Py_ssize_t __pyx_13;
  static char *__pyx_argnames[] = {"points",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_points)) return 0;
  Py_INCREF(__pyx_v_points);
  __pyx_v_min_p1 = Py_None; Py_INCREF(Py_None);
  __pyx_v_min_p2 = Py_None; Py_INCREF(Py_None);
  __pyx_v_i = Py_None; Py_INCREF(Py_None);
  __pyx_v_point = Py_None; Py_INCREF(Py_None);
  __pyx_v_point2 = Py_None; Py_INCREF(Py_None);
  __pyx_v_d = Py_None; Py_INCREF(Py_None);
  __pyx_v_split = Py_None; Py_INCREF(Py_None);
  __pyx_v_d1 = Py_None; Py_INCREF(Py_None);
  __pyx_v_p11 = Py_None; Py_INCREF(Py_None);
  __pyx_v_p12 = Py_None; Py_INCREF(Py_None);
  __pyx_v_d2 = Py_None; Py_INCREF(Py_None);
  __pyx_v_p21 = Py_None; Py_INCREF(Py_None);
  __pyx_v_p22 = Py_None; Py_INCREF(Py_None);
  __pyx_v_points_in_strip = Py_None; Py_INCREF(Py_None);
  __pyx_v_split_at = Py_None; Py_INCREF(Py_None);
  __pyx_v_max_i = Py_None; Py_INCREF(Py_None);
  __pyx_v_sd = Py_None; Py_INCREF(Py_None);
  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_points), (&PyList_Type), 1, "points")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}

  /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":15 */
  __pyx_1 = PyObject_Length(((PyObject *)__pyx_v_points)); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
  __pyx_2 = (__pyx_1 < 2);
  if (__pyx_2) {
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
    Py_INCREF(__pyx_k1p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k1p);
    __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __Pyx_Raise(__pyx_4, 0, 0);
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_1 = PyObject_Length(((PyObject *)__pyx_v_points)); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
  __pyx_2 = 2 <= __pyx_1;
  if (__pyx_2) {
    __pyx_2 = __pyx_1 <= 6;
  }
  if (__pyx_2) {

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":18 */
    __pyx_v_min_d = 0;

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":19 */
    Py_INCREF(Py_None);
    Py_DECREF(__pyx_v_min_p1);
    __pyx_v_min_p1 = Py_None;

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":20 */
    Py_INCREF(Py_None);
    Py_DECREF(__pyx_v_min_p2);
    __pyx_v_min_p2 = Py_None;

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":21 */
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
    Py_INCREF(((PyObject *)__pyx_v_points));
    PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_points));
    __pyx_4 = PyObject_CallObject(((PyObject *)(&PyEnum_Type)), __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_3 = PyObject_GetIter(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    for (;;) {
      __pyx_4 = PyIter_Next(__pyx_3);
      if (!__pyx_4) {
        if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
        break;
      }
      __pyx_5 = PyObject_GetIter(__pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      __pyx_4 = __Pyx_UnpackItem(__pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
      Py_DECREF(__pyx_v_i);
      __pyx_v_i = __pyx_4;
      __pyx_4 = 0;
      __pyx_4 = __Pyx_UnpackItem(__pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
      Py_DECREF(__pyx_v_point);
      __pyx_v_point = __pyx_4;
      __pyx_4 = 0;
      if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
      Py_DECREF(__pyx_5); __pyx_5 = 0;
      __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
      __pyx_5 = PyNumber_Add(__pyx_v_i, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      __pyx_1 = PyInt_AsSsize_t(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
      Py_DECREF(__pyx_5); __pyx_5 = 0;
      __pyx_4 = PySequence_GetSlice(((PyObject *)__pyx_v_points), __pyx_1, PY_SSIZE_T_MAX); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
      __pyx_5 = PyObject_GetIter(__pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      for (;;) {
        __pyx_4 = PyIter_Next(__pyx_5);
        if (!__pyx_4) {
          if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
          break;
        }
        Py_DECREF(__pyx_v_point2);
        __pyx_v_point2 = __pyx_4;
        __pyx_4 = 0;

        /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":23 */
        __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_distance); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
        __pyx_6 = PySequence_GetItem(__pyx_v_point, 0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
        __pyx_7 = PySequence_GetItem(__pyx_v_point, 1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
        __pyx_8 = PySequence_GetItem(__pyx_v_point2, 0); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
        __pyx_9 = PySequence_GetItem(__pyx_v_point2, 1); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
        __pyx_10 = PyTuple_New(4); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
        PyTuple_SET_ITEM(__pyx_10, 0, __pyx_6);
        PyTuple_SET_ITEM(__pyx_10, 1, __pyx_7);
        PyTuple_SET_ITEM(__pyx_10, 2, __pyx_8);
        PyTuple_SET_ITEM(__pyx_10, 3, __pyx_9);
        __pyx_6 = 0;
        __pyx_7 = 0;
        __pyx_8 = 0;
        __pyx_9 = 0;
        __pyx_6 = PyObject_CallObject(__pyx_4, __pyx_10); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
        Py_DECREF(__pyx_4); __pyx_4 = 0;
        Py_DECREF(__pyx_10); __pyx_10 = 0;
        Py_DECREF(__pyx_v_d);
        __pyx_v_d = __pyx_6;
        __pyx_6 = 0;

        /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":24 */
        __pyx_2 = (__pyx_v_min_d == 0);
        if (!__pyx_2) {
          __pyx_7 = PyFloat_FromDouble(__pyx_v_min_d); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;}
          if (PyObject_Cmp(__pyx_7, __pyx_v_d, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;}
          __pyx_2 = __pyx_2 > 0;
          Py_DECREF(__pyx_7); __pyx_7 = 0;
        }
        if (__pyx_2) {

          /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":25 */
          __pyx_11 = PyFloat_AsDouble(__pyx_v_d); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; goto __pyx_L1;}
          __pyx_v_min_d = __pyx_11;

          /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":26 */
          Py_INCREF(__pyx_v_point);
          Py_DECREF(__pyx_v_min_p1);
          __pyx_v_min_p1 = __pyx_v_point;

          /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":27 */
          Py_INCREF(__pyx_v_point2);
          Py_DECREF(__pyx_v_min_p2);
          __pyx_v_min_p2 = __pyx_v_point2;
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      Py_DECREF(__pyx_5); __pyx_5 = 0;
    }
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":28 */
    __pyx_8 = PyFloat_FromDouble(__pyx_v_min_d); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;}
    __pyx_9 = PyTuple_New(3); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_9, 0, __pyx_8);
    Py_INCREF(__pyx_v_min_p1);
    PyTuple_SET_ITEM(__pyx_9, 1, __pyx_v_min_p1);
    Py_INCREF(__pyx_v_min_p2);
    PyTuple_SET_ITEM(__pyx_9, 2, __pyx_v_min_p2);
    __pyx_8 = 0;
    __pyx_r = __pyx_9;
    __pyx_9 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":30 */
    __pyx_12 = PyList_Sort(((PyObject *)__pyx_v_points)); if (__pyx_12 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":32 */
    __pyx_1 = PyObject_Length(((PyObject *)__pyx_v_points)); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
    __pyx_4 = PyInt_FromSsize_t((__pyx_1 / 2)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
    __pyx_10 = PyTuple_New(1); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_10, 0, __pyx_4);
    __pyx_4 = 0;
    __pyx_6 = PyObject_CallObject(((PyObject *)(&PyInt_Type)), __pyx_10); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
    Py_DECREF(__pyx_10); __pyx_10 = 0;
    Py_DECREF(__pyx_v_split);
    __pyx_v_split = __pyx_6;
    __pyx_6 = 0;

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":33 */
    __pyx_7 = __Pyx_GetName(__pyx_m, __pyx_n_closest_pair); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
    __pyx_1 = PyInt_AsSsize_t(__pyx_v_split); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
    __pyx_5 = PySequence_GetSlice(((PyObject *)__pyx_v_points), 0, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_8 = PyObject_CallObject(__pyx_7, __pyx_3); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_9 = PyObject_GetIter(__pyx_8); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
    Py_DECREF(__pyx_8); __pyx_8 = 0;
    __pyx_4 = __Pyx_UnpackItem(__pyx_9); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
    Py_DECREF(__pyx_v_d1);
    __pyx_v_d1 = __pyx_4;
    __pyx_4 = 0;
    __pyx_10 = __Pyx_UnpackItem(__pyx_9); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
    Py_DECREF(__pyx_v_p11);
    __pyx_v_p11 = __pyx_10;
    __pyx_10 = 0;
    __pyx_6 = __Pyx_UnpackItem(__pyx_9); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
    Py_DECREF(__pyx_v_p12);
    __pyx_v_p12 = __pyx_6;
    __pyx_6 = 0;
    if (__Pyx_EndUnpack(__pyx_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
    Py_DECREF(__pyx_9); __pyx_9 = 0;

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":34 */
    __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_closest_pair); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
    __pyx_1 = PyInt_AsSsize_t(__pyx_v_split); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
    __pyx_7 = PySequence_GetSlice(((PyObject *)__pyx_v_points), __pyx_1, PY_SSIZE_T_MAX); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_7);
    __pyx_7 = 0;
    __pyx_8 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_4 = PyObject_GetIter(__pyx_8); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
    Py_DECREF(__pyx_8); __pyx_8 = 0;
    __pyx_10 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
    Py_DECREF(__pyx_v_d2);
    __pyx_v_d2 = __pyx_10;
    __pyx_10 = 0;
    __pyx_6 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
    Py_DECREF(__pyx_v_p21);
    __pyx_v_p21 = __pyx_6;
    __pyx_6 = 0;
    __pyx_9 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
    Py_DECREF(__pyx_v_p22);
    __pyx_v_p22 = __pyx_9;
    __pyx_9 = 0;
    if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":35 */
    __pyx_7 = __Pyx_GetName(__pyx_b, __pyx_n_min); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
    Py_INCREF(__pyx_v_d1);
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_d1);
    Py_INCREF(__pyx_v_d2);
    PyTuple_SET_ITEM(__pyx_5, 1, __pyx_v_d2);
    __pyx_3 = PyObject_CallObject(__pyx_7, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_v_d);
    __pyx_v_d = __pyx_3;
    __pyx_3 = 0;

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":37 */
    __pyx_8 = PyList_New(0); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
    Py_DECREF(__pyx_v_points_in_strip);
    __pyx_v_points_in_strip = __pyx_8;
    __pyx_8 = 0;

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":38 */
    __pyx_10 = PyInt_FromLong(1); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
    __pyx_6 = PyNumber_Subtract(__pyx_v_split, __pyx_10); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
    Py_DECREF(__pyx_10); __pyx_10 = 0;
    __pyx_9 = PyObject_GetItem(((PyObject *)__pyx_v_points), __pyx_6); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_4 = PySequence_GetItem(__pyx_9, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
    Py_DECREF(__pyx_9); __pyx_9 = 0;
    __pyx_7 = PyObject_GetItem(((PyObject *)__pyx_v_points), __pyx_v_split); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
    __pyx_5 = PySequence_GetItem(__pyx_7, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_3 = PyNumber_Add(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    __pyx_8 = PyFloat_FromDouble(2.0); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
    __pyx_10 = PyNumber_Divide(__pyx_3, __pyx_8); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_8); __pyx_8 = 0;
    Py_DECREF(__pyx_v_split_at);
    __pyx_v_split_at = __pyx_10;
    __pyx_10 = 0;

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":39 */
    __pyx_6 = PyObject_GetIter(((PyObject *)__pyx_v_points)); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
    for (;;) {
      __pyx_9 = PyIter_Next(__pyx_6);
      if (!__pyx_9) {
        if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
        break;
      }
      Py_DECREF(__pyx_v_point);
      __pyx_v_point = __pyx_9;
      __pyx_9 = 0;

      /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":40 */
      __pyx_7 = PySequence_GetItem(__pyx_v_point, 0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; goto __pyx_L1;}
      __pyx_4 = PyNumber_Subtract(__pyx_v_split_at, __pyx_v_d); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; goto __pyx_L1;}
      if (PyObject_Cmp(__pyx_7, __pyx_4, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; goto __pyx_L1;}
      __pyx_2 = __pyx_2 < 0;
      Py_DECREF(__pyx_7); __pyx_7 = 0;
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      if (__pyx_2) {
        goto __pyx_L8;
        goto __pyx_L10;
      }
      __pyx_5 = PySequence_GetItem(__pyx_v_point, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; goto __pyx_L1;}
      __pyx_3 = PyNumber_Add(__pyx_v_split_at, __pyx_v_d); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; goto __pyx_L1;}
      if (PyObject_Cmp(__pyx_5, __pyx_3, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; goto __pyx_L1;}
      __pyx_2 = __pyx_2 > 0;
      Py_DECREF(__pyx_5); __pyx_5 = 0;
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      if (__pyx_2) {
        goto __pyx_L9;
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":44 */
      __pyx_8 = PyObject_GetAttr(__pyx_v_points_in_strip, __pyx_n_append); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
      __pyx_10 = PySequence_GetItem(__pyx_v_point, 1); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
      __pyx_9 = PySequence_GetItem(__pyx_v_point, 0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
      __pyx_7 = PySequence_GetItem(__pyx_v_point, 2); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
      __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
      PyTuple_SET_ITEM(__pyx_4, 0, __pyx_10);
      PyTuple_SET_ITEM(__pyx_4, 1, __pyx_9);
      PyTuple_SET_ITEM(__pyx_4, 2, __pyx_7);
      __pyx_10 = 0;
      __pyx_9 = 0;
      __pyx_7 = 0;
      __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
      PyTuple_SET_ITEM(__pyx_5, 0, __pyx_4);
      __pyx_4 = 0;
      __pyx_3 = PyObject_CallObject(__pyx_8, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
      Py_DECREF(__pyx_8); __pyx_8 = 0;
      Py_DECREF(__pyx_5); __pyx_5 = 0;
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      __pyx_L8:;
    }
    __pyx_L9:;
    Py_DECREF(__pyx_6); __pyx_6 = 0;

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":46 */
    __pyx_10 = PyObject_GetAttr(__pyx_v_points_in_strip, __pyx_n_sort); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; goto __pyx_L1;}
    __pyx_9 = PyObject_CallObject(__pyx_10, 0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; goto __pyx_L1;}
    Py_DECREF(__pyx_10); __pyx_10 = 0;
    Py_DECREF(__pyx_9); __pyx_9 = 0;

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":48 */
    __pyx_v_min_d = 0;

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":49 */
    Py_INCREF(Py_None);
    Py_DECREF(__pyx_v_min_p1);
    __pyx_v_min_p1 = Py_None;

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":50 */
    Py_INCREF(Py_None);
    Py_DECREF(__pyx_v_min_p2);
    __pyx_v_min_p2 = Py_None;

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":51 */
    __pyx_1 = PyObject_Length(__pyx_v_points_in_strip); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
    __pyx_7 = PyInt_FromSsize_t(__pyx_1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
    Py_DECREF(__pyx_v_max_i);
    __pyx_v_max_i = __pyx_7;
    __pyx_7 = 0;

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":52 */
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
    Py_INCREF(__pyx_v_points_in_strip);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_points_in_strip);
    __pyx_8 = PyObject_CallObject(((PyObject *)(&PyEnum_Type)), __pyx_4); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __pyx_5 = PyObject_GetIter(__pyx_8); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
    Py_DECREF(__pyx_8); __pyx_8 = 0;
    for (;;) {
      __pyx_3 = PyIter_Next(__pyx_5);
      if (!__pyx_3) {
        if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
        break;
      }
      __pyx_6 = PyObject_GetIter(__pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      __pyx_10 = __Pyx_UnpackItem(__pyx_6); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
      Py_DECREF(__pyx_v_i);
      __pyx_v_i = __pyx_10;
      __pyx_10 = 0;
      __pyx_9 = __Pyx_UnpackItem(__pyx_6); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
      Py_DECREF(__pyx_v_point);
      __pyx_v_point = __pyx_9;
      __pyx_9 = 0;
      if (__Pyx_EndUnpack(__pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
      Py_DECREF(__pyx_6); __pyx_6 = 0;
      __pyx_7 = PyInt_FromLong(1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
      __pyx_4 = PyNumber_Add(__pyx_v_i, __pyx_7); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
      Py_DECREF(__pyx_7); __pyx_7 = 0;
      __pyx_1 = PyInt_AsSsize_t(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      __pyx_8 = __Pyx_GetName(__pyx_b, __pyx_n_min); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
      __pyx_3 = PyInt_FromLong(7); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
      __pyx_10 = PyNumber_Add(__pyx_v_i, __pyx_3); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      __pyx_9 = PyTuple_New(2); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
      Py_INCREF(__pyx_v_max_i);
      PyTuple_SET_ITEM(__pyx_9, 0, __pyx_v_max_i);
      PyTuple_SET_ITEM(__pyx_9, 1, __pyx_10);
      __pyx_10 = 0;
      __pyx_6 = PyObject_CallObject(__pyx_8, __pyx_9); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
      Py_DECREF(__pyx_8); __pyx_8 = 0;
      Py_DECREF(__pyx_9); __pyx_9 = 0;
      __pyx_13 = PyInt_AsSsize_t(__pyx_6); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
      Py_DECREF(__pyx_6); __pyx_6 = 0;
      __pyx_7 = PySequence_GetSlice(__pyx_v_points_in_strip, __pyx_1, __pyx_13); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
      __pyx_4 = PyObject_GetIter(__pyx_7); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
      Py_DECREF(__pyx_7); __pyx_7 = 0;
      for (;;) {
        __pyx_3 = PyIter_Next(__pyx_4);
        if (!__pyx_3) {
          if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
          break;
        }
        Py_DECREF(__pyx_v_point2);
        __pyx_v_point2 = __pyx_3;
        __pyx_3 = 0;

        /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":54 */
        __pyx_10 = __Pyx_GetName(__pyx_m, __pyx_n_distance); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;}
        __pyx_8 = PySequence_GetItem(__pyx_v_point, 0); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;}
        __pyx_9 = PySequence_GetItem(__pyx_v_point, 1); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;}
        __pyx_6 = PySequence_GetItem(__pyx_v_point2, 0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;}
        __pyx_7 = PySequence_GetItem(__pyx_v_point2, 1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;}
        __pyx_3 = PyTuple_New(4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;}
        PyTuple_SET_ITEM(__pyx_3, 0, __pyx_8);
        PyTuple_SET_ITEM(__pyx_3, 1, __pyx_9);
        PyTuple_SET_ITEM(__pyx_3, 2, __pyx_6);
        PyTuple_SET_ITEM(__pyx_3, 3, __pyx_7);
        __pyx_8 = 0;
        __pyx_9 = 0;
        __pyx_6 = 0;
        __pyx_7 = 0;
        __pyx_8 = PyObject_CallObject(__pyx_10, __pyx_3); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;}
        Py_DECREF(__pyx_10); __pyx_10 = 0;
        Py_DECREF(__pyx_3); __pyx_3 = 0;
        Py_DECREF(__pyx_v_sd);
        __pyx_v_sd = __pyx_8;
        __pyx_8 = 0;

        /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":55 */
        __pyx_2 = (__pyx_v_min_d == 0);
        if (!__pyx_2) {
          __pyx_9 = PyFloat_FromDouble(__pyx_v_min_d); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; goto __pyx_L1;}
          if (PyObject_Cmp(__pyx_9, __pyx_v_sd, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; goto __pyx_L1;}
          __pyx_2 = __pyx_2 > 0;
          Py_DECREF(__pyx_9); __pyx_9 = 0;
        }
        if (__pyx_2) {

          /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":56 */
          __pyx_11 = PyFloat_AsDouble(__pyx_v_sd); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; goto __pyx_L1;}
          __pyx_v_min_d = __pyx_11;

          /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":57 */
          __pyx_6 = PySequence_GetItem(__pyx_v_point, 1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
          __pyx_7 = PySequence_GetItem(__pyx_v_point, 0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
          __pyx_10 = PySequence_GetItem(__pyx_v_point, 2); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
          __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
          PyTuple_SET_ITEM(__pyx_3, 0, __pyx_6);
          PyTuple_SET_ITEM(__pyx_3, 1, __pyx_7);
          PyTuple_SET_ITEM(__pyx_3, 2, __pyx_10);
          __pyx_6 = 0;
          __pyx_7 = 0;
          __pyx_10 = 0;
          Py_DECREF(__pyx_v_min_p1);
          __pyx_v_min_p1 = __pyx_3;
          __pyx_3 = 0;

          /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":58 */
          __pyx_8 = PySequence_GetItem(__pyx_v_point2, 1); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
          __pyx_9 = PySequence_GetItem(__pyx_v_point2, 0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
          __pyx_6 = PySequence_GetItem(__pyx_v_point2, 2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
          __pyx_7 = PyTuple_New(3); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
          PyTuple_SET_ITEM(__pyx_7, 0, __pyx_8);
          PyTuple_SET_ITEM(__pyx_7, 1, __pyx_9);
          PyTuple_SET_ITEM(__pyx_7, 2, __pyx_6);
          __pyx_8 = 0;
          __pyx_9 = 0;
          __pyx_6 = 0;
          Py_DECREF(__pyx_v_min_p2);
          __pyx_v_min_p2 = __pyx_7;
          __pyx_7 = 0;
          goto __pyx_L15;
        }
        __pyx_L15:;
      }
      Py_DECREF(__pyx_4); __pyx_4 = 0;
    }
    Py_DECREF(__pyx_5); __pyx_5 = 0;

    /* "/home/andrew/Programs/cluster/clusterer/closestpair.pyx":59 */
    __pyx_2 = (__pyx_v_min_d != 0);
    if (__pyx_2) {
      __pyx_10 = PyFloat_FromDouble(__pyx_v_min_d); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
      if (PyObject_Cmp(__pyx_10, __pyx_v_d, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
      __pyx_2 = __pyx_2 < 0;
      Py_DECREF(__pyx_10); __pyx_10 = 0;
    }
    if (__pyx_2) {
      __pyx_3 = PyFloat_FromDouble(__pyx_v_min_d); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;}
      __pyx_8 = PyTuple_New(3); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;}
      PyTuple_SET_ITEM(__pyx_8, 0, __pyx_3);
      Py_INCREF(__pyx_v_min_p1);
      PyTuple_SET_ITEM(__pyx_8, 1, __pyx_v_min_p1);
      Py_INCREF(__pyx_v_min_p2);
      PyTuple_SET_ITEM(__pyx_8, 2, __pyx_v_min_p2);
      __pyx_3 = 0;
      __pyx_r = __pyx_8;
      __pyx_8 = 0;
      goto __pyx_L0;
      goto __pyx_L16;
    }
    if (PyObject_Cmp(__pyx_v_d1, __pyx_v_d2, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
    __pyx_2 = __pyx_2 < 0;
    if (__pyx_2) {
      __pyx_9 = PyTuple_New(3); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; goto __pyx_L1;}
      Py_INCREF(__pyx_v_d1);
      PyTuple_SET_ITEM(__pyx_9, 0, __pyx_v_d1);
      Py_INCREF(__pyx_v_p11);
      PyTuple_SET_ITEM(__pyx_9, 1, __pyx_v_p11);
      Py_INCREF(__pyx_v_p12);
      PyTuple_SET_ITEM(__pyx_9, 2, __pyx_v_p12);
      __pyx_r = __pyx_9;
      __pyx_9 = 0;
      goto __pyx_L0;
      goto __pyx_L16;
    }
    /*else*/ {
      __pyx_6 = PyTuple_New(3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
      Py_INCREF(__pyx_v_d2);
      PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_d2);
      Py_INCREF(__pyx_v_p21);
      PyTuple_SET_ITEM(__pyx_6, 1, __pyx_v_p21);
      Py_INCREF(__pyx_v_p22);
      PyTuple_SET_ITEM(__pyx_6, 2, __pyx_v_p22);
      __pyx_r = __pyx_6;
      __pyx_6 = 0;
      goto __pyx_L0;
    }
    __pyx_L16:;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  Py_XDECREF(__pyx_8);
  Py_XDECREF(__pyx_9);
  Py_XDECREF(__pyx_10);
  __Pyx_AddTraceback("closestpair.closest_pair");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_min_p1);
  Py_DECREF(__pyx_v_min_p2);
  Py_DECREF(__pyx_v_i);
  Py_DECREF(__pyx_v_point);
  Py_DECREF(__pyx_v_point2);
  Py_DECREF(__pyx_v_d);
  Py_DECREF(__pyx_v_split);
  Py_DECREF(__pyx_v_d1);
  Py_DECREF(__pyx_v_p11);
  Py_DECREF(__pyx_v_p12);
  Py_DECREF(__pyx_v_d2);
  Py_DECREF(__pyx_v_p21);
  Py_DECREF(__pyx_v_p22);
  Py_DECREF(__pyx_v_points_in_strip);
  Py_DECREF(__pyx_v_split_at);
  Py_DECREF(__pyx_v_max_i);
  Py_DECREF(__pyx_v_sd);
  Py_DECREF(__pyx_v_points);
  return __pyx_r;
}
/* Implementation of setup */
static char __pyx_k_4[] = "create_deformation.py";
static char __pyx_k_7[] = "cython_code.pyx";
static char __pyx_k___main__[] = "__main__";
static PyObject *__pyx_kp___main__;
static char __pyx_k_1[] = "distutils.core";
static PyObject *__pyx_kp_1;
static char __pyx_k_setup[] = "setup";
static PyObject *__pyx_kp_setup;
static char __pyx_k_2[] = "distutils.extension";
static PyObject *__pyx_kp_2;
static char __pyx_k_Extension[] = "Extension";
static PyObject *__pyx_kp_Extension;
static char __pyx_k_3[] = "Cython.Distutils";
static PyObject *__pyx_kp_3;
static char __pyx_k_build_ext[] = "build_ext";
static PyObject *__pyx_kp_build_ext;
static char __pyx_k_numpy[] = "numpy";
static PyObject *__pyx_kp_numpy;
static char __pyx_k_scripts[] = "scripts";
static PyObject *__pyx_kp_scripts;
static char __pyx_k_cmdclass[] = "cmdclass";
static PyObject *__pyx_kp_cmdclass;
static char __pyx_k_5[] = "build_ext";
static PyObject *__pyx_kp_5;
static char __pyx_k_ext_modules[] = "ext_modules";
static PyObject *__pyx_kp_ext_modules;
static char __pyx_k_6[] = "cython_code";
static PyObject *__pyx_kp_6;
static char __pyx_k_include_dirs[] = "include_dirs";
static PyObject *__pyx_kp_include_dirs;
static char __pyx_k_get_include[] = "get_include";
static PyObject *__pyx_kp_get_include;
static PyObject *__pyx_kp_4;
static PyObject *__pyx_kp_7;

static struct PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

static void __pyx_init_filenames(void); /*proto*/

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("setup"),
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp___main__, __pyx_k___main__, sizeof(__pyx_k___main__), 1, 1, 1},
  {&__pyx_kp_1, __pyx_k_1, sizeof(__pyx_k_1), 1, 1, 1},
  {&__pyx_kp_setup, __pyx_k_setup, sizeof(__pyx_k_setup), 1, 1, 1},
  {&__pyx_kp_2, __pyx_k_2, sizeof(__pyx_k_2), 1, 1, 1},
  {&__pyx_kp_Extension, __pyx_k_Extension, sizeof(__pyx_k_Extension), 1, 1, 1},
  {&__pyx_kp_3, __pyx_k_3, sizeof(__pyx_k_3), 1, 1, 1},
  {&__pyx_kp_build_ext, __pyx_k_build_ext, sizeof(__pyx_k_build_ext), 1, 1, 1},
  {&__pyx_kp_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 1, 1, 1},
  {&__pyx_kp_scripts, __pyx_k_scripts, sizeof(__pyx_k_scripts), 1, 1, 1},
  {&__pyx_kp_cmdclass, __pyx_k_cmdclass, sizeof(__pyx_k_cmdclass), 1, 1, 1},
  {&__pyx_kp_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 1, 0},
  {&__pyx_kp_ext_modules, __pyx_k_ext_modules, sizeof(__pyx_k_ext_modules), 1, 1, 1},
  {&__pyx_kp_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 1, 0},
  {&__pyx_kp_include_dirs, __pyx_k_include_dirs, sizeof(__pyx_k_include_dirs), 1, 1, 1},
  {&__pyx_kp_get_include, __pyx_k_get_include, sizeof(__pyx_k_get_include), 1, 1, 1},
  {&__pyx_kp_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 0},
  {&__pyx_kp_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 0},
  {0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  return 0;
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initsetup(void); /*proto*/
PyMODINIT_FUNC initsetup(void)
#else
PyMODINIT_FUNC PyInit_setup(void); /*proto*/
PyMODINIT_FUNC PyInit_setup(void)
#endif
{
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef CYTHON_REFNANNY
  void* __pyx_refchk = NULL;
  __Pyx_Refnanny = __Pyx_ImportRefcountAPI("refnanny");
  if (!__Pyx_Refnanny) {
      PyErr_Clear();
      __Pyx_Refnanny = __Pyx_ImportRefcountAPI("Cython.Runtime.refnanny");
      if (!__Pyx_Refnanny)
          Py_FatalError("failed to import refnanny module");
  }
  __pyx_refchk = __Pyx_Refnanny->NewContext("PyMODINIT_FUNC PyInit_setup(void)", __LINE__, __FILE__);
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Library function declarations ---*/
  __pyx_init_filenames();
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("setup"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  #if PY_MAJOR_VERSION < 3
  Py_INCREF(__pyx_m);
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__pyx_module_is_main_setup) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_kp___main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_skip_dispatch = 0;
  /*--- Global init code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  /*--- Type import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "/micehome/matthijs/bazaar/assess-registration/scripts/setup.py":3
 * #!/usr/bin/env python
 * 
 * from distutils.core import setup             # <<<<<<<<<<<<<<
 * from distutils.extension import Extension
 * from Cython.Distutils import build_ext
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_kp_setup);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_setup);
  __Pyx_GIVEREF(__pyx_kp_setup);
  __pyx_1 = __Pyx_Import(__pyx_kp_1, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_setup); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_kp_setup, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/micehome/matthijs/bazaar/assess-registration/scripts/setup.py":4
 * 
 * from distutils.core import setup
 * from distutils.extension import Extension             # <<<<<<<<<<<<<<
 * from Cython.Distutils import build_ext
 * import numpy
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_kp_Extension);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_Extension);
  __Pyx_GIVEREF(__pyx_kp_Extension);
  __pyx_1 = __Pyx_Import(__pyx_kp_2, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_Extension); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_kp_Extension, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/micehome/matthijs/bazaar/assess-registration/scripts/setup.py":5
 * from distutils.core import setup
 * from distutils.extension import Extension
 * from Cython.Distutils import build_ext             # <<<<<<<<<<<<<<
 * import numpy
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_kp_build_ext);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_build_ext);
  __Pyx_GIVEREF(__pyx_kp_build_ext);
  __pyx_1 = __Pyx_Import(__pyx_kp_3, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_build_ext); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_kp_build_ext, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/micehome/matthijs/bazaar/assess-registration/scripts/setup.py":6
 * from distutils.extension import Extension
 * from Cython.Distutils import build_ext
 * import numpy             # <<<<<<<<<<<<<<
 * 
 * setup(
 */
  __pyx_1 = __Pyx_Import(__pyx_kp_numpy, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_kp_numpy, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/micehome/matthijs/bazaar/assess-registration/scripts/setup.py":8
 * import numpy
 * 
 * setup(             # <<<<<<<<<<<<<<
 *     scripts=["create_deformation.py"],
 *     cmdclass = {'build_ext': build_ext},
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_setup); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_2);
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_1));

  /* "/micehome/matthijs/bazaar/assess-registration/scripts/setup.py":9
 * 
 * setup(
 *     scripts=["create_deformation.py"],             # <<<<<<<<<<<<<<
 *     cmdclass = {'build_ext': build_ext},
 *     ext_modules = [Extension("cython_code", ["cython_code.pyx"],
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_kp_4);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_4);
  __Pyx_GIVEREF(__pyx_kp_4);
  if (PyDict_SetItem(__pyx_1, __pyx_kp_scripts, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "/micehome/matthijs/bazaar/assess-registration/scripts/setup.py":10
 * setup(
 *     scripts=["create_deformation.py"],
 *     cmdclass = {'build_ext': build_ext},             # <<<<<<<<<<<<<<
 *     ext_modules = [Extension("cython_code", ["cython_code.pyx"],
 *                    include_dirs = [numpy.get_include()])]
 */
  __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_3));
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_build_ext); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_4);
  if (PyDict_SetItem(__pyx_3, __pyx_kp_5, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
  if (PyDict_SetItem(__pyx_1, __pyx_kp_cmdclass, ((PyObject *)__pyx_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;

  /* "/micehome/matthijs/bazaar/assess-registration/scripts/setup.py":11
 *     scripts=["create_deformation.py"],
 *     cmdclass = {'build_ext': build_ext},
 *     ext_modules = [Extension("cython_code", ["cython_code.pyx"],             # <<<<<<<<<<<<<<
 *                    include_dirs = [numpy.get_include()])]
 * )
 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_Extension); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_4);
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_kp_7);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_7);
  __Pyx_GIVEREF(__pyx_kp_7);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_kp_6);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_6);
  __Pyx_GIVEREF(__pyx_kp_6);
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_1 = 0;
  __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_3));

  /* "/micehome/matthijs/bazaar/assess-registration/scripts/setup.py":12
 *     cmdclass = {'build_ext': build_ext},
 *     ext_modules = [Extension("cython_code", ["cython_code.pyx"],
 *                    include_dirs = [numpy.get_include()])]             # <<<<<<<<<<<<<<
 * )
 */
  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_numpy); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_5);
  __pyx_t_1 = PyObject_GetAttr(__pyx_5, __pyx_kp_get_include); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_3, __pyx_kp_include_dirs, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_4, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_1, __pyx_kp_ext_modules, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_1);
  __Pyx_XDECREF(__pyx_2);
  __Pyx_XDECREF(__pyx_3);
  __Pyx_XDECREF(__pyx_4);
  __Pyx_XDECREF(__pyx_5);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("setup");
  Py_DECREF(__pyx_m); __pyx_m = 0;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}
예제 #15
0
파일: Stemmer.c 프로젝트: buriy/pystemmer
  /*else*/ {
    __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n___purgeCache); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;}
    __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
  }
  __pyx_L2:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("Stemmer.Stemmer.maxCacheSize.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_7Stemmer_7Stemmer_12maxCacheSize___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_7Stemmer_7Stemmer_12maxCacheSize___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);
  __pyx_1 = PyInt_FromLong(((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->max_cache_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("Stemmer.Stemmer.maxCacheSize.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_7Stemmer_7Stemmer___purgeCache(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7Stemmer_7Stemmer___purgeCache(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_newcache;
  PyObject *__pyx_v_mincounter;
  PyObject *__pyx_v_word;
  PyObject *__pyx_v_cacheditem;
  PyObject *__pyx_r;
  Py_ssize_t __pyx_1;
  int __pyx_2;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);
  __pyx_v_newcache = Py_None; Py_INCREF(Py_None);
  __pyx_v_mincounter = Py_None; Py_INCREF(Py_None);
  __pyx_v_word = Py_None; Py_INCREF(Py_None);
  __pyx_v_cacheditem = Py_None; Py_INCREF(Py_None);

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":149 */
  __pyx_1 = PyObject_Length(((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->cache); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;}
  __pyx_2 = (__pyx_1 < ((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->max_cache_size);
  if (__pyx_2) {
    __pyx_r = Py_None; Py_INCREF(Py_None);
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":151 */
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;}
  Py_DECREF(__pyx_v_newcache);
  __pyx_v_newcache = __pyx_3;
  __pyx_3 = 0;

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":152 */
  __pyx_3 = PyInt_FromLong(((((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->max_cache_size * 8) / 10)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(((PyObject *)(&PyInt_Type)), __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyNumber_Subtract(((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->counter, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_mincounter);
  __pyx_v_mincounter = __pyx_4;
  __pyx_4 = 0;

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":153 */
  __pyx_3 = PyObject_GetAttr(((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->cache, __pyx_n_iteritems); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;}
  __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyObject_GetIter(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  for (;;) {
    __pyx_4 = PyIter_Next(__pyx_3);
    if (!__pyx_4) {
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;}
      break;
    }
    __pyx_5 = PyObject_GetIter(__pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __pyx_4 = __Pyx_UnpackItem(__pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;}
    Py_DECREF(__pyx_v_word);
    __pyx_v_word = __pyx_4;
    __pyx_4 = 0;
    __pyx_4 = __Pyx_UnpackItem(__pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;}
    Py_DECREF(__pyx_v_cacheditem);
    __pyx_v_cacheditem = __pyx_4;
    __pyx_4 = 0;
    if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    __pyx_4 = __Pyx_GetItemInt(__pyx_v_cacheditem, 1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; goto __pyx_L1;}
    if (PyObject_Cmp(__pyx_4, __pyx_v_mincounter, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; goto __pyx_L1;}
    __pyx_2 = __pyx_2 > 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    if (__pyx_2) {
      if (PyObject_SetItem(__pyx_v_newcache, __pyx_v_word, __pyx_v_cacheditem) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; goto __pyx_L1;}
      goto __pyx_L5;
    }
    __pyx_L5:;
  }
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":156 */
  Py_INCREF(__pyx_v_newcache);
  Py_DECREF(((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->cache);
  ((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->cache = __pyx_v_newcache;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("Stemmer.Stemmer.__purgeCache");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_newcache);
  Py_DECREF(__pyx_v_mincounter);
  Py_DECREF(__pyx_v_word);
  Py_DECREF(__pyx_v_cacheditem);
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}
예제 #16
0
파일: index.c 프로젝트: jwilk/Pyrex
/* Implementation of index */

static PyObject *__pyx_f_5index_f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5index_f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_obj1 = 0;
    PyObject *__pyx_v_obj2 = 0;
    PyObject *__pyx_v_obj3 = 0;
    int __pyx_v_int1;
    int __pyx_v_int2;
    int __pyx_v_int3;
    float __pyx_v_flt1;
    float *__pyx_v_ptr1;
    int __pyx_v_array1[42];
    PyObject *__pyx_r;
    PyObject *__pyx_1 = 0;
    Py_ssize_t __pyx_2;
    PyObject *__pyx_3 = 0;
    static char *__pyx_argnames[] = {"obj1","obj2","obj3",0};
    if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_obj1, &__pyx_v_obj2, &__pyx_v_obj3)) return 0;
    Py_INCREF(__pyx_v_obj1);
    Py_INCREF(__pyx_v_obj2);
    Py_INCREF(__pyx_v_obj3);

    /* "/Local/Projects/D/Pyrex/Source/Tests/2/index.pyx":5 */
    __pyx_v_int1 = (__pyx_v_array1[__pyx_v_int2]);

    /* "/Local/Projects/D/Pyrex/Source/Tests/2/index.pyx":6 */
    __pyx_v_flt1 = (__pyx_v_ptr1[__pyx_v_int2]);

    /* "/Local/Projects/D/Pyrex/Source/Tests/2/index.pyx":7 */
    (__pyx_v_array1[__pyx_v_int1]) = __pyx_v_int2;

    /* "/Local/Projects/D/Pyrex/Source/Tests/2/index.pyx":8 */
    (__pyx_v_ptr1[__pyx_v_int1]) = __pyx_v_int2;

    /* "/Local/Projects/D/Pyrex/Source/Tests/2/index.pyx":9 */
    __pyx_1 = PyObject_GetItem(__pyx_v_obj2, __pyx_v_obj3);
    if (!__pyx_1) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 9;
        goto __pyx_L1;
    }
    Py_DECREF(__pyx_v_obj1);
    __pyx_v_obj1 = __pyx_1;
    __pyx_1 = 0;

    /* "/Local/Projects/D/Pyrex/Source/Tests/2/index.pyx":10 */
    __pyx_2 = PyInt_AsSsize_t(__pyx_v_obj3);
    if (PyErr_Occurred()) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 10;
        goto __pyx_L1;
    }
    __pyx_v_int1 = (__pyx_v_array1[__pyx_2]);

    /* "/Local/Projects/D/Pyrex/Source/Tests/2/index.pyx":11 */
    __pyx_1 = PyInt_FromLong(__pyx_v_int3);
    if (!__pyx_1) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 11;
        goto __pyx_L1;
    }
    __pyx_3 = PyObject_GetItem(__pyx_v_obj2, __pyx_1);
    if (!__pyx_3) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 11;
        goto __pyx_L1;
    }
    Py_DECREF(__pyx_1);
    __pyx_1 = 0;
    Py_DECREF(__pyx_v_obj1);
    __pyx_v_obj1 = __pyx_3;
    __pyx_3 = 0;

    /* "/Local/Projects/D/Pyrex/Source/Tests/2/index.pyx":12 */
    if (PyObject_SetItem(__pyx_v_obj1, __pyx_v_obj2, __pyx_v_obj3) < 0) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 12;
        goto __pyx_L1;
    }

    /* "/Local/Projects/D/Pyrex/Source/Tests/2/index.pyx":13 */
    __pyx_2 = PyInt_AsSsize_t(__pyx_v_obj2);
    if (PyErr_Occurred()) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 13;
        goto __pyx_L1;
    }
    (__pyx_v_array1[__pyx_2]) = __pyx_v_int3;

    /* "/Local/Projects/D/Pyrex/Source/Tests/2/index.pyx":14 */
    __pyx_1 = PyInt_FromLong(__pyx_v_int2);
    if (!__pyx_1) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 14;
        goto __pyx_L1;
    }
    if (PyObject_SetItem(__pyx_v_obj1, __pyx_1, __pyx_v_obj3) < 0) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 14;
        goto __pyx_L1;
    }
    Py_DECREF(__pyx_1);
    __pyx_1 = 0;

    /* "/Local/Projects/D/Pyrex/Source/Tests/2/index.pyx":15 */
    __pyx_3 = PyInt_FromLong(42);
    if (!__pyx_3) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 15;
        goto __pyx_L1;
    }
    if (PyObject_SetItem(__pyx_v_obj1, __pyx_v_obj2, __pyx_3) < 0) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 15;
        goto __pyx_L1;
    }
    Py_DECREF(__pyx_3);
    __pyx_3 = 0;

    __pyx_r = Py_None;
    Py_INCREF(Py_None);
    goto __pyx_L0;
__pyx_L1:
    ;
    Py_XDECREF(__pyx_1);
    Py_XDECREF(__pyx_3);
    __Pyx_AddTraceback("index.f");
    __pyx_r = 0;
__pyx_L0:
    ;
    Py_DECREF(__pyx_v_obj1);
    Py_DECREF(__pyx_v_obj2);
    Py_DECREF(__pyx_v_obj3);
    return __pyx_r;
}
예제 #17
0
파일: Stemmer.c 프로젝트: buriy/pystemmer
static PyObject *__pyx_f_7Stemmer_7Stemmer_stemWord(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_word = 0;
  char *__pyx_v_c_word;
  PyObject *__pyx_v_was_unicode;
  PyObject *__pyx_v_cacheditem;
  PyObject *__pyx_v_result;
  PyObject *__pyx_v_length;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  char *__pyx_5;
  Py_ssize_t __pyx_6;
  PyObject *__pyx_7 = 0;
  PyObject *__pyx_8 = 0;
  static char *__pyx_argnames[] = {"word",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_word)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_word);
  __pyx_v_was_unicode = Py_None; Py_INCREF(Py_None);
  __pyx_v_cacheditem = Py_None; Py_INCREF(Py_None);
  __pyx_v_result = Py_None; Py_INCREF(Py_None);
  __pyx_v_length = Py_None; Py_INCREF(Py_None);

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":171 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;}
  Py_DECREF(__pyx_v_was_unicode);
  __pyx_v_was_unicode = __pyx_1;
  __pyx_1 = 0;

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":172 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_unicode); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;}
  __pyx_2 = PyObject_IsInstance(__pyx_v_word,__pyx_1); if (__pyx_2 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_2) {

    /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":173 */
    __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;}
    Py_DECREF(__pyx_v_was_unicode);
    __pyx_v_was_unicode = __pyx_1;
    __pyx_1 = 0;

    /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":174 */
    __pyx_1 = PyObject_GetAttr(__pyx_v_word, __pyx_n_encode); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
    Py_INCREF(__pyx_k9p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k9p);
    __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_v_word);
    __pyx_v_word = __pyx_4;
    __pyx_4 = 0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":176 */
  __pyx_2 = (((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->max_cache_size > 0);
  if (__pyx_2) {
    /*try:*/ {

      /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":178 */
      __pyx_1 = PyObject_GetItem(((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->cache, __pyx_v_word); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L4;}
      Py_DECREF(__pyx_v_cacheditem);
      __pyx_v_cacheditem = __pyx_1;
      __pyx_1 = 0;

      /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":179 */
      __pyx_3 = __Pyx_GetItemInt(__pyx_v_cacheditem, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L4;}
      Py_DECREF(__pyx_v_result);
      __pyx_v_result = __pyx_3;
      __pyx_3 = 0;

      /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":180 */
      if (__Pyx_SetItemInt(__pyx_v_cacheditem, 1, ((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->counter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L4;}

      /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":181 */
      __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L4;}
      __pyx_1 = PyNumber_Add(((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->counter, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L4;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      Py_DECREF(((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->counter);
      ((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->counter = __pyx_1;
      __pyx_1 = 0;
    }
    goto __pyx_L5;
    __pyx_L4:;
    Py_XDECREF(__pyx_3); __pyx_3 = 0;
    Py_XDECREF(__pyx_4); __pyx_4 = 0;
    Py_XDECREF(__pyx_1); __pyx_1 = 0;

    /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":182 */
    __pyx_2 = PyErr_ExceptionMatches(PyExc_KeyError);
    if (__pyx_2) {
      __Pyx_AddTraceback("Stemmer.stemWord");
      if (__Pyx_GetException(&__pyx_3, &__pyx_4, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}

      /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":183 */
      __pyx_5 = PyString_AsString(__pyx_v_word); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;}
      __pyx_v_c_word = __pyx_5;

      /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":184 */
      __pyx_6 = PyObject_Length(__pyx_v_word); if (__pyx_6 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;}
      __pyx_v_c_word = ((char *)sb_stemmer_stem(((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->cobj,((sb_symbol *)__pyx_v_c_word),__pyx_6));

      /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":185 */
      __pyx_7 = PyInt_FromLong(sb_stemmer_length(((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->cobj)); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;}
      Py_DECREF(__pyx_v_length);
      __pyx_v_length = __pyx_7;
      __pyx_7 = 0;

      /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":186 */
      __pyx_2 = PyInt_AsLong(__pyx_v_length); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
      __pyx_7 = PyString_FromStringAndSize(__pyx_v_c_word,__pyx_2); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
      Py_DECREF(__pyx_v_result);
      __pyx_v_result = __pyx_7;
      __pyx_7 = 0;

      /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":187 */
      __pyx_7 = PyList_New(2); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
      Py_INCREF(__pyx_v_result);
      PyList_SET_ITEM(__pyx_7, 0, __pyx_v_result);
      Py_INCREF(((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->counter);
      PyList_SET_ITEM(__pyx_7, 1, ((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->counter);
      if (PyObject_SetItem(((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->cache, __pyx_v_word, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
      Py_DECREF(__pyx_7); __pyx_7 = 0;

      /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":188 */
      __pyx_7 = PyInt_FromLong(1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
      __pyx_8 = PyNumber_Add(((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->counter, __pyx_7); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
      Py_DECREF(__pyx_7); __pyx_7 = 0;
      Py_DECREF(((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->counter);
      ((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->counter = __pyx_8;
      __pyx_8 = 0;

      /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":189 */
      __pyx_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n___purgeCache); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;}
      __pyx_8 = PyObject_CallObject(__pyx_7, 0); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;}
      Py_DECREF(__pyx_7); __pyx_7 = 0;
      Py_DECREF(__pyx_8); __pyx_8 = 0;
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      goto __pyx_L5;
    }
    goto __pyx_L1;
    __pyx_L5:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":191 */
    __pyx_5 = PyString_AsString(__pyx_v_word); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;}
    __pyx_v_c_word = __pyx_5;

    /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":192 */
    __pyx_6 = PyObject_Length(__pyx_v_word); if (__pyx_6 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;}
    __pyx_v_c_word = ((char *)sb_stemmer_stem(((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->cobj,((sb_symbol *)__pyx_v_c_word),__pyx_6));

    /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":193 */
    __pyx_7 = PyInt_FromLong(sb_stemmer_length(((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->cobj)); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;}
    Py_DECREF(__pyx_v_length);
    __pyx_v_length = __pyx_7;
    __pyx_7 = 0;

    /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":194 */
    __pyx_2 = PyInt_AsLong(__pyx_v_length); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}
    __pyx_8 = PyString_FromStringAndSize(__pyx_v_c_word,__pyx_2); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}
    Py_DECREF(__pyx_v_result);
    __pyx_v_result = __pyx_8;
    __pyx_8 = 0;
  }
  __pyx_L3:;

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":196 */
  __pyx_2 = PyObject_IsTrue(__pyx_v_was_unicode); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
  if (__pyx_2) {
    __pyx_3 = PyObject_GetAttr(__pyx_v_result, __pyx_n_decode); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
    Py_INCREF(__pyx_k9p);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k9p);
    __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __pyx_r = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":198 */
  Py_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_7);
  Py_XDECREF(__pyx_8);
  __Pyx_AddTraceback("Stemmer.Stemmer.stemWord");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_was_unicode);
  Py_DECREF(__pyx_v_cacheditem);
  Py_DECREF(__pyx_v_result);
  Py_DECREF(__pyx_v_length);
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_word);
  return __pyx_r;
}
예제 #18
0
파일: cforfromloop.c 프로젝트: jwilk/Pyrex
/* Implementation of cforfromloop */

static struct PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

static void __pyx_init_filenames(void); /*proto*/

PyMODINIT_FUNC initcforfromloop(void); /*proto*/
PyMODINIT_FUNC initcforfromloop(void) {
  long __pyx_1;
  PyObject *__pyx_2 = 0;
  long __pyx_3;
  int __pyx_4;
  __pyx_init_filenames();
  __pyx_m = Py_InitModule4("cforfromloop", __pyx_methods, 0, 0, PYTHON_API_VERSION);
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
  Py_INCREF(__pyx_m);
  __pyx_b = PyImport_AddModule("__builtin__");
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
  __pyx_v_12cforfromloop_a = Py_None; Py_INCREF(Py_None);
  __pyx_v_12cforfromloop_b = Py_None; Py_INCREF(Py_None);
  __pyx_v_12cforfromloop_x = Py_None; Py_INCREF(Py_None);

  /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":4 */
  for (__pyx_v_12cforfromloop_i = 0; __pyx_v_12cforfromloop_i < 10; ++__pyx_v_12cforfromloop_i) {
  }

  /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":7 */
  for (__pyx_v_12cforfromloop_i = 0+1; __pyx_v_12cforfromloop_i <= 10; ++__pyx_v_12cforfromloop_i) {
  }

  /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":10 */
  for (__pyx_v_12cforfromloop_i = 10; __pyx_v_12cforfromloop_i > 0; --__pyx_v_12cforfromloop_i) {
  }

  /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":13 */
  for (__pyx_v_12cforfromloop_i = 10-1; __pyx_v_12cforfromloop_i >= 0; --__pyx_v_12cforfromloop_i) {
  }

  /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":16 */
  for (__pyx_1 = 0; __pyx_1 <= 10; ++__pyx_1) {
    __pyx_2 = PyInt_FromLong(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
    Py_DECREF(__pyx_v_12cforfromloop_x);
    __pyx_v_12cforfromloop_x = __pyx_2;
    __pyx_2 = 0;
  }

  /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":19 */
  __pyx_1 = PyInt_AsLong(__pyx_v_12cforfromloop_a); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
  __pyx_3 = PyInt_AsLong(__pyx_v_12cforfromloop_b); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
  for (__pyx_v_12cforfromloop_i = __pyx_1; __pyx_v_12cforfromloop_i <= __pyx_3; ++__pyx_v_12cforfromloop_i) {
  }

  /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":22 */
  for (__pyx_v_12cforfromloop_i = __pyx_v_12cforfromloop_k; __pyx_v_12cforfromloop_i <= __pyx_v_12cforfromloop_j; ++__pyx_v_12cforfromloop_i) {
  }

  /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":25 */
  __pyx_1 = (__pyx_v_12cforfromloop_j / 18);
  for (__pyx_v_12cforfromloop_i = (__pyx_v_12cforfromloop_k * 42); __pyx_v_12cforfromloop_i <= __pyx_1; ++__pyx_v_12cforfromloop_i) {
  }

  /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":28 */
  while (1) {
    __pyx_4 = __pyx_v_12cforfromloop_j;
    if (!__pyx_4) break;
    for (__pyx_v_12cforfromloop_i = 0; __pyx_v_12cforfromloop_i <= 10; ++__pyx_v_12cforfromloop_i) {

      /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":30 */
      goto __pyx_L20;

      /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":31 */
      goto __pyx_L21;
      __pyx_L20:;
    }
    /*else*/ {

      /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":33 */
      goto __pyx_L18;

      /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":34 */
      goto __pyx_L19;
    }
    __pyx_L21:;
    __pyx_L18:;
  }
  __pyx_L19:;
  return;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("cforfromloop");
}
예제 #19
0
/* Implementation of hellow */
static char __pyx_k_1[] = "Hello World";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;

static struct PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

static void __pyx_init_filenames(void); /*proto*/

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("hellow"),
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  return 0;
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC inithellow(void); /*proto*/
PyMODINIT_FUNC inithellow(void)
#else
PyMODINIT_FUNC PyInit_hellow(void); /*proto*/
PyMODINIT_FUNC PyInit_hellow(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  #if CYTHON_REFNANNY
  void* __pyx_refnanny = NULL;
  __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");
  }
  __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_hellow(void)", __LINE__, __FILE__);
  #endif
  __pyx_init_filenames();
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION < 3
  __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #else
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("hellow"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  #if PY_MAJOR_VERSION < 3
  Py_INCREF(__pyx_m);
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_hellow) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  /*--- Type import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "C:\Documents and Settings\wflynn\My Documents\workspace\spinwaves_git\spinwaves\cross_section\util\hellow.pyx":1
 * print "Hello World"             # <<<<<<<<<<<<<<
 */
  if (__Pyx_PrintOne(((PyObject *)__pyx_kp_s_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  if (__pyx_m) {
    __Pyx_AddTraceback("init hellow");
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init hellow");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}
예제 #20
0
  /* "/home/sean/Projects/WorldMill/src/mill/workspace.pyx":20
 *     def __init__(self, path):
 *         self.path = path
 *         self._collections = None             # <<<<<<<<<<<<<< 
 * 
 *     def _read_collections(self):
 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_4mill_9workspace_Workspace *)__pyx_v_self)->_collections);
  ((struct __pyx_obj_4mill_9workspace_Workspace *)__pyx_v_self)->_collections = Py_None;

  __pyx_r = 0;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_path);
  return __pyx_r;
}

static PyObject *__pyx_n_range;

static PyObject *__pyx_builtin_range;

static PyObject *__pyx_pf_4mill_9workspace_9Workspace__read_collections(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4mill_9workspace_9Workspace__read_collections(PyObject *__pyx_v_self, PyObject *unused) {
  void *__pyx_v_cogr_ds;
  void *__pyx_v_cogr_layer;
  void *__pyx_v_cogr_layerdefn;
  PyObject *__pyx_v_collections;
  PyObject *__pyx_v_n;
  PyObject *__pyx_v_i;
  PyObject *__pyx_v_layer_name;
  PyObject *__pyx_v_collection;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  char *__pyx_2;
  Py_ssize_t __pyx_3;
  PyObject *__pyx_4 = 0;
  int __pyx_5;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  Py_INCREF(__pyx_v_self);
  __pyx_v_collections = Py_None; Py_INCREF(Py_None);
  __pyx_v_n = Py_None; Py_INCREF(Py_None);
  __pyx_v_i = Py_None; Py_INCREF(Py_None);
  __pyx_v_layer_name = Py_None; Py_INCREF(Py_None);
  __pyx_v_collection = Py_None; Py_INCREF(Py_None);

  /* "/home/sean/Projects/WorldMill/src/mill/workspace.pyx":26
 *         cdef void * cogr_layer
 *         cdef void * cogr_layerdefn
 *         collections = {}             # <<<<<<<<<<<<<< 
 * 
 *         # start session
 */
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; goto __pyx_L1;}
  Py_DECREF(__pyx_v_collections);
  __pyx_v_collections = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sean/Projects/WorldMill/src/mill/workspace.pyx":29
 * 
 *         # start session
 *         cogr_ds = ograpi.OGROpen(self.path, 0, NULL)             # <<<<<<<<<<<<<< 
 * 
 *         n = ograpi.OGR_DS_GetLayerCount(cogr_ds)
 */
  __pyx_2 = PyString_AsString(((struct __pyx_obj_4mill_9workspace_Workspace *)__pyx_v_self)->path); if (unlikely((!__pyx_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; goto __pyx_L1;}
  __pyx_v_cogr_ds = OGROpen(__pyx_2,0,NULL);

  /* "/home/sean/Projects/WorldMill/src/mill/workspace.pyx":31
 *         cogr_ds = ograpi.OGROpen(self.path, 0, NULL)
 * 
 *         n = ograpi.OGR_DS_GetLayerCount(cogr_ds)             # <<<<<<<<<<<<<< 
 *         for i in range(n):
 *             cogr_layer = ograpi.OGR_DS_GetLayer(cogr_ds, i)
 */
  __pyx_1 = PyInt_FromLong(OGR_DS_GetLayerCount(__pyx_v_cogr_ds)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; goto __pyx_L1;}
  Py_DECREF(__pyx_v_n);
  __pyx_v_n = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sean/Projects/WorldMill/src/mill/workspace.pyx":32
 * 
 *         n = ograpi.OGR_DS_GetLayerCount(cogr_ds)
 *         for i in range(n):             # <<<<<<<<<<<<<< 
 *             cogr_layer = ograpi.OGR_DS_GetLayer(cogr_ds, i)
 *             cogr_layerdefn = ograpi.OGR_L_GetLayerDefn(cogr_layer)
 */
  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
  Py_INCREF(__pyx_v_n);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_n);
  __pyx_4 = PyObject_CallObject(__pyx_builtin_range, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (PyList_CheckExact(__pyx_4)) { __pyx_3 = 0; __pyx_1 = __pyx_4; Py_INCREF(__pyx_1); }
  else { __pyx_1 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;} }
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  for (;;) {
    if (PyList_CheckExact(__pyx_1)) { if (__pyx_3 >= PyList_GET_SIZE(__pyx_1)) break; __pyx_4 = PyList_GET_ITEM(__pyx_1, __pyx_3++); Py_INCREF(__pyx_4); }
    else {
      __pyx_4 = PyIter_Next(__pyx_1);
      if (!__pyx_4) {
        break;
      }
    }
    Py_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_4;
    __pyx_4 = 0;

    /* "/home/sean/Projects/WorldMill/src/mill/workspace.pyx":33
 *         n = ograpi.OGR_DS_GetLayerCount(cogr_ds)
 *         for i in range(n):
 *             cogr_layer = ograpi.OGR_DS_GetLayer(cogr_ds, i)             # <<<<<<<<<<<<<< 
 *             cogr_layerdefn = ograpi.OGR_L_GetLayerDefn(cogr_layer)
 *             layer_name = ograpi.OGR_FD_GetName(cogr_layerdefn)
 */
    __pyx_5 = PyInt_AsLong(__pyx_v_i); if (unlikely((__pyx_5 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
    __pyx_v_cogr_layer = OGR_DS_GetLayer(__pyx_v_cogr_ds,__pyx_5);

    /* "/home/sean/Projects/WorldMill/src/mill/workspace.pyx":34
 *         for i in range(n):
 *             cogr_layer = ograpi.OGR_DS_GetLayer(cogr_ds, i)
 *             cogr_layerdefn = ograpi.OGR_L_GetLayerDefn(cogr_layer)             # <<<<<<<<<<<<<< 
 *             layer_name = ograpi.OGR_FD_GetName(cogr_layerdefn)
 *             collection = Collection(layer_name, self)
 */
    __pyx_v_cogr_layerdefn = OGR_L_GetLayerDefn(__pyx_v_cogr_layer);

    /* "/home/sean/Projects/WorldMill/src/mill/workspace.pyx":35
 *             cogr_layer = ograpi.OGR_DS_GetLayer(cogr_ds, i)
 *             cogr_layerdefn = ograpi.OGR_L_GetLayerDefn(cogr_layer)
 *             layer_name = ograpi.OGR_FD_GetName(cogr_layerdefn)             # <<<<<<<<<<<<<< 
 *             collection = Collection(layer_name, self)
 *             collections[layer_name] = collection
 */
    __pyx_4 = PyString_FromString(OGR_FD_GetName(__pyx_v_cogr_layerdefn)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
    Py_DECREF(__pyx_v_layer_name);
    __pyx_v_layer_name = __pyx_4;
    __pyx_4 = 0;

    /* "/home/sean/Projects/WorldMill/src/mill/workspace.pyx":36
 *             cogr_layerdefn = ograpi.OGR_L_GetLayerDefn(cogr_layer)
 *             layer_name = ograpi.OGR_FD_GetName(cogr_layerdefn)
 *             collection = Collection(layer_name, self)             # <<<<<<<<<<<<<< 
 *             collections[layer_name] = collection
 *         
 */
    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_Collection); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
    __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
    Py_INCREF(__pyx_v_layer_name);
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_layer_name);
    Py_INCREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_6, 1, __pyx_v_self);
    __pyx_7 = PyObject_CallObject(__pyx_4, __pyx_6); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_v_collection);
    __pyx_v_collection = __pyx_7;
    __pyx_7 = 0;

    /* "/home/sean/Projects/WorldMill/src/mill/workspace.pyx":37
 *             layer_name = ograpi.OGR_FD_GetName(cogr_layerdefn)
 *             collection = Collection(layer_name, self)
 *             collections[layer_name] = collection             # <<<<<<<<<<<<<< 
 *         
 *         # end session
 */
    if (PyObject_SetItem(__pyx_v_collections, __pyx_v_layer_name, __pyx_v_collection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
  }
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/sean/Projects/WorldMill/src/mill/workspace.pyx":40
 *         
 *         # end session
 *         ograpi.OGR_DS_Destroy(cogr_ds)             # <<<<<<<<<<<<<< 
 *         
 *         return collections
 */
  OGR_DS_Destroy(__pyx_v_cogr_ds);

  /* "/home/sean/Projects/WorldMill/src/mill/workspace.pyx":42
 *         ograpi.OGR_DS_Destroy(cogr_ds)
 *         
 *         return collections             # <<<<<<<<<<<<<< 
 * 
 *     property collections:
 */
  Py_INCREF(__pyx_v_collections);
  __pyx_r = __pyx_v_collections;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  __Pyx_AddTraceback("mill.workspace.Workspace._read_collections");
  __pyx_r = NULL;
  __pyx_L0:;
  Py_DECREF(__pyx_v_collections);
  Py_DECREF(__pyx_v_n);
  Py_DECREF(__pyx_v_i);
  Py_DECREF(__pyx_v_layer_name);
  Py_DECREF(__pyx_v_collection);
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}
예제 #21
0
/* Implementation of classmethargdefault */

static PyObject *__pyx_f_19classmethargdefault_7Swallow_spam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_19classmethargdefault_7Swallow_spam = {"spam", (PyCFunction)__pyx_f_19classmethargdefault_7Swallow_spam, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_f_19classmethargdefault_7Swallow_spam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
    PyObject *__pyx_v_w = 0;
    int __pyx_v_x;
    PyObject *__pyx_v_y = 0;
    PyObject *__pyx_v_z = 0;
    PyObject *__pyx_r;
    static char *__pyx_argnames[] = {"w","x","y","z",0};
    __pyx_v_x = __pyx_d1;
    __pyx_v_y = __pyx_d2;
    __pyx_v_z = __pyx_d3;
    if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|iOO", __pyx_argnames, &__pyx_v_w, &__pyx_v_x, &__pyx_v_y, &__pyx_v_z)) return 0;
    Py_INCREF(__pyx_v_w);
    Py_INCREF(__pyx_v_y);
    Py_INCREF(__pyx_v_z);

    __pyx_r = Py_None;
    Py_INCREF(Py_None);
    Py_DECREF(__pyx_v_w);
    Py_DECREF(__pyx_v_y);
    Py_DECREF(__pyx_v_z);
    return __pyx_r;
}

static struct PyMethodDef __pyx_methods[] = {
    {0, 0, 0, 0}
};

static void __pyx_init_filenames(void); /*proto*/

PyMODINIT_FUNC initclassmethargdefault(void); /*proto*/
PyMODINIT_FUNC initclassmethargdefault(void) {
    PyObject *__pyx_1 = 0;
    PyObject *__pyx_2 = 0;
    PyObject *__pyx_3 = 0;
    PyObject *__pyx_4 = 0;
    PyObject *__pyx_5 = 0;
    __pyx_init_filenames();
    __pyx_m = Py_InitModule4("classmethargdefault", __pyx_methods, 0, 0, PYTHON_API_VERSION);
    if (!__pyx_m) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 1;
        goto __pyx_L1;
    };
    Py_INCREF(__pyx_m);
    __pyx_b = PyImport_AddModule("__builtin__");
    if (!__pyx_b) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 1;
        goto __pyx_L1;
    };
    if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 1;
        goto __pyx_L1;
    };
    if (__Pyx_InitStrings(__pyx_string_tab) < 0) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 1;
        goto __pyx_L1;
    };
    __pyx_1 = PyDict_New();
    if (!__pyx_1) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 1;
        goto __pyx_L1;
    }
    __pyx_2 = PyTuple_New(0);
    if (!__pyx_2) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 1;
        goto __pyx_L1;
    }
    __pyx_3 = __Pyx_CreateClass(__pyx_2, __pyx_1, __pyx_n_Swallow, "classmethargdefault");
    if (!__pyx_3) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 1;
        goto __pyx_L1;
    }
    Py_DECREF(__pyx_2);
    __pyx_2 = 0;
    __pyx_d1 = 42;
    Py_INCREF(__pyx_n_grail);
    __pyx_d2 = __pyx_n_grail;
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_swallow);
    if (!__pyx_2) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 3;
        goto __pyx_L1;
    }
    __pyx_d3 = __pyx_2;
    __pyx_2 = 0;
    __pyx_4 = PyCFunction_NewEx(&__pyx_mdef_19classmethargdefault_7Swallow_spam, 0, __pyx_n_classmethargdefault);
    if (!__pyx_4) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 3;
        goto __pyx_L1;
    }
    __pyx_5 = PyMethod_New(__pyx_4, 0, __pyx_3);
    if (!__pyx_5) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 3;
        goto __pyx_L1;
    }
    Py_DECREF(__pyx_4);
    __pyx_4 = 0;
    if (PyObject_SetAttr(__pyx_3, __pyx_n_spam, __pyx_5) < 0) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 3;
        goto __pyx_L1;
    }
    Py_DECREF(__pyx_5);
    __pyx_5 = 0;
    if (PyObject_SetAttr(__pyx_m, __pyx_n_Swallow, __pyx_3) < 0) {
        __pyx_filename = __pyx_f[0];
        __pyx_lineno = 1;
        goto __pyx_L1;
    }
    Py_DECREF(__pyx_3);
    __pyx_3 = 0;
    Py_DECREF(__pyx_1);
    __pyx_1 = 0;
    return;
__pyx_L1:
    ;
    Py_XDECREF(__pyx_1);
    Py_XDECREF(__pyx_2);
    Py_XDECREF(__pyx_3);
    Py_XDECREF(__pyx_4);
    Py_XDECREF(__pyx_5);
    __Pyx_AddTraceback("classmethargdefault");
}
예제 #22
0
  /* "/home/sean/Projects/WorldMill/src/mill/workspace.pyx":49
 *             if not self._collections:
 *                 self._collections = self._read_collections()
 *             return self._collections             # <<<<<<<<<<<<<< 
 * 
 *     def __getitem__(self, name):
 */
  Py_INCREF(((struct __pyx_obj_4mill_9workspace_Workspace *)__pyx_v_self)->_collections);
  __pyx_r = ((struct __pyx_obj_4mill_9workspace_Workspace *)__pyx_v_self)->_collections;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("mill.workspace.Workspace.collections.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_collections;

static PyObject *__pyx_pf_4mill_9workspace_9Workspace___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static PyObject *__pyx_pf_4mill_9workspace_9Workspace___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_name);
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_collections); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n___getitem__); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
  Py_INCREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_name);
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("mill.workspace.Workspace.__getitem__");
  __pyx_r = NULL;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_name);
  return __pyx_r;
}

static PyObject *__pyx_pf_4mill_9workspace_9Workspace_keys(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4mill_9workspace_9Workspace_keys(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  Py_INCREF(__pyx_v_self);
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_collections); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_keys); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("mill.workspace.Workspace.keys");
  __pyx_r = NULL;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_pf_4mill_9workspace_9Workspace_values(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4mill_9workspace_9Workspace_values(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  Py_INCREF(__pyx_v_self);
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_collections); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_values); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("mill.workspace.Workspace.values");
  __pyx_r = NULL;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_pf_4mill_9workspace_9Workspace_items(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4mill_9workspace_9Workspace_items(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  Py_INCREF(__pyx_v_self);
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_collections); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_items); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("mill.workspace.Workspace.items");
  __pyx_r = NULL;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_pf_4mill_9workspace_workspace(PyObject *__pyx_self, PyObject *__pyx_v_path); /*proto*/
static PyObject *__pyx_pf_4mill_9workspace_workspace(PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  Py_INCREF(__pyx_v_path);
  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; goto __pyx_L1;}
  Py_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_path);
  __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4mill_9workspace_Workspace), __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("mill.workspace.workspace");
  __pyx_r = NULL;
  __pyx_L0:;
  Py_DECREF(__pyx_v_path);
  return __pyx_r;
}

static __Pyx_InternTabEntry __pyx_intern_tab[] = {
  {&__pyx_n_Collection, "Collection"},
  {&__pyx_n___getitem__, "__getitem__"},
  {&__pyx_n___init__, "__init__"},
  {&__pyx_n__read_collections, "_read_collections"},
  {&__pyx_n_collections, "collections"},
  {&__pyx_n_items, "items"},
  {&__pyx_n_keys, "keys"},
  {&__pyx_n_mill, "mill"},
  {&__pyx_n_ogrinit, "ogrinit"},
  {&__pyx_n_range, "range"},
  {&__pyx_n_values, "values"},
  {0, 0}
};

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_k3p, __pyx_k3, sizeof(__pyx_k3), 0},
  {0, 0, 0, 0}
};

static PyObject *__pyx_tp_new_4mill_9workspace_Workspace(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4mill_9workspace_Workspace *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_4mill_9workspace_Workspace *)o);
  p->path = Py_None; Py_INCREF(Py_None);
  p->_collections = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4mill_9workspace_Workspace(PyObject *o) {
  struct __pyx_obj_4mill_9workspace_Workspace *p = (struct __pyx_obj_4mill_9workspace_Workspace *)o;
  Py_XDECREF(p->path);
  Py_XDECREF(p->_collections);
  (*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4mill_9workspace_Workspace(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4mill_9workspace_Workspace *p = (struct __pyx_obj_4mill_9workspace_Workspace *)o;
  if (p->path) {
    e = (*v)(p->path, a); if (e) return e;
  }
  if (p->_collections) {
    e = (*v)(p->_collections, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4mill_9workspace_Workspace(PyObject *o) {
  struct __pyx_obj_4mill_9workspace_Workspace *p = (struct __pyx_obj_4mill_9workspace_Workspace *)o;
  Py_XDECREF(p->path);
  p->path = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(p->_collections);
  p->_collections = Py_None; Py_INCREF(Py_None);
  return 0;
}
static PyObject *__pyx_sq_item_4mill_9workspace_Workspace(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = o->ob_type->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_4mill_9workspace_9Workspace_collections(PyObject *o, void *x) {
  return __pyx_pf_4mill_9workspace_9Workspace_11collections___get__(o);
}

static struct PyMethodDef __pyx_methods_4mill_9workspace_Workspace[] = {
  {"_read_collections", (PyCFunction)__pyx_pf_4mill_9workspace_9Workspace__read_collections, METH_NOARGS, 0},
  {"__getitem__", (PyCFunction)__pyx_pf_4mill_9workspace_9Workspace___getitem__, METH_O|METH_COEXIST, 0},
  {"keys", (PyCFunction)__pyx_pf_4mill_9workspace_9Workspace_keys, METH_NOARGS, 0},
  {"values", (PyCFunction)__pyx_pf_4mill_9workspace_9Workspace_values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pf_4mill_9workspace_9Workspace_items, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_4mill_9workspace_Workspace[] = {
  {"path", T_OBJECT, offsetof(struct __pyx_obj_4mill_9workspace_Workspace, path), 0, 0},
  {0, 0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4mill_9workspace_Workspace[] = {
  {"collections", __pyx_getprop_4mill_9workspace_9Workspace_collections, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Workspace = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Workspace = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_4mill_9workspace_Workspace, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Workspace = {
  0, /*mp_length*/
  __pyx_pf_4mill_9workspace_9Workspace___getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Workspace = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4mill_9workspace_Workspace = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "mill.workspace.Workspace", /*tp_name*/
  sizeof(struct __pyx_obj_4mill_9workspace_Workspace), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4mill_9workspace_Workspace, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_Workspace, /*tp_as_number*/
  &__pyx_tp_as_sequence_Workspace, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Workspace, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Workspace, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4mill_9workspace_Workspace, /*tp_traverse*/
  __pyx_tp_clear_4mill_9workspace_Workspace, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4mill_9workspace_Workspace, /*tp_methods*/
  __pyx_members_4mill_9workspace_Workspace, /*tp_members*/
  __pyx_getsets_4mill_9workspace_Workspace, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_4mill_9workspace_9Workspace___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4mill_9workspace_Workspace, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static struct PyMethodDef __pyx_methods[] = {
  {"workspace", (PyCFunction)__pyx_pf_4mill_9workspace_workspace, METH_O, 0},
  {0, 0, 0, 0}
};

static void __pyx_init_filenames(void); /*proto*/

PyMODINIT_FUNC initworkspace(void); /*proto*/
PyMODINIT_FUNC initworkspace(void) {
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  /*--- Libary function declarations ---*/
  __pyx_init_filenames();
  /*--- Module creation code ---*/
  __pyx_m = Py_InitModule4("workspace", __pyx_methods, 0, 0, PYTHON_API_VERSION);
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;};
  __pyx_b = PyImport_AddModule("__builtin__");
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;};
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;};
  /*--- Intern code ---*/
  if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;};
  /*--- String init code ---*/
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;};
  /*--- Builtin init code ---*/
  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
  /*--- Global init code ---*/
  /*--- Function export code ---*/
  /*--- Function import code ---*/
  /*--- Type init code ---*/
  __pyx_type_4mill_9workspace_Workspace.tp_free = _PyObject_GC_Del;
  if (PyType_Ready(&__pyx_type_4mill_9workspace_Workspace) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "Workspace", (PyObject *)&__pyx_type_4mill_9workspace_Workspace) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; goto __pyx_L1;}
  __pyx_ptype_4mill_9workspace_Workspace = &__pyx_type_4mill_9workspace_Workspace;
  /*--- Type import code ---*/
  /*--- Execution code ---*/

  /* "/home/sean/Projects/WorldMill/src/mill/workspace.pyx":7
 * cimport ograpi
 * 
 * from mill import ogrinit             # <<<<<<<<<<<<<< 
 * from mill.collection import Collection
 * 
 */
  __pyx_1 = PyList_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;}
  Py_INCREF(__pyx_n_ogrinit);
  PyList_SET_ITEM(__pyx_1, 0, __pyx_n_ogrinit);
  __pyx_2 = __Pyx_Import(__pyx_n_mill, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_ogrinit); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ogrinit, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sean/Projects/WorldMill/src/mill/workspace.pyx":8
 * 
 * from mill import ogrinit
 * from mill.collection import Collection             # <<<<<<<<<<<<<< 
 * 
 * 
 */
  __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
  Py_INCREF(__pyx_n_Collection);
  PyList_SET_ITEM(__pyx_2, 0, __pyx_n_Collection);
  __pyx_1 = __Pyx_Import(__pyx_k3p, __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_Collection); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_Collection, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/sean/Projects/WorldMill/src/mill/workspace.pyx":64
 * 
 * 
 * def workspace(path):             # <<<<<<<<<<<<<< 
 *     return Workspace(path)
 * 
 */
  if (__Pyx_RegisterCleanup()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;};
  return;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("mill.workspace");
}
예제 #23
0
    /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":95 */
    ((struct __pyx_obj_17_pymfclib_winhttp_WinHTTPSession *)__pyx_v_self)->hInternet = NULL;
    goto __pyx_L2;
  }
  __pyx_L2:;

  Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_f_17_pymfclib_winhttp_14WinHTTPSession_getProxyForUrl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_17_pymfclib_winhttp_14WinHTTPSession_getProxyForUrl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_url = 0;
  PyObject *__pyx_v_configurl = 0;
  WINHTTP_AUTOPROXY_OPTIONS __pyx_v_autoopt;
  WINHTTP_PROXY_INFO __pyx_v_proxyinfo;
  struct __pyx_obj_17_pymfclib_winhttp_ProxyInfo *__pyx_v_ret;
  PyObject *__pyx_r;
  int __pyx_1;
  __pyx_t_17_pymfclib_winhttp_PYMFC_WCHAR *__pyx_2;
  BOOL __pyx_3;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"url","configurl",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_url, &__pyx_v_configurl)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_url);
  Py_INCREF(__pyx_v_configurl);
  __pyx_v_ret = ((struct __pyx_obj_17_pymfclib_winhttp_ProxyInfo *)Py_None); Py_INCREF(Py_None);

  /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":102 */
  memset((&__pyx_v_autoopt),0,(sizeof(__pyx_v_autoopt)));

  /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":103 */
  memset((&__pyx_v_proxyinfo),0,(sizeof(__pyx_v_proxyinfo)));

  /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":105 */
  __pyx_1 = PyObject_IsTrue(__pyx_v_configurl); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;}
  if (__pyx_1) {

    /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":106 */
    __pyx_v_autoopt.dwFlags = (WINHTTP_AUTOPROXY_AUTO_DETECT | WINHTTP_AUTOPROXY_CONFIG_URL);

    /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":107 */
    __pyx_2 = PyUnicode_AsUnicode(__pyx_v_configurl); if (__pyx_2 == NULL) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;}
    __pyx_v_autoopt.lpszAutoConfigUrl = __pyx_2;
    goto __pyx_L2;
  }
  /*else*/ {
    __pyx_v_autoopt.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT;
  }
  __pyx_L2:;

  /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":111 */
  __pyx_v_autoopt.dwAutoDetectFlags = (WINHTTP_AUTO_DETECT_TYPE_DHCP | WINHTTP_AUTO_DETECT_TYPE_DNS_A);

  /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":112 */
  __pyx_v_autoopt.fAutoLogonIfChallenged = 1;

  /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":114 */
  __pyx_2 = PyUnicode_AsUnicode(__pyx_v_url); if (__pyx_2 == NULL) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;}
  __pyx_3 = WinHttpGetProxyForUrl(((struct __pyx_obj_17_pymfclib_winhttp_WinHTTPSession *)__pyx_v_self)->hInternet,__pyx_2,(&__pyx_v_autoopt),(&__pyx_v_proxyinfo));
  if (__pyx_3) {

    /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":115 */
    __pyx_4 = PyObject_CallObject(((PyObject *)__pyx_ptype_17_pymfclib_winhttp_ProxyInfo), 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;}
    Py_DECREF(((PyObject *)__pyx_v_ret));
    __pyx_v_ret = ((struct __pyx_obj_17_pymfclib_winhttp_ProxyInfo *)__pyx_4);
    __pyx_4 = 0;

    /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":116 */
    __pyx_4 = PyInt_FromLong((__pyx_v_proxyinfo.dwAccessType == WINHTTP_ACCESS_TYPE_NO_PROXY)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}
    Py_DECREF(__pyx_v_ret->noproxy);
    __pyx_v_ret->noproxy = __pyx_4;
    __pyx_4 = 0;

    /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":118 */
    /*try:*/ {

      /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":119 */
      __pyx_1 = (__pyx_v_proxyinfo.lpszProxy != 0);
      if (__pyx_1) {
        __pyx_4 = _fromWideChar(__pyx_v_proxyinfo.lpszProxy); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L5;}
        Py_DECREF(__pyx_v_ret->proxy);
        __pyx_v_ret->proxy = __pyx_4;
        __pyx_4 = 0;
        goto __pyx_L7;
      }
      __pyx_L7:;

      /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":121 */
      __pyx_1 = (__pyx_v_proxyinfo.lpszProxyBypass != 0);
      if (__pyx_1) {
        __pyx_4 = _fromWideChar(__pyx_v_proxyinfo.lpszProxyBypass); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L5;}
        Py_DECREF(__pyx_v_ret->proxybypass);
        __pyx_v_ret->proxybypass = __pyx_4;
        __pyx_4 = 0;
        goto __pyx_L8;
      }
      __pyx_L8:;
    }
    /*finally:*/ {
      int __pyx_why;
      PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
      int __pyx_exc_lineno;
      __pyx_why = 0; goto __pyx_L6;
      __pyx_L5: {
        __pyx_why = 4;
        Py_XDECREF(__pyx_4); __pyx_4 = 0;
        PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
        __pyx_exc_lineno = __pyx_lineno;
        goto __pyx_L6;
      }
      __pyx_L6:;

      /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":124 */
      __pyx_1 = (__pyx_v_proxyinfo.lpszProxy != 0);
      if (__pyx_1) {
        GlobalFree(__pyx_v_proxyinfo.lpszProxy);
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":126 */
      __pyx_1 = (__pyx_v_proxyinfo.lpszProxyBypass != 0);
      if (__pyx_1) {
        GlobalFree(__pyx_v_proxyinfo.lpszProxyBypass);
        goto __pyx_L11;
      }
      __pyx_L11:;
      switch (__pyx_why) {
        case 4: {
          PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
          __pyx_lineno = __pyx_exc_lineno;
          __pyx_exc_type = 0;
          __pyx_exc_value = 0;
          __pyx_exc_tb = 0;
          goto __pyx_L1;
        }
      }
    }

    /* "c:\src\ip\pymfc\pymfclib\_pymfclib_winhttp.pyx":128 */
    Py_INCREF(((PyObject *)__pyx_v_ret));
    __pyx_r = ((PyObject *)__pyx_v_ret);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("_pymfclib_winhttp.WinHTTPSession.getProxyForUrl");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_ret);
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_url);
  Py_DECREF(__pyx_v_configurl);
  return __pyx_r;
}
예제 #24
0
파일: _core.c 프로젝트: liguow/everseq
/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/align/_core.pyx":5
 * """
 * 
 * def coord_to_col( int start, char * text, int pos ):             # <<<<<<<<<<<<<<
 *     cdef int col
 *     col = 0
 */

static PyObject *__pyx_pf_2bx_5align_5_core_coord_to_col(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_2bx_5align_5_core_coord_to_col(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_start;
  char *__pyx_v_text;
  int __pyx_v_pos;
  int __pyx_v_col;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_start,&__pyx_kp_text,&__pyx_kp_pos,0};
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    PyObject* values[3] = {0,0,0};
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_start);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_text);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("coord_to_col", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_pos);
      if (likely(values[2])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("coord_to_col", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "coord_to_col") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_start = __pyx_PyInt_int(values[0]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_text = __Pyx_PyBytes_AsString(values[1]); if (unlikely((!__pyx_v_text) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_pos = __pyx_PyInt_int(values[2]); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_start = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_text = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((!__pyx_v_text) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_pos = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("coord_to_col", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("bx.align._core.coord_to_col");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/align/_core.pyx":7
 * def coord_to_col( int start, char * text, int pos ):
 *     cdef int col
 *     col = 0             # <<<<<<<<<<<<<<
 *     while start < pos:
 *         # Note: ord( '-' ) = 45
 */
  __pyx_v_col = 0;

  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/align/_core.pyx":8
 *     cdef int col
 *     col = 0
 *     while start < pos:             # <<<<<<<<<<<<<<
 *         # Note: ord( '-' ) = 45
 *         if text[col] != 45:
 */
  while (1) {
    __pyx_1 = (__pyx_v_start < __pyx_v_pos);
    if (!__pyx_1) break;

    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/align/_core.pyx":10
 *     while start < pos:
 *         # Note: ord( '-' ) = 45
 *         if text[col] != 45:             # <<<<<<<<<<<<<<
 *             start = start + 1
 *         col = col + 1
 */
    __pyx_1 = ((__pyx_v_text[__pyx_v_col]) != 45);
    if (__pyx_1) {

      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/align/_core.pyx":11
 *         # Note: ord( '-' ) = 45
 *         if text[col] != 45:
 *             start = start + 1             # <<<<<<<<<<<<<<
 *         col = col + 1
 *     return col
 */
      __pyx_v_start = (__pyx_v_start + 1);
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/align/_core.pyx":12
 *         if text[col] != 45:
 *             start = start + 1
 *         col = col + 1             # <<<<<<<<<<<<<<
 *     return col
 */
    __pyx_v_col = (__pyx_v_col + 1);
  }

  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/align/_core.pyx":13
 *             start = start + 1
 *         col = col + 1
 *     return col             # <<<<<<<<<<<<<<
 */
  __pyx_2 = PyInt_FromLong(__pyx_v_col); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("bx.align._core.coord_to_col");
  __pyx_r = NULL;
  __pyx_L0:;
  return __pyx_r;
}
예제 #25
0
파일: inplace_lhs.c 프로젝트: jwilk/Pyrex
static int __pyx_f_11inplace_lhs_f(void) {
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_k;
  float __pyx_v_x;
  float __pyx_v_y;
  float __pyx_v_z;
  PyObject *__pyx_v_a;
  PyObject *__pyx_v_b;
  PyObject *__pyx_v_c;
  PyObject *__pyx_v_d;
  int __pyx_v_m[3];
  struct __pyx_t_11inplace_lhs_S __pyx_v_s;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  __pyx_v_a = Py_None; Py_INCREF(Py_None);
  __pyx_v_b = Py_None; Py_INCREF(Py_None);
  __pyx_v_c = Py_None; Py_INCREF(Py_None);
  __pyx_v_d = Py_None; Py_INCREF(Py_None);

  /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":11 */
  __pyx_v_i += (__pyx_v_j + __pyx_v_k);

  /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":12 */
  __pyx_v_x += (__pyx_v_y + __pyx_v_z);

  /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":13 */
  __pyx_v_x += __pyx_v_i;

  /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":14 */
  __pyx_1 = PyNumber_Add(__pyx_v_b, __pyx_v_c); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; goto __pyx_L1;}
  __pyx_2 = PyNumber_InPlaceAdd(__pyx_v_a, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_v_a);
  __pyx_v_a = __pyx_2;

  /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":15 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_g); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
  __pyx_2 = PyNumber_InPlaceAdd(__pyx_1, __pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_g, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":16 */
  (__pyx_v_m[__pyx_v_i]) += __pyx_v_j;

  /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":17 */
  __pyx_1 = PyNumber_Add(__pyx_v_b, __pyx_v_c); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_a, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
  __pyx_3 = PyNumber_InPlaceAdd(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (PyObject_SetItem(__pyx_v_a, __pyx_2, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":18 */
  __pyx_2 = PyNumber_Add(__pyx_v_b, __pyx_v_c); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
  __pyx_1 = PyObject_GetItem(__pyx_v_a, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
  __pyx_3 = PyNumber_InPlaceAdd(__pyx_1, __pyx_v_d); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (PyObject_SetItem(__pyx_v_a, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":19 */
  __pyx_1 = PyNumber_Add(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_v_c); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
  __pyx_2 = PyNumber_InPlaceAdd(__pyx_3, __pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PyObject_SetItem(__pyx_1, __pyx_v_c, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":20 */
  __pyx_3 = PySequence_GetSlice(__pyx_v_a, __pyx_v_i, __pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
  __pyx_2 = PyNumber_InPlaceAdd(__pyx_3, __pyx_v_b); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PySequence_SetSlice(__pyx_v_a, __pyx_v_i, __pyx_v_j, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":21 */
  __pyx_1 = PyNumber_Add(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
  __pyx_3 = PySequence_GetSlice(__pyx_1, __pyx_v_i, __pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
  __pyx_2 = PyNumber_InPlaceAdd(__pyx_3, __pyx_v_c); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PySequence_SetSlice(__pyx_1, __pyx_v_i, __pyx_v_j, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":22 */
  __pyx_3 = PyNumber_Add(__pyx_v_c, __pyx_v_d); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_v_a, __pyx_n_b); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  __pyx_1 = PyNumber_InPlaceAdd(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PyObject_SetAttr(__pyx_v_a, __pyx_n_b, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":23 */
  __pyx_2 = PyNumber_Add(__pyx_v_a, __pyx_v_b); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_c); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
  __pyx_1 = PyNumber_InPlaceAdd(__pyx_3, __pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PyObject_SetAttr(__pyx_2, __pyx_n_c, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_lhs.pyx":24 */
  __pyx_v_s.q += __pyx_v_i;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("inplace_lhs.f");
  __pyx_r = (-1);
  __pyx_L0:;
  Py_DECREF(__pyx_v_a);
  Py_DECREF(__pyx_v_b);
  Py_DECREF(__pyx_v_c);
  Py_DECREF(__pyx_v_d);
  return __pyx_r;
}
예제 #26
0
파일: Stemmer.c 프로젝트: buriy/pystemmer
static PyObject *__pyx_f_7Stemmer_algorithms(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_aliases = 0;
  char **__pyx_v_algs;
  int __pyx_v_i;
  PyObject *__pyx_v_py_algs;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"aliases",0};
  __pyx_v_aliases = __pyx_d1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_aliases)) return 0;
  Py_INCREF(__pyx_v_aliases);
  __pyx_v_py_algs = Py_None; Py_INCREF(Py_None);

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":62 */
  __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; goto __pyx_L1;}
  Py_DECREF(__pyx_v_py_algs);
  __pyx_v_py_algs = __pyx_1;
  __pyx_1 = 0;

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":63 */
  __pyx_v_algs = sb_stemmer_list();

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":64 */
  __pyx_v_i = 0;

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":65 */
  while (1) {
    __pyx_2 = ((__pyx_v_algs[__pyx_v_i]) != NULL);
    if (!__pyx_2) break;

    /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":66 */
    __pyx_1 = PyObject_GetAttr(__pyx_v_py_algs, __pyx_n_append); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
    __pyx_3 = PyString_FromString((__pyx_v_algs[__pyx_v_i])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
    __pyx_3 = 0;
    __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":67 */
    __pyx_v_i = (__pyx_v_i + 1);
  }

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":68 */
  Py_INCREF(__pyx_v_py_algs);
  __pyx_r = __pyx_v_py_algs;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("Stemmer.algorithms");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_py_algs);
  Py_DECREF(__pyx_v_aliases);
  return __pyx_r;
}
예제 #27
0
  /* "/Volumes/astraw/src/ve/visionegg-devel.clean/src/darwin_maxpriority.pyx":119 */
  __pyx_1 = PyInt_FromLong(__pyx_v_result); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("darwin_maxpriority.sched_get_priority_max");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_errno);
  Py_DECREF(__pyx_v_arg0);
  return __pyx_r;
}

static PyObject *__pyx_f_18darwin_maxpriority_setpriority(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_18darwin_maxpriority_setpriority(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arg0 = 0;
  PyObject *__pyx_v_arg1 = 0;
  PyObject *__pyx_v_arg2 = 0;
  int __pyx_v_result;
  PyObject *__pyx_v_errno;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  int __pyx_3;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"arg0","arg1","arg2",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_arg0, &__pyx_v_arg1, &__pyx_v_arg2)) return 0;
  Py_INCREF(__pyx_v_arg0);
  Py_INCREF(__pyx_v_arg1);
  Py_INCREF(__pyx_v_arg2);
  __pyx_v_errno = Py_None; Py_INCREF(__pyx_v_errno);

  /* "/Volumes/astraw/src/ve/visionegg-devel.clean/src/darwin_maxpriority.pyx":123 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
  Py_DECREF(__pyx_v_errno);
  __pyx_v_errno = __pyx_1;
  __pyx_1 = 0;

  /* "/Volumes/astraw/src/ve/visionegg-devel.clean/src/darwin_maxpriority.pyx":124 */
  __pyx_2 = PyInt_AsLong(__pyx_v_arg0); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; goto __pyx_L1;}
  __pyx_3 = PyInt_AsLong(__pyx_v_arg2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; goto __pyx_L1;}
  __pyx_v_result = setpriority(__pyx_2,__pyx_v_arg1,__pyx_3);

  /* "/Volumes/astraw/src/ve/visionegg-devel.clean/src/darwin_maxpriority.pyx":125 */
  __pyx_2 = PyObject_IsTrue(__pyx_v_errno); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
  if (__pyx_2) {

    /* "/Volumes/astraw/src/ve/visionegg-devel.clean/src/darwin_maxpriority.pyx":126 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;}
    __pyx_4 = PyErr_SetFromErrno(__pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/Volumes/astraw/src/ve/visionegg-devel.clean/src/darwin_maxpriority.pyx":127 */
  __pyx_1 = PyInt_FromLong(__pyx_v_result); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("darwin_maxpriority.setpriority");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_errno);
  Py_DECREF(__pyx_v_arg0);
  Py_DECREF(__pyx_v_arg1);
  Py_DECREF(__pyx_v_arg2);
  return __pyx_r;
}
예제 #28
0
파일: Stemmer.c 프로젝트: buriy/pystemmer
  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":68 */
  Py_INCREF(__pyx_v_py_algs);
  __pyx_r = __pyx_v_py_algs;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("Stemmer.algorithms");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_py_algs);
  Py_DECREF(__pyx_v_aliases);
  return __pyx_r;
}

static PyObject *__pyx_f_7Stemmer_version(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7Stemmer_version[] = "Get the version string of the stemming module.\n\n    This version number is for the Stemmer module as a whole (not for an\n    individual stemming algorithm).\n\n    ";
static PyObject *__pyx_f_7Stemmer_version(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_k2p);
  __pyx_r = __pyx_k2p;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  __pyx_L0:;
  return __pyx_r;
}

static int __pyx_f_7Stemmer_7Stemmer___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_7Stemmer_7Stemmer___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_algorithm = 0;
  int __pyx_v_maxCacheSize;
  int __pyx_r;
  char *__pyx_1;
  int __pyx_2;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"algorithm","maxCacheSize",0};
  __pyx_v_maxCacheSize = __pyx_d2;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|i", __pyx_argnames, &__pyx_v_algorithm, &__pyx_v_maxCacheSize)) return -1;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_algorithm);

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":118 */
  __pyx_1 = PyString_AsString(__pyx_v_algorithm); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;}
  ((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->cobj = sb_stemmer_new(__pyx_1,__pyx_k3);

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":119 */
  __pyx_2 = (((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->cobj == NULL);
  if (__pyx_2) {
    __pyx_3 = PyNumber_Remainder(__pyx_k4p, __pyx_v_algorithm); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
    __pyx_3 = 0;
    __pyx_3 = PyObject_CallObject(PyExc_KeyError, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __Pyx_Raise(__pyx_3, 0, 0);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":121 */
  ((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->max_cache_size = __pyx_v_maxCacheSize;

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":122 */
  __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->counter);
  ((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->counter = __pyx_4;
  __pyx_4 = 0;

  /* "/home/richard/private/Working/snowball/pystemmer/src/Stemmer.pyx":123 */
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->cache);
  ((struct __pyx_obj_7Stemmer_Stemmer *)__pyx_v_self)->cache = __pyx_3;
  __pyx_3 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("Stemmer.Stemmer.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_algorithm);
  return __pyx_r;
}
예제 #29
0
파일: redir.c 프로젝트: rkern/redir
  /* "/Users/kern/projects/redir/redir.pyx":30 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_started, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("redir.Redirector.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_n_pipe;
static PyObject *__pyx_n_True;

static PyObject *__pyx_f_5redir_10Redirector_start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5redir_10Redirector_start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  int __pyx_3;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/Users/kern/projects/redir/redir.pyx":33 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_started); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
  __pyx_2 = PyObject_IsTrue(__pyx_1); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = (!__pyx_2);
  if (__pyx_3) {

    /* "/Users/kern/projects/redir/redir.pyx":34 */
    ((struct __pyx_obj_5redir_Redirector *)__pyx_v_self)->oldhandle = dup(((struct __pyx_obj_5redir_Redirector *)__pyx_v_self)->fd);

    /* "/Users/kern/projects/redir/redir.pyx":35 */
    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_os); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
    __pyx_4 = PyObject_GetAttr(__pyx_1, __pyx_n_pipe); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
    __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_4 = __Pyx_UnpackItem(__pyx_5, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
    __pyx_2 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    ((struct __pyx_obj_5redir_Redirector *)__pyx_v_self)->piper = __pyx_2;
    __pyx_1 = __Pyx_UnpackItem(__pyx_5, 1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
    __pyx_3 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    ((struct __pyx_obj_5redir_Redirector *)__pyx_v_self)->pipew = __pyx_3;
    if (__Pyx_EndUnpack(__pyx_5, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;

    /* "/Users/kern/projects/redir/redir.pyx":36 */
    dup2(((struct __pyx_obj_5redir_Redirector *)__pyx_v_self)->pipew,((struct __pyx_obj_5redir_Redirector *)__pyx_v_self)->fd);

    /* "/Users/kern/projects/redir/redir.pyx":37 */
    close(((struct __pyx_obj_5redir_Redirector *)__pyx_v_self)->pipew);

    /* "/Users/kern/projects/redir/redir.pyx":39 */
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_started, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("redir.Redirector.start");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}
예제 #30
0
파일: dict.c 프로젝트: jwilk/Pyrex
/* Implementation of dict */

static PyObject *__pyx_f_4dict_f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4dict_f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_adict = 0;
  PyObject *__pyx_v_key1 = 0;
  PyObject *__pyx_v_value1 = 0;
  PyObject *__pyx_v_key2 = 0;
  PyObject *__pyx_v_value2 = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  static char *__pyx_argnames[] = {"adict","key1","value1","key2","value2",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOOO", __pyx_argnames, &__pyx_v_adict, &__pyx_v_key1, &__pyx_v_value1, &__pyx_v_key2, &__pyx_v_value2)) return 0;
  Py_INCREF(__pyx_v_adict);
  Py_INCREF(__pyx_v_key1);
  Py_INCREF(__pyx_v_value1);
  Py_INCREF(__pyx_v_key2);
  Py_INCREF(__pyx_v_value2);

  /* "/Local/Projects/D/Pyrex/Source/Tests/2/dict.pyx":2 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; goto __pyx_L1;}
  Py_DECREF(__pyx_v_adict);
  __pyx_v_adict = __pyx_1;
  __pyx_1 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/2/dict.pyx":3 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_1, __pyx_v_key1, __pyx_v_value1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;}
  Py_DECREF(__pyx_v_adict);
  __pyx_v_adict = __pyx_1;
  __pyx_1 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/2/dict.pyx":4 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_1, __pyx_v_key1, __pyx_v_value1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_1, __pyx_v_key2, __pyx_v_value2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
  Py_DECREF(__pyx_v_adict);
  __pyx_v_adict = __pyx_1;
  __pyx_1 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/2/dict.pyx":5 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_1, __pyx_v_key1, __pyx_v_value1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_1, __pyx_v_key2, __pyx_v_value2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
  Py_DECREF(__pyx_v_adict);
  __pyx_v_adict = __pyx_1;
  __pyx_1 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/2/dict.pyx":6 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_1, __pyx_n_parrot, __pyx_n_resting) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(42); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_1, __pyx_n_answer, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_adict);
  __pyx_v_adict = __pyx_1;
  __pyx_1 = 0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("dict.f");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_adict);
  Py_DECREF(__pyx_v_key1);
  Py_DECREF(__pyx_v_value1);
  Py_DECREF(__pyx_v_key2);
  Py_DECREF(__pyx_v_value2);
  return __pyx_r;
}