Ejemplo n.º 1
0
/* Implementation of ref2global */

static PyObject *__pyx_f_10ref2global_f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10ref2global_f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {"a",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_a)) return 0;
  Py_INCREF(__pyx_v_a);

  /* "/Local/Projects/D/Pyrex/Source/Tests/1/ref2global.pyx":2 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_f); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; goto __pyx_L1;}
  Py_DECREF(__pyx_v_a);
  __pyx_v_a = __pyx_1;
  __pyx_1 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/1/ref2global.pyx":3 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_g); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;}
  Py_DECREF(__pyx_v_a);
  __pyx_v_a = __pyx_1;
  __pyx_1 = 0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("ref2global.f");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_a);
  return __pyx_r;
}
Ejemplo n.º 2
0
  /* "/home/jose/tmp/ssdeep-2.2/pyssdeep-read-only/ssdeep.pyx":53 */
  __pyx_1 = PyString_AsString(__pyx_v_hash1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
  __pyx_2 = PyString_AsString(__pyx_v_hash2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(fuzzy_compare(__pyx_1,__pyx_2)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ssdeep.ssdeep.compare");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_hash1);
  Py_DECREF(__pyx_v_hash2);
  return __pyx_r;
}

static __Pyx_InternTabEntry __pyx_intern_tab[] = {
  {&__pyx_n_Exception, "Exception"},
  {&__pyx_n_SsdeepException, "SsdeepException"},
  {&__pyx_n_len, "len"},
  {&__pyx_n_replace, "replace"},
  {0, 0}
};

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_k2p, __pyx_k2, sizeof(__pyx_k2)},
  {&__pyx_k3p, __pyx_k3, sizeof(__pyx_k3)},
  {&__pyx_k4p, __pyx_k4, sizeof(__pyx_k4)},
  {&__pyx_k5p, __pyx_k5, sizeof(__pyx_k5)},
  {&__pyx_k6p, __pyx_k6, sizeof(__pyx_k6)},
  {&__pyx_k7p, __pyx_k7, sizeof(__pyx_k7)},
  {0, 0, 0}
};

static PyObject *__pyx_tp_new_6ssdeep_ssdeep(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  struct __pyx_obj_6ssdeep_ssdeep *p = (struct __pyx_obj_6ssdeep_ssdeep *)o;
  return o;
}

static void __pyx_tp_dealloc_6ssdeep_ssdeep(PyObject *o) {
  struct __pyx_obj_6ssdeep_ssdeep *p = (struct __pyx_obj_6ssdeep_ssdeep *)o;
  (*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_6ssdeep_ssdeep(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6ssdeep_ssdeep *p = (struct __pyx_obj_6ssdeep_ssdeep *)o;
  return 0;
}

static int __pyx_tp_clear_6ssdeep_ssdeep(PyObject *o) {
  struct __pyx_obj_6ssdeep_ssdeep *p = (struct __pyx_obj_6ssdeep_ssdeep *)o;
  return 0;
}

static struct PyMethodDef __pyx_methods_6ssdeep_ssdeep[] = {
  {"hash_file", (PyCFunction)__pyx_f_6ssdeep_6ssdeep_hash_file, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6ssdeep_6ssdeep_hash_file},
  {"hash_bytes", (PyCFunction)__pyx_f_6ssdeep_6ssdeep_hash_bytes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6ssdeep_6ssdeep_hash_bytes},
  {"compare", (PyCFunction)__pyx_f_6ssdeep_6ssdeep_compare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6ssdeep_6ssdeep_compare},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ssdeep = {
  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*/
};

static PySequenceMethods __pyx_tp_as_sequence_ssdeep = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*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_ssdeep = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

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

statichere PyTypeObject __pyx_type_6ssdeep_ssdeep = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "ssdeep.ssdeep", /*tp_name*/
  sizeof(struct __pyx_obj_6ssdeep_ssdeep), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6ssdeep_ssdeep, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_ssdeep, /*tp_as_number*/
  &__pyx_tp_as_sequence_ssdeep, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_ssdeep, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_ssdeep, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6ssdeep_ssdeep, /*tp_traverse*/
  __pyx_tp_clear_6ssdeep_ssdeep, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6ssdeep_ssdeep, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_f_6ssdeep_6ssdeep___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6ssdeep_ssdeep, /*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[] = {
  {0, 0, 0, 0}
};

DL_EXPORT(void) initssdeep(void); /*proto*/
DL_EXPORT(void) initssdeep(void) {
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  __pyx_m = Py_InitModule4("ssdeep", __pyx_methods, 0, 0, PYTHON_API_VERSION);
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
  __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_InternStrings(__pyx_intern_tab) < 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;};
  if (PyType_Ready(&__pyx_type_6ssdeep_ssdeep) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "ssdeep", (PyObject *)&__pyx_type_6ssdeep_ssdeep) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;}
  __pyx_ptype_6ssdeep_ssdeep = &__pyx_type_6ssdeep_ssdeep;

  /* "/home/jose/tmp/ssdeep-2.2/pyssdeep-read-only/ssdeep.pyx":22 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_Exception); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
  __pyx_2 = 0;
  __pyx_2 = __Pyx_CreateClass(__pyx_3, __pyx_1, __pyx_n_SsdeepException, "ssdeep"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_SsdeepException, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/jose/tmp/ssdeep-2.2/pyssdeep-read-only/ssdeep.pyx":48 */
  return;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("ssdeep");
}
Ejemplo n.º 3
0
/* Implementation of cdefexternblock */

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

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

PyMODINIT_FUNC initcdefexternblock(void); /*proto*/
PyMODINIT_FUNC initcdefexternblock(void) {
  PyObject *__pyx_1 = 0;
  __pyx_init_filenames();
  __pyx_m = Py_InitModule4("cdefexternblock", __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_15cdefexternblock_r = ((struct runny_obj *)Py_None); Py_INCREF(Py_None);
  __pyx_ptype_15cdefexternblock_runny = __Pyx_ImportType("external", "runny", sizeof(struct runny_obj)); if (!__pyx_ptype_15cdefexternblock_runny) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; goto __pyx_L1;}

  /* "/Local/Projects/D/Pyrex/Source/Tests/6/cdefexternblock.pyx":18 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_x); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_15cdefexternblock_runny)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_15cdefexternblock_r));
  __pyx_v_15cdefexternblock_r = ((struct runny_obj *)__pyx_1);
  __pyx_1 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/6/cdefexternblock.pyx":19 */
  __pyx_v_15cdefexternblock_r->a = 42;
  return;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("cdefexternblock");
}
Ejemplo n.º 4
0
Archivo: redir.c Proyecto: rkern/redir
/* Implementation of redir */


static PyObject *__pyx_n_sys;
static PyObject *__pyx_n_os;

static PyObject *__pyx_n_False;
static PyObject *__pyx_n_started;

static int __pyx_f_5redir_10Redirector___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_5redir_10Redirector___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_fd;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {"fd",0};
  __pyx_v_fd = __pyx_k3;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|i", __pyx_argnames, &__pyx_v_fd)) return -1;
  Py_INCREF(__pyx_v_self);

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

  /* "/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;
}
Ejemplo n.º 5
0
Archivo: jiba5.c Proyecto: jwilk/Pyrex
/* Implementation of jiba5 */

static PyObject *__pyx_f_5jiba5_f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5jiba5_f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_i;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/jiba/jiba5.pyx":4 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_mylist); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
  if (PyObject_DelItem(__pyx_1, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/jiba/jiba5.pyx":5 */
  __pyx_r = Py_None; Py_INCREF(Py_None);
  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("jiba5.f");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}
Ejemplo n.º 6
0
  /* "/Volumes/astraw/src/ve/visionegg-devel.clean/src/darwin_maxpriority.pyx":103 */
  __pyx_1 = PyInt_AsLong(__pyx_v_policy); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(pthread_setschedparam(pthread_self(),__pyx_1,(&__pyx_v_sp))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("darwin_maxpriority.set_self_pthread_priority");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_policy);
  Py_DECREF(__pyx_v_priority);
  return __pyx_r;
}

static PyObject *__pyx_n_OSError;

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

  /* "/Volumes/astraw/src/ve/visionegg-devel.clean/src/darwin_maxpriority.pyx":107 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; 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":108 */
  __pyx_2 = PyInt_AsLong(__pyx_v_arg0); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
  __pyx_v_result = getpriority(__pyx_2,__pyx_v_arg1);

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

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

  /* "/Volumes/astraw/src/ve/visionegg-devel.clean/src/darwin_maxpriority.pyx":111 */
  __pyx_1 = PyInt_FromLong(__pyx_v_result); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; 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.getpriority");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_errno);
  Py_DECREF(__pyx_v_arg0);
  Py_DECREF(__pyx_v_arg1);
  return __pyx_r;
}
Ejemplo n.º 7
0
    /* "ProjectsA:Python:Pyrex:Tests:Runnable:r_argdefault.pyx":7 */
    __pyx_1 = PyString_FromString(__pyx_k7); if (!__pyx_1) goto __pyx_L1;
    if (__Pyx_PrintItem(__pyx_1) < 0) goto __pyx_L1;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    if (__Pyx_PrintItem(__pyx_v_coconuts) < 0) goto __pyx_L1;
    __pyx_1 = PyString_FromString(__pyx_k8); if (!__pyx_1) goto __pyx_L1;
    if (__Pyx_PrintItem(__pyx_1) < 0) goto __pyx_L1;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    if (__Pyx_PrintNewline() < 0) goto __pyx_L1;
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_name);
  Py_DECREF(__pyx_v_airspeed);
  Py_DECREF(__pyx_v_coconuts);
  return __pyx_r;
}

static struct PyMethodDef __pyx_methods[] = {
  {"swallow", (PyCFunction)__pyx_f_swallow, METH_VARARGS|METH_KEYWORDS, 0},
{0, 0, 0, 0}
};


void initr_argdefault(void); /*proto*/
void initr_argdefault(void) {
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
__pyx_m = Py_InitModule4("r_argdefault", __pyx_methods, 0, 0, PYTHON_API_VERSION);
__pyx_b = PyImport_AddModule("__builtin__");
PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b);

/* "ProjectsA:Python:Pyrex:Tests:Runnable:r_argdefault.pyx":1 */
__pyx_1 = __Pyx_GetName(__pyx_b, "None"); if (!__pyx_1) goto __pyx_L1;
__pyx_k1 = __pyx_1;
__pyx_1 = 0;
__pyx_2 = __Pyx_GetName(__pyx_b, "None"); if (!__pyx_2) goto __pyx_L1;
__pyx_k2 = __pyx_2;
__pyx_2 = 0;
__pyx_3 = __Pyx_GetName(__pyx_b, "None"); if (!__pyx_3) goto __pyx_L1;
__pyx_k3 = __pyx_3;
__pyx_3 = 0;
return;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
}
Ejemplo n.º 8
0
static PyObject *__pyx_f_6Domain_3CCS_5utils_dactivation(float __pyx_v_y,int __pyx_v_function) {
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  __pyx_1 = (__pyx_v_function == 0);
  if (__pyx_1) {
    __pyx_2 = PyFloat_FromDouble(tanh(__pyx_v_y)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_1 = (__pyx_v_function == 1);
  if (__pyx_1) {
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_expit); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; goto __pyx_L1;}
    __pyx_3 = PyFloat_FromDouble(__pyx_v_y); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
    __pyx_3 = 0;
    __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __pyx_r = __pyx_3;
    __pyx_3 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {
    __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("Domain.CCS.utils.dactivation");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}
Ejemplo n.º 9
0
Archivo: rowe_1.c Proyecto: jwilk/Pyrex
/* Implementation of rowe_1 */

static PyObject *__pyx_f_6rowe_1_function(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6rowe_1_function(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_a;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  int __pyx_3;
  Py_ssize_t __pyx_4;
  Py_ssize_t __pyx_5;
  static char *__pyx_argnames[] = {"data",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_data)) return 0;
  Py_INCREF(__pyx_v_data);
  __pyx_v_a = Py_None; Py_INCREF(Py_None);

  /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/other/rowe_1.pyx":7 */
  __pyx_1 = PyInt_FromLong(4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;}
  __pyx_2 = PyNumber_Multiply(__pyx_1, __pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = 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;
  blarg(__pyx_3);

  /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/other/rowe_1.pyx":8 */
  __pyx_4 = PyInt_AsSsize_t(__pyx_v_a); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
  __pyx_2 = PyNumber_Add(__pyx_v_a, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyInt_AsSsize_t(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PySequence_GetSlice(__pyx_v_data, __pyx_4, __pyx_5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; 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);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("rowe_1.function");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_a);
  Py_DECREF(__pyx_v_data);
  return __pyx_r;
}
Ejemplo n.º 10
0
Archivo: big_t.c Proyecto: jwilk/Pyrex
/* Generated by Pyrex 0.4 on Wed Sep  4 19:45:38 2002 */

#include "Python.h"
#include "foo.h"


static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/
static int __Pyx_EndUnpack(PyObject *, int); /*proto*/
static int __Pyx_PrintItem(PyObject *); /*proto*/
static int __Pyx_PrintNewline(void); /*proto*/
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static void __Pyx_ReRaise(void); /*proto*/
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
static PyObject *__Pyx_GetExcValue(void); /*proto*/
static PyObject *__Pyx_GetName(PyObject *dict, char *name); /*proto*/
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, char *name); /*proto*/
static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/
static void __Pyx_WriteUnraisable(char *name); /*proto*/
static void __Pyx_AddTraceback(char *funcname); /*proto*/

static PyObject *__pyx_m;
static PyObject *__pyx_b;
static char *__pyx_srcfile = "ProjectsA:Python:Pyrex:Tests:(experiments):big_t.pyx";
static int __pyx_lineno;

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


DL_EXPORT(void) initbig_t(void); /*proto*/
DL_EXPORT(void) initbig_t(void) {
  PyObject *__pyx_1 = 0;
  long long __pyx_2;
  __pyx_m = Py_InitModule4("big_t", __pyx_methods, 0, 0, PYTHON_API_VERSION);
  __pyx_b = PyImport_AddModule("__builtin__");
  PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b);

  /* "ProjectsA:Python:Pyrex:Tests:(experiments):big_t.pyx":1 */

  /* "ProjectsA:Python:Pyrex:Tests:(experiments):big_t.pyx":5 */
  __pyx_1 = __Pyx_GetName(__pyx_b, "grail"); if (!__pyx_1) {__pyx_lineno = 5; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_lineno = 5; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  spam(__pyx_2);
  return;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("big_t");
}
Ejemplo n.º 11
0
static int __pyx_f_11getattr3ref_f(void) {
  PyObject *__pyx_v_g;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  __pyx_v_g = Py_None; Py_INCREF(Py_None);
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_getattr); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; goto __pyx_L1;}
  Py_DECREF(__pyx_v_g);
  __pyx_v_g = __pyx_1;
  __pyx_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("getattr3ref.f");
  __pyx_r = (-1);
  __pyx_L0:;
  Py_DECREF(__pyx_v_g);
  return __pyx_r;
}
Ejemplo n.º 12
0
/* Implementation of cimport */

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

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

PyMODINIT_FUNC initcimport(void); /*proto*/
PyMODINIT_FUNC initcimport(void) {
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  __pyx_init_filenames();
  __pyx_m = Py_InitModule4("cimport", __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_7cimport_fried = ((struct __pyx_obj_3pkg_4eggs_Eggs *)Py_None); Py_INCREF(Py_None);
  __pyx_ptype_3pkg_4eggs_Eggs = __Pyx_ImportType("pkg.eggs", "Eggs", sizeof(struct __pyx_obj_3pkg_4eggs_Eggs)); if (!__pyx_ptype_3pkg_4eggs_Eggs) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; goto __pyx_L1;}

  /* "/Local/Projects/D/Pyrex/Source/Tests/8/cimport.pyx":7 */
  eat(__pyx_v_7cimport_yummy);

  /* "/Local/Projects/D/Pyrex/Source/Tests/8/cimport.pyx":8 */
  tons = 3.14;

  /* "/Local/Projects/D/Pyrex/Source/Tests/8/cimport.pyx":9 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_pkg); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_eggs); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_ova, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/Local/Projects/D/Pyrex/Source/Tests/8/cimport.pyx":10 */
  __pyx_1 = PyObject_CallObject(((PyObject *)__pyx_ptype_3pkg_4eggs_Eggs), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_7cimport_fried));
  __pyx_v_7cimport_fried = ((struct __pyx_obj_3pkg_4eggs_Eggs *)__pyx_1);
  __pyx_1 = 0;
  return;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("cimport");
}
Ejemplo n.º 13
0
/* Implementation of behnel3 */

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

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

PyMODINIT_FUNC initbehnel3(void); /*proto*/
PyMODINIT_FUNC initbehnel3(void) {
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  __pyx_init_filenames();
  __pyx_m = Py_InitModule4("behnel3", __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 = __Pyx_GetName(__pyx_b, __pyx_n_y); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
  __pyx_2 = PyObject_IsTrue(__pyx_1); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
  if (!__pyx_2) {
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_x, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  return;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("behnel3");
}
Ejemplo n.º 14
0
Archivo: redir.c Proyecto: rkern/redir
    /* "/Users/kern/projects/redir/redir.pyx":45 */
    fflush(stderr);
    goto __pyx_L2;
  }
  __pyx_L2:;

  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_WriteUnraisable("redir.Redirector.flush");
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_n_fdopen;
static PyObject *__pyx_n_r;
static PyObject *__pyx_n_read;
static PyObject *__pyx_n_close;


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

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

    /* "/Users/kern/projects/redir/redir.pyx":49 */
    ((struct __pyx_vtabstruct_5redir_Redirector *)((struct __pyx_obj_5redir_Redirector *)__pyx_v_self)->__pyx_vtab)->flush(((struct __pyx_obj_5redir_Redirector *)__pyx_v_self));

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

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

    /* "/Users/kern/projects/redir/redir.pyx":52 */
    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_os); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
    __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_fdopen); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_1 = PyInt_FromLong(((struct __pyx_obj_5redir_Redirector *)__pyx_v_self)->piper); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
    Py_INCREF(__pyx_n_r);
    PyTuple_SET_ITEM(__pyx_4, 1, __pyx_n_r);
    __pyx_1 = 0;
    __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_v_f);
    __pyx_v_f = __pyx_1;
    __pyx_1 = 0;

    /* "/Users/kern/projects/redir/redir.pyx":53 */
    __pyx_3 = PyObject_GetAttr(__pyx_v_f, __pyx_n_read); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
    __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_v_output);
    __pyx_v_output = __pyx_1;
    __pyx_1 = 0;

    /* "/Users/kern/projects/redir/redir.pyx":54 */
    __pyx_3 = PyObject_GetAttr(__pyx_v_f, __pyx_n_close); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;}
    __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_1); __pyx_1 = 0;

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

    /* "/Users/kern/projects/redir/redir.pyx":57 */
    Py_INCREF(__pyx_v_output);
    __pyx_r = __pyx_v_output;
    goto __pyx_L0;
    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_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("redir.Redirector.stop");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_f);
  Py_DECREF(__pyx_v_output);
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}
Ejemplo n.º 15
0
Archivo: redir.c Proyecto: 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;
}
Ejemplo n.º 16
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;
}
Ejemplo n.º 17
0
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;
}
Ejemplo n.º 18
0
#include "Python.h"

#define const


static PyObject *__Pyx_UnpackItem(PyObject *, int);
static int __Pyx_EndUnpack(PyObject *, int);
static int __Pyx_PrintItem(PyObject *);
static int __Pyx_PrintNewline(void);
static void __Pyx_ReRaise(void);
static void __Pyx_RaiseWithTraceback(PyObject *, PyObject *, PyObject *);
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list);
static PyObject *__Pyx_GetExcValue(void);
static PyObject *__Pyx_GetName(PyObject *dict, char *name);
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, char *name);
static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

static PyObject *__pyx_m;
static PyObject *__pyx_b;

static char (__pyx_k4[]) = "This swallow is called";
static char (__pyx_k5[]) = "This swallow is flying at";
static char (__pyx_k6[]) = "furlongs per fortnight";
static char (__pyx_k7[]) = "This swallow is carrying";
static char (__pyx_k8[]) = "coconuts";

static PyObject *__pyx_f_swallow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_swallow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_airspeed = 0;
  PyObject *__pyx_v_coconuts = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  static char *__pyx_argnames[] = {"name","airspeed","coconuts",0};
  __pyx_v_name = __pyx_k1;
  __pyx_v_airspeed = __pyx_k2;
  __pyx_v_coconuts = __pyx_k3;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_name, &__pyx_v_airspeed, &__pyx_v_coconuts)) return 0;
  Py_INCREF(__pyx_v_name);
  Py_INCREF(__pyx_v_airspeed);
  Py_INCREF(__pyx_v_coconuts);

  /* "ProjectsA:Python:Pyrex:Tests:Runnable:r_argdefault.pyx":2 */
  __pyx_1 = __Pyx_GetName(__pyx_b, "None"); if (!__pyx_1) goto __pyx_L1;
  __pyx_2 = __pyx_v_name != __pyx_1;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_2) {

    /* "ProjectsA:Python:Pyrex:Tests:Runnable:r_argdefault.pyx":3 */
    __pyx_1 = PyString_FromString(__pyx_k4); if (!__pyx_1) goto __pyx_L1;
    if (__Pyx_PrintItem(__pyx_1) < 0) goto __pyx_L1;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    if (__Pyx_PrintItem(__pyx_v_name) < 0) goto __pyx_L1;
    if (__Pyx_PrintNewline() < 0) goto __pyx_L1;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "ProjectsA:Python:Pyrex:Tests:Runnable:r_argdefault.pyx":4 */
  __pyx_1 = __Pyx_GetName(__pyx_b, "None"); if (!__pyx_1) goto __pyx_L1;
  __pyx_2 = __pyx_v_airspeed != __pyx_1;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_2) {

    /* "ProjectsA:Python:Pyrex:Tests:Runnable:r_argdefault.pyx":5 */
    __pyx_1 = PyString_FromString(__pyx_k5); if (!__pyx_1) goto __pyx_L1;
    if (__Pyx_PrintItem(__pyx_1) < 0) goto __pyx_L1;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    if (__Pyx_PrintItem(__pyx_v_airspeed) < 0) goto __pyx_L1;
    __pyx_1 = PyString_FromString(__pyx_k6); if (!__pyx_1) goto __pyx_L1;
    if (__Pyx_PrintItem(__pyx_1) < 0) goto __pyx_L1;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    if (__Pyx_PrintNewline() < 0) goto __pyx_L1;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "ProjectsA:Python:Pyrex:Tests:Runnable:r_argdefault.pyx":6 */
  __pyx_1 = __Pyx_GetName(__pyx_b, "None"); if (!__pyx_1) goto __pyx_L1;
  __pyx_2 = __pyx_v_coconuts != __pyx_1;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_2) {

    /* "ProjectsA:Python:Pyrex:Tests:Runnable:r_argdefault.pyx":7 */
    __pyx_1 = PyString_FromString(__pyx_k7); if (!__pyx_1) goto __pyx_L1;
    if (__Pyx_PrintItem(__pyx_1) < 0) goto __pyx_L1;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    if (__Pyx_PrintItem(__pyx_v_coconuts) < 0) goto __pyx_L1;
    __pyx_1 = PyString_FromString(__pyx_k8); if (!__pyx_1) goto __pyx_L1;
    if (__Pyx_PrintItem(__pyx_1) < 0) goto __pyx_L1;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    if (__Pyx_PrintNewline() < 0) goto __pyx_L1;
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_name);
  Py_DECREF(__pyx_v_airspeed);
  Py_DECREF(__pyx_v_coconuts);
  return __pyx_r;
}
Ejemplo n.º 19
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;
}
Ejemplo n.º 20
0
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;
}
Ejemplo n.º 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");
}
Ejemplo n.º 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");
}
/* 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
}
Ejemplo n.º 24
0
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;
}
Ejemplo n.º 25
0
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;
}