/* Generated by Pyrex 0.9 on Tue Aug 24 21:46:19 2004 */

#include "Python.h"
#include "structmember.h"
#include "statgrab.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, int none_allowed, 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 PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size);  /*proto*/
static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
static int __Pyx_GetVtable(PyObject *dict, void **vtabptr); /*proto*/

static PyObject *__pyx_m;
static PyObject *__pyx_b;
static int __pyx_lineno;
static char *__pyx_filename;
staticforward char **__pyx_f;

/* Declarations from _statgrab */


/* Implementation of _statgrab */

static char (__pyx_k1[]) = "Result";
static char (__pyx_k2[]) = "StatgrabException";


static PyObject *__pyx_f_9_statgrab_6Result___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_9_statgrab_6Result___init__ = {"__init__", (PyCFunction)__pyx_f_9_statgrab_6Result___init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_f_9_statgrab_6Result___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_attrs = 0;
  PyObject *__pyx_v_attr;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"self","attrs",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_self, &__pyx_v_attrs)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_attrs);
  __pyx_v_attr = Py_None; Py_INCREF(__pyx_v_attr);

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":270 */
  if (PyObject_SetAttrString(__pyx_v_self, "attrs", __pyx_v_attrs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; goto __pyx_L1;}

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":271 */
  __pyx_1 = PyObject_GetIter(__pyx_v_attrs); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;}
  for (;;) {
    __pyx_L2:;
    __pyx_2 = PyIter_Next(__pyx_1);
    if (!__pyx_2) {
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;}
      break;
    }
    Py_DECREF(__pyx_v_attr);
    __pyx_v_attr = __pyx_2;
    __pyx_2 = 0;

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":272 */
    __pyx_2 = __Pyx_GetName(__pyx_b, "setattr"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;}
    __pyx_3 = PyObject_GetItem(__pyx_v_attrs, __pyx_v_attr); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;}
    Py_INCREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_self);
    Py_INCREF(__pyx_v_attr);
    PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_attr);
    PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
    __pyx_3 = 0;
    __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
  }
  __pyx_L3:;
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("_statgrab.Result.__init__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_attr);
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_attrs);
  return __pyx_r;
}


static PyObject *__pyx_f_9_statgrab_6Result___getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_9_statgrab_6Result___getitem__ = {"__getitem__", (PyCFunction)__pyx_f_9_statgrab_6Result___getitem__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_f_9_statgrab_6Result___getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {"self","item",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_self, &__pyx_v_item)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_item);

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":274 */
  __pyx_1 = __Pyx_GetName(__pyx_b, "getattr"); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; goto __pyx_L1;}
  Py_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
  Py_INCREF(__pyx_v_item);
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_item);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __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_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("_statgrab.Result.__getitem__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_item);
  return __pyx_r;
}


static PyObject *__pyx_f_9_statgrab_6Result___repr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_9_statgrab_6Result___repr__ = {"__repr__", (PyCFunction)__pyx_f_9_statgrab_6Result___repr__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_f_9_statgrab_6Result___repr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {"self",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_self)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":276 */
  __pyx_1 = __Pyx_GetName(__pyx_b, "str"); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttrString(__pyx_v_self, "attrs"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
  __pyx_2 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __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_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("_statgrab.Result.__repr__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}


static PyObject *__pyx_f_9_statgrab_17StatgrabException___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_9_statgrab_17StatgrabException___init__ = {"__init__", (PyCFunction)__pyx_f_9_statgrab_17StatgrabException___init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_f_9_statgrab_17StatgrabException___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {"self","value",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_self, &__pyx_v_value)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_value);

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":280 */
  if (PyObject_SetAttrString(__pyx_v_self, "value", __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;}

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_statgrab.StatgrabException.__init__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_value);
  return __pyx_r;
}


static PyObject *__pyx_f_9_statgrab_17StatgrabException___str__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_9_statgrab_17StatgrabException___str__ = {"__str__", (PyCFunction)__pyx_f_9_statgrab_17StatgrabException___str__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_f_9_statgrab_17StatgrabException___str__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {"self",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_self)) return 0;
  Py_INCREF(__pyx_v_self);

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":282 */
  __pyx_1 = __Pyx_GetName(__pyx_b, "repr"); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttrString(__pyx_v_self, "value"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
  __pyx_2 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __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_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("_statgrab.StatgrabException.__str__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}


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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":286 */
  __pyx_1 = (sg_init() == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":287 */
    __pyx_2 = __Pyx_GetName(__pyx_b, "True"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":289 */
    __pyx_2 = __Pyx_GetName(__pyx_b, "False"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_statgrab.py_sg_init");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}


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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":292 */
  __pyx_1 = (sg_drop_privileges() == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":293 */
    __pyx_2 = __Pyx_GetName(__pyx_b, "True"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":295 */
    __pyx_2 = __Pyx_GetName(__pyx_b, "False"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_statgrab.py_sg_drop_privileges");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}


static PyObject *__pyx_f_9_statgrab_py_sg_set_error(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9_statgrab_py_sg_set_error(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_code = 0;
  PyObject *__pyx_v_arg = 0;
  PyObject *__pyx_r;
  sg_error __pyx_1;
  char (*__pyx_2);
  static char *__pyx_argnames[] = {"code","arg",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_code, &__pyx_v_arg)) return 0;
  Py_INCREF(__pyx_v_code);
  Py_INCREF(__pyx_v_arg);

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":298 */
  __pyx_1 = PyInt_AsLong(__pyx_v_code); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; goto __pyx_L1;}
  __pyx_2 = PyString_AsString(__pyx_v_arg); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; goto __pyx_L1;}
  sg_set_error(__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_statgrab.py_sg_set_error");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_code);
  Py_DECREF(__pyx_v_arg);
  return __pyx_r;
}


static PyObject *__pyx_f_9_statgrab_py_sg_set_error_with_errno(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9_statgrab_py_sg_set_error_with_errno(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_code = 0;
  PyObject *__pyx_v_arg = 0;
  PyObject *__pyx_r;
  sg_error __pyx_1;
  char (*__pyx_2);
  static char *__pyx_argnames[] = {"code","arg",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_code, &__pyx_v_arg)) return 0;
  Py_INCREF(__pyx_v_code);
  Py_INCREF(__pyx_v_arg);

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":301 */
  __pyx_1 = PyInt_AsLong(__pyx_v_code); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;}
  __pyx_2 = PyString_AsString(__pyx_v_arg); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;}
  sg_set_error_with_errno(__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("_statgrab.py_sg_set_error_with_errno");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_code);
  Py_DECREF(__pyx_v_arg);
  return __pyx_r;
}


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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":305 */
  __pyx_v_s = sg_get_error();

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":306 */
  __pyx_1 = PyInt_FromLong(__pyx_v_s); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; 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);
  __Pyx_AddTraceback("_statgrab.py_sg_get_error");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}


static PyObject *__pyx_f_9_statgrab_py_sg_get_error_arg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9_statgrab_py_sg_get_error_arg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_s;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  __pyx_v_s = Py_None; Py_INCREF(__pyx_v_s);

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":309 */
  __pyx_1 = PyString_FromString(sg_get_error_arg()); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}
  Py_DECREF(__pyx_v_s);
  __pyx_v_s = __pyx_1;
  __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":310 */
  Py_INCREF(__pyx_v_s);
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_statgrab.py_sg_get_error_arg");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_s);
  return __pyx_r;
}


static PyObject *__pyx_f_9_statgrab_py_sg_get_error_errno(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9_statgrab_py_sg_get_error_errno(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_s;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  __pyx_v_s = Py_None; Py_INCREF(__pyx_v_s);

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":313 */
  __pyx_1 = PyInt_FromLong(sg_get_error_errno()); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; goto __pyx_L1;}
  Py_DECREF(__pyx_v_s);
  __pyx_v_s = __pyx_1;
  __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":314 */
  Py_INCREF(__pyx_v_s);
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("_statgrab.py_sg_get_error_errno");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_s);
  return __pyx_r;
}


static PyObject *__pyx_f_9_statgrab_py_sg_str_error(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9_statgrab_py_sg_str_error(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_code = 0;
  PyObject *__pyx_v_s;
  PyObject *__pyx_r;
  sg_error __pyx_1;
  PyObject *__pyx_2 = 0;
  static char *__pyx_argnames[] = {"code",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_code)) return 0;
  Py_INCREF(__pyx_v_code);
  __pyx_v_s = Py_None; Py_INCREF(__pyx_v_s);

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":317 */
  __pyx_1 = PyInt_AsLong(__pyx_v_code); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; goto __pyx_L1;}
  __pyx_2 = PyString_FromString(sg_str_error(__pyx_1)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; goto __pyx_L1;}
  Py_DECREF(__pyx_v_s);
  __pyx_v_s = __pyx_2;
  __pyx_2 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":318 */
  Py_INCREF(__pyx_v_s);
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("_statgrab.py_sg_str_error");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_s);
  Py_DECREF(__pyx_v_code);
  return __pyx_r;
}

static char (__pyx_k3[]) = "sg_get_host_info() returned NULL";
static char (__pyx_k4[]) = "os_name";
static char (__pyx_k5[]) = "os_release";
static char (__pyx_k6[]) = "os_version";
static char (__pyx_k7[]) = "platform";
static char (__pyx_k8[]) = "hostname";
static char (__pyx_k9[]) = "uptime";

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":322 */
  __pyx_v_s = sg_get_host_info();

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":323 */
  __pyx_1 = (__pyx_v_s == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":324 */
    __pyx_2 = __Pyx_GetName(__pyx_m, "StatgrabException"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_k3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":325 */
  __pyx_2 = __Pyx_GetName(__pyx_m, "Result"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L1;}
  __pyx_4 = PyString_FromString(__pyx_k4); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L1;}
  __pyx_5 = PyString_FromString(__pyx_v_s->os_name); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; goto __pyx_L1;}
  __pyx_5 = PyString_FromString(__pyx_v_s->os_release); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k6); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; goto __pyx_L1;}
  __pyx_5 = PyString_FromString(__pyx_v_s->os_version); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k7); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; goto __pyx_L1;}
  __pyx_5 = PyString_FromString(__pyx_v_s->platform); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k8); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; goto __pyx_L1;}
  __pyx_5 = PyString_FromString(__pyx_v_s->hostname); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k9); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;}
  __pyx_5 = PyInt_FromLong(__pyx_v_s->uptime); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("_statgrab.py_sg_get_host_info");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

static char (__pyx_k10[]) = "sg_get_cpu_stats() returned NULL";
static char (__pyx_k11[]) = "user";
static char (__pyx_k12[]) = "kernel";
static char (__pyx_k13[]) = "idle";
static char (__pyx_k14[]) = "iowait";
static char (__pyx_k15[]) = "swap";
static char (__pyx_k16[]) = "nice";
static char (__pyx_k17[]) = "total";
static char (__pyx_k18[]) = "systime";

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":337 */
  __pyx_v_s = sg_get_cpu_stats();

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":338 */
  __pyx_1 = (__pyx_v_s == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":339 */
    __pyx_2 = __Pyx_GetName(__pyx_m, "StatgrabException"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_k10); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":340 */
  __pyx_2 = __Pyx_GetName(__pyx_m, "Result"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}
  __pyx_4 = PyString_FromString(__pyx_k11); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->user); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k12); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->kernel); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k13); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->idle); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k14); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->iowait); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k15); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->swap); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k16); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->nice); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k17); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->total); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k18); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;}
  __pyx_5 = PyInt_FromLong(__pyx_v_s->systime); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("_statgrab.py_sg_get_cpu_stats");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

static char (__pyx_k19[]) = "sg_get_cpu_stats_diff() returned NULL";
static char (__pyx_k20[]) = "user";
static char (__pyx_k21[]) = "kernel";
static char (__pyx_k22[]) = "idle";
static char (__pyx_k23[]) = "iowait";
static char (__pyx_k24[]) = "swap";
static char (__pyx_k25[]) = "nice";
static char (__pyx_k26[]) = "total";
static char (__pyx_k27[]) = "systime";

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":354 */
  __pyx_v_s = sg_get_cpu_stats_diff();

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":355 */
  __pyx_1 = (__pyx_v_s == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":356 */
    __pyx_2 = __Pyx_GetName(__pyx_m, "StatgrabException"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_k19); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":357 */
  __pyx_2 = __Pyx_GetName(__pyx_m, "Result"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;}
  __pyx_4 = PyString_FromString(__pyx_k20); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->user); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k21); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->kernel); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k22); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->idle); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k23); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->iowait); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k24); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->swap); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k25); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->nice); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k26); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->total); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k27); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;}
  __pyx_5 = PyInt_FromLong(__pyx_v_s->systime); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("_statgrab.py_sg_get_cpu_stats_diff");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

static char (__pyx_k28[]) = "sg_get_cpu_percents() returned NULL";
static char (__pyx_k29[]) = "user";
static char (__pyx_k30[]) = "kernel";
static char (__pyx_k31[]) = "idle";
static char (__pyx_k32[]) = "iowait";
static char (__pyx_k33[]) = "swap";
static char (__pyx_k34[]) = "nice";
static char (__pyx_k35[]) = "time_taken";

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":371 */
  __pyx_v_s = sg_get_cpu_percents();

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":372 */
  __pyx_1 = (__pyx_v_s == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":373 */
    __pyx_2 = __Pyx_GetName(__pyx_m, "StatgrabException"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_k28); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":374 */
  __pyx_2 = __Pyx_GetName(__pyx_m, "Result"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; goto __pyx_L1;}
  __pyx_4 = PyString_FromString(__pyx_k29); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; goto __pyx_L1;}
  __pyx_5 = PyFloat_FromDouble(__pyx_v_s->user); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k30); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; goto __pyx_L1;}
  __pyx_5 = PyFloat_FromDouble(__pyx_v_s->kernel); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k31); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; goto __pyx_L1;}
  __pyx_5 = PyFloat_FromDouble(__pyx_v_s->idle); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k32); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; goto __pyx_L1;}
  __pyx_5 = PyFloat_FromDouble(__pyx_v_s->iowait); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k33); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;}
  __pyx_5 = PyFloat_FromDouble(__pyx_v_s->swap); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k34); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; goto __pyx_L1;}
  __pyx_5 = PyFloat_FromDouble(__pyx_v_s->nice); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k35); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;}
  __pyx_5 = PyInt_FromLong(__pyx_v_s->time_taken); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("_statgrab.py_sg_get_cpu_percents");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

static char (__pyx_k36[]) = "sg_get_mem_stats() returned NULL";
static char (__pyx_k37[]) = "total";
static char (__pyx_k38[]) = "used";
static char (__pyx_k39[]) = "free";
static char (__pyx_k40[]) = "cache";

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":387 */
  __pyx_v_s = sg_get_mem_stats();

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":388 */
  __pyx_1 = (__pyx_v_s == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":389 */
    __pyx_2 = __Pyx_GetName(__pyx_m, "StatgrabException"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_k36); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":390 */
  __pyx_2 = __Pyx_GetName(__pyx_m, "Result"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L1;}
  __pyx_4 = PyString_FromString(__pyx_k37); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->total); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k38); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->used); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k39); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->free); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k40); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->cache); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("_statgrab.py_sg_get_mem_stats");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

static char (__pyx_k41[]) = "sg_get_load_stats() returned NULL";
static char (__pyx_k42[]) = "min1";
static char (__pyx_k43[]) = "min5";
static char (__pyx_k44[]) = "min15";

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":400 */
  __pyx_v_s = sg_get_load_stats();

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":401 */
  __pyx_1 = (__pyx_v_s == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":402 */
    __pyx_2 = __Pyx_GetName(__pyx_m, "StatgrabException"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_k41); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":403 */
  __pyx_2 = __Pyx_GetName(__pyx_m, "Result"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; goto __pyx_L1;}
  __pyx_4 = PyString_FromString(__pyx_k42); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; goto __pyx_L1;}
  __pyx_5 = PyFloat_FromDouble(__pyx_v_s->min1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k43); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; goto __pyx_L1;}
  __pyx_5 = PyFloat_FromDouble(__pyx_v_s->min5); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k44); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; goto __pyx_L1;}
  __pyx_5 = PyFloat_FromDouble(__pyx_v_s->min15); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("_statgrab.py_sg_get_load_stats");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

static char (__pyx_k45[]) = "sg_get_user_stats() returned NULL";
static char (__pyx_k46[]) = "name_list";
static char (__pyx_k47[]) = "num_entries";

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":412 */
  __pyx_v_s = sg_get_user_stats();

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":413 */
  __pyx_1 = (__pyx_v_s == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":414 */
    __pyx_2 = __Pyx_GetName(__pyx_m, "StatgrabException"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_k45); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":415 */
  __pyx_2 = __Pyx_GetName(__pyx_m, "Result"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; goto __pyx_L1;}
  __pyx_4 = PyString_FromString(__pyx_k46); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; goto __pyx_L1;}
  __pyx_5 = PyString_FromString(__pyx_v_s->name_list); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k47); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; goto __pyx_L1;}
  __pyx_5 = PyInt_FromLong(__pyx_v_s->num_entries); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("_statgrab.py_sg_get_user_stats");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

static char (__pyx_k48[]) = "sg_get_swap_stats() returned NULL";
static char (__pyx_k49[]) = "total";
static char (__pyx_k50[]) = "used";
static char (__pyx_k51[]) = "free";

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":423 */
  __pyx_v_s = sg_get_swap_stats();

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":424 */
  __pyx_1 = (__pyx_v_s == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":425 */
    __pyx_2 = __Pyx_GetName(__pyx_m, "StatgrabException"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_k48); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":426 */
  __pyx_2 = __Pyx_GetName(__pyx_m, "Result"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}
  __pyx_4 = PyString_FromString(__pyx_k49); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->total); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k50); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->used); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k51); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->free); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("_statgrab.py_sg_get_swap_stats");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

static char (__pyx_k52[]) = "sg_get_fs_stats() returned NULL";
static char (__pyx_k53[]) = "device_name";
static char (__pyx_k54[]) = "fs_type";
static char (__pyx_k55[]) = "mnt_point";
static char (__pyx_k56[]) = "size";
static char (__pyx_k57[]) = "used";
static char (__pyx_k58[]) = "avail";
static char (__pyx_k59[]) = "total_inodes";
static char (__pyx_k60[]) = "used_inodes";
static char (__pyx_k61[]) = "free_inodes";

static PyObject *__pyx_f_9_statgrab_py_sg_get_fs_stats(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9_statgrab_py_sg_get_fs_stats(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  sg_fs_stats (*__pyx_v_s);
  int __pyx_v_entries;
  PyObject *__pyx_v_list;
  PyObject *__pyx_v_i;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  long __pyx_4;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  __pyx_v_list = Py_None; Py_INCREF(__pyx_v_list);
  __pyx_v_i = Py_None; Py_INCREF(__pyx_v_i);

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":436 */
  __pyx_v_s = sg_get_fs_stats((&__pyx_v_entries));

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":437 */
  __pyx_1 = (__pyx_v_s == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":438 */
    __pyx_2 = __Pyx_GetName(__pyx_m, "StatgrabException"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_k52); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":439 */
  __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; goto __pyx_L1;}
  Py_DECREF(__pyx_v_list);
  __pyx_v_list = __pyx_2;
  __pyx_2 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":440 */
  for (__pyx_4 = 0; __pyx_4 < __pyx_v_entries; ++__pyx_4) {
    __pyx_3 = PyInt_FromLong(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;}
    Py_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_3;
    __pyx_3 = 0;

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":441 */
    __pyx_2 = PyObject_GetAttrString(__pyx_v_list, "append"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}
    __pyx_3 = __Pyx_GetName(__pyx_m, "Result"); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}
    __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}
    __pyx_6 = PyString_FromString(__pyx_k53); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}
    __pyx_7 = PyString_FromString(__pyx_v_s->device_name); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k54); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; goto __pyx_L1;}
    __pyx_7 = PyString_FromString(__pyx_v_s->fs_type); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k55); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}
    __pyx_7 = PyString_FromString(__pyx_v_s->mnt_point); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k56); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->size); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k57); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->used); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k58); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->avail); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k59); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->total_inodes); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k60); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->used_inodes); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k61); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->free_inodes); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_7 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_7);
    __pyx_7 = 0;
    __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":453 */
    __pyx_v_s = (__pyx_v_s + 1);
    __pyx_L3:;
  }
  __pyx_L4:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":454 */
  Py_INCREF(__pyx_v_list);
  __pyx_r = __pyx_v_list;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  __Pyx_AddTraceback("_statgrab.py_sg_get_fs_stats");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_list);
  Py_DECREF(__pyx_v_i);
  return __pyx_r;
}

static char (__pyx_k62[]) = "sg_get_disk_io_stats() returned NULL";
static char (__pyx_k63[]) = "disk_name";
static char (__pyx_k64[]) = "read_bytes";
static char (__pyx_k65[]) = "write_bytes";
static char (__pyx_k66[]) = "systime";

static PyObject *__pyx_f_9_statgrab_py_sg_get_disk_io_stats(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9_statgrab_py_sg_get_disk_io_stats(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  sg_disk_io_stats (*__pyx_v_s);
  int __pyx_v_entries;
  PyObject *__pyx_v_list;
  PyObject *__pyx_v_i;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  long __pyx_4;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  __pyx_v_list = Py_None; Py_INCREF(__pyx_v_list);
  __pyx_v_i = Py_None; Py_INCREF(__pyx_v_i);

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":459 */
  __pyx_v_s = sg_get_disk_io_stats((&__pyx_v_entries));

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":460 */
  __pyx_1 = (__pyx_v_s == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":461 */
    __pyx_2 = __Pyx_GetName(__pyx_m, "StatgrabException"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_k62); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":462 */
  __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; goto __pyx_L1;}
  Py_DECREF(__pyx_v_list);
  __pyx_v_list = __pyx_2;
  __pyx_2 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":463 */
  for (__pyx_4 = 0; __pyx_4 < __pyx_v_entries; ++__pyx_4) {
    __pyx_3 = PyInt_FromLong(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; goto __pyx_L1;}
    Py_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_3;
    __pyx_3 = 0;

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":464 */
    __pyx_2 = PyObject_GetAttrString(__pyx_v_list, "append"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}
    __pyx_3 = __Pyx_GetName(__pyx_m, "Result"); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}
    __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; goto __pyx_L1;}
    __pyx_6 = PyString_FromString(__pyx_k63); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; goto __pyx_L1;}
    __pyx_7 = PyString_FromString(__pyx_v_s->disk_name); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k64); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->read_bytes); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k65); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->write_bytes); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k66); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(__pyx_v_s->systime); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_7 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_7);
    __pyx_7 = 0;
    __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":471 */
    __pyx_v_s = (__pyx_v_s + 1);
    __pyx_L3:;
  }
  __pyx_L4:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":472 */
  Py_INCREF(__pyx_v_list);
  __pyx_r = __pyx_v_list;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  __Pyx_AddTraceback("_statgrab.py_sg_get_disk_io_stats");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_list);
  Py_DECREF(__pyx_v_i);
  return __pyx_r;
}

static char (__pyx_k67[]) = "sg_get_disk_io_stats_diff() returned NULL";
static char (__pyx_k68[]) = "disk_name";
static char (__pyx_k69[]) = "read_bytes";
static char (__pyx_k70[]) = "write_bytes";
static char (__pyx_k71[]) = "systime";

static PyObject *__pyx_f_9_statgrab_py_sg_get_disk_io_stats_diff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9_statgrab_py_sg_get_disk_io_stats_diff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  sg_disk_io_stats (*__pyx_v_s);
  int __pyx_v_entries;
  PyObject *__pyx_v_list;
  PyObject *__pyx_v_i;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  long __pyx_4;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  __pyx_v_list = Py_None; Py_INCREF(__pyx_v_list);
  __pyx_v_i = Py_None; Py_INCREF(__pyx_v_i);

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":477 */
  __pyx_v_s = sg_get_disk_io_stats_diff((&__pyx_v_entries));

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":478 */
  __pyx_1 = (__pyx_v_s == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":479 */
    __pyx_2 = __Pyx_GetName(__pyx_m, "StatgrabException"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_k67); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":480 */
  __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; goto __pyx_L1;}
  Py_DECREF(__pyx_v_list);
  __pyx_v_list = __pyx_2;
  __pyx_2 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":481 */
  for (__pyx_4 = 0; __pyx_4 < __pyx_v_entries; ++__pyx_4) {
    __pyx_3 = PyInt_FromLong(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}
    Py_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_3;
    __pyx_3 = 0;

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":482 */
    __pyx_2 = PyObject_GetAttrString(__pyx_v_list, "append"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; goto __pyx_L1;}
    __pyx_3 = __Pyx_GetName(__pyx_m, "Result"); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; goto __pyx_L1;}
    __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}
    __pyx_6 = PyString_FromString(__pyx_k68); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}
    __pyx_7 = PyString_FromString(__pyx_v_s->disk_name); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k69); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->read_bytes); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k70); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->write_bytes); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k71); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(__pyx_v_s->systime); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_7 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_7);
    __pyx_7 = 0;
    __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":489 */
    __pyx_v_s = (__pyx_v_s + 1);
    __pyx_L3:;
  }
  __pyx_L4:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":490 */
  Py_INCREF(__pyx_v_list);
  __pyx_r = __pyx_v_list;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  __Pyx_AddTraceback("_statgrab.py_sg_get_disk_io_stats_diff");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_list);
  Py_DECREF(__pyx_v_i);
  return __pyx_r;
}

static char (__pyx_k72[]) = "sg_get_network_io_stats() returned NULL";
static char (__pyx_k73[]) = "interface_name";
static char (__pyx_k74[]) = "tx";
static char (__pyx_k75[]) = "rx";
static char (__pyx_k76[]) = "ipackets";
static char (__pyx_k77[]) = "opackets";
static char (__pyx_k78[]) = "ierrors";
static char (__pyx_k79[]) = "oerrors";
static char (__pyx_k80[]) = "collisions";
static char (__pyx_k81[]) = "systime";

static PyObject *__pyx_f_9_statgrab_py_sg_get_network_io_stats(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9_statgrab_py_sg_get_network_io_stats(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  sg_network_io_stats (*__pyx_v_s);
  int __pyx_v_entries;
  PyObject *__pyx_v_list;
  PyObject *__pyx_v_i;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  long __pyx_4;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  __pyx_v_list = Py_None; Py_INCREF(__pyx_v_list);
  __pyx_v_i = Py_None; Py_INCREF(__pyx_v_i);

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":495 */
  __pyx_v_s = sg_get_network_io_stats((&__pyx_v_entries));

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":496 */
  __pyx_1 = (__pyx_v_s == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":497 */
    __pyx_2 = __Pyx_GetName(__pyx_m, "StatgrabException"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_k72); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":498 */
  __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; goto __pyx_L1;}
  Py_DECREF(__pyx_v_list);
  __pyx_v_list = __pyx_2;
  __pyx_2 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":499 */
  for (__pyx_4 = 0; __pyx_4 < __pyx_v_entries; ++__pyx_4) {
    __pyx_3 = PyInt_FromLong(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; goto __pyx_L1;}
    Py_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_3;
    __pyx_3 = 0;

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":500 */
    __pyx_2 = PyObject_GetAttrString(__pyx_v_list, "append"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}
    __pyx_3 = __Pyx_GetName(__pyx_m, "Result"); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}
    __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; goto __pyx_L1;}
    __pyx_6 = PyString_FromString(__pyx_k73); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; goto __pyx_L1;}
    __pyx_7 = PyString_FromString(__pyx_v_s->interface_name); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k74); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->tx); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k75); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->rx); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k76); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->ipackets); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k77); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->opackets); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k78); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->ierrors); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k79); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->oerrors); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k80); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->collisions); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k81); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(__pyx_v_s->systime); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_7 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_7);
    __pyx_7 = 0;
    __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":512 */
    __pyx_v_s = (__pyx_v_s + 1);
    __pyx_L3:;
  }
  __pyx_L4:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":513 */
  Py_INCREF(__pyx_v_list);
  __pyx_r = __pyx_v_list;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  __Pyx_AddTraceback("_statgrab.py_sg_get_network_io_stats");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_list);
  Py_DECREF(__pyx_v_i);
  return __pyx_r;
}

static char (__pyx_k82[]) = "sg_get_network_io_stats_diff() returned NULL";
static char (__pyx_k83[]) = "interface_name";
static char (__pyx_k84[]) = "tx";
static char (__pyx_k85[]) = "rx";
static char (__pyx_k86[]) = "ipackets";
static char (__pyx_k87[]) = "opackets";
static char (__pyx_k88[]) = "ierrors";
static char (__pyx_k89[]) = "oerrors";
static char (__pyx_k90[]) = "collisions";
static char (__pyx_k91[]) = "systime";

static PyObject *__pyx_f_9_statgrab_py_sg_get_network_io_stats_diff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9_statgrab_py_sg_get_network_io_stats_diff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  sg_network_io_stats (*__pyx_v_s);
  int __pyx_v_entries;
  PyObject *__pyx_v_list;
  PyObject *__pyx_v_i;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  long __pyx_4;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  __pyx_v_list = Py_None; Py_INCREF(__pyx_v_list);
  __pyx_v_i = Py_None; Py_INCREF(__pyx_v_i);

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":518 */
  __pyx_v_s = sg_get_network_io_stats_diff((&__pyx_v_entries));

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":519 */
  __pyx_1 = (__pyx_v_s == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":520 */
    __pyx_2 = __Pyx_GetName(__pyx_m, "StatgrabException"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_k82); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":521 */
  __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; goto __pyx_L1;}
  Py_DECREF(__pyx_v_list);
  __pyx_v_list = __pyx_2;
  __pyx_2 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":522 */
  for (__pyx_4 = 0; __pyx_4 < __pyx_v_entries; ++__pyx_4) {
    __pyx_3 = PyInt_FromLong(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; goto __pyx_L1;}
    Py_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_3;
    __pyx_3 = 0;

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":523 */
    __pyx_2 = PyObject_GetAttrString(__pyx_v_list, "append"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;}
    __pyx_3 = __Pyx_GetName(__pyx_m, "Result"); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;}
    __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}
    __pyx_6 = PyString_FromString(__pyx_k83); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}
    __pyx_7 = PyString_FromString(__pyx_v_s->interface_name); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k84); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->tx); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k85); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->rx); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k86); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->ipackets); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k87); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->opackets); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k88); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->ierrors); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k89); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->oerrors); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k90); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}
    __pyx_7 = PyLong_FromLongLong(__pyx_v_s->collisions); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k91); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(__pyx_v_s->systime); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_7 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_7);
    __pyx_7 = 0;
    __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":535 */
    __pyx_v_s = (__pyx_v_s + 1);
    __pyx_L3:;
  }
  __pyx_L4:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":536 */
  Py_INCREF(__pyx_v_list);
  __pyx_r = __pyx_v_list;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  __Pyx_AddTraceback("_statgrab.py_sg_get_network_io_stats_diff");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_list);
  Py_DECREF(__pyx_v_i);
  return __pyx_r;
}

static char (__pyx_k92[]) = "sg_get_network_iface_stats() returned NULL";
static char (__pyx_k93[]) = "interface_name";
static char (__pyx_k94[]) = "speed";
static char (__pyx_k95[]) = "dup";
static char (__pyx_k96[]) = "up";

static PyObject *__pyx_f_9_statgrab_py_sg_get_network_iface_stats(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9_statgrab_py_sg_get_network_iface_stats(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  sg_network_iface_stats (*__pyx_v_s);
  int __pyx_v_entries;
  PyObject *__pyx_v_list;
  PyObject *__pyx_v_i;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  long __pyx_4;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  __pyx_v_list = Py_None; Py_INCREF(__pyx_v_list);
  __pyx_v_i = Py_None; Py_INCREF(__pyx_v_i);

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":541 */
  __pyx_v_s = sg_get_network_iface_stats((&__pyx_v_entries));

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":542 */
  __pyx_1 = (__pyx_v_s == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":543 */
    __pyx_2 = __Pyx_GetName(__pyx_m, "StatgrabException"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_k92); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":544 */
  __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}
  Py_DECREF(__pyx_v_list);
  __pyx_v_list = __pyx_2;
  __pyx_2 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":545 */
  for (__pyx_4 = 0; __pyx_4 < __pyx_v_entries; ++__pyx_4) {
    __pyx_3 = PyInt_FromLong(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;}
    Py_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_3;
    __pyx_3 = 0;

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":546 */
    __pyx_2 = PyObject_GetAttrString(__pyx_v_list, "append"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;}
    __pyx_3 = __Pyx_GetName(__pyx_m, "Result"); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;}
    __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; goto __pyx_L1;}
    __pyx_6 = PyString_FromString(__pyx_k93); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; goto __pyx_L1;}
    __pyx_7 = PyString_FromString(__pyx_v_s->interface_name); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k94); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(__pyx_v_s->speed); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k95); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(__pyx_v_s->dup); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k96); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(__pyx_v_s->up); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_7 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_7);
    __pyx_7 = 0;
    __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":553 */
    __pyx_v_s = (__pyx_v_s + 1);
    __pyx_L3:;
  }
  __pyx_L4:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":554 */
  Py_INCREF(__pyx_v_list);
  __pyx_r = __pyx_v_list;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  __Pyx_AddTraceback("_statgrab.py_sg_get_network_iface_stats");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_list);
  Py_DECREF(__pyx_v_i);
  return __pyx_r;
}

static char (__pyx_k97[]) = "sg_get_page_stats() returned NULL";
static char (__pyx_k98[]) = "pages_pagein";
static char (__pyx_k99[]) = "pages_pageout";

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":558 */
  __pyx_v_s = sg_get_page_stats();

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":559 */
  __pyx_1 = (__pyx_v_s == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":560 */
    __pyx_2 = __Pyx_GetName(__pyx_m, "StatgrabException"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_k97); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":561 */
  __pyx_2 = __Pyx_GetName(__pyx_m, "Result"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}
  __pyx_4 = PyString_FromString(__pyx_k98); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->pages_pagein); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k99); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->pages_pageout); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("_statgrab.py_sg_get_page_stats");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

static char (__pyx_k100[]) = "sg_get_page_stats_diff() returned NULL";
static char (__pyx_k101[]) = "pages_pagein";
static char (__pyx_k102[]) = "pages_pageout";

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":569 */
  __pyx_v_s = sg_get_page_stats_diff();

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":570 */
  __pyx_1 = (__pyx_v_s == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":571 */
    __pyx_2 = __Pyx_GetName(__pyx_m, "StatgrabException"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_k100); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":572 */
  __pyx_2 = __Pyx_GetName(__pyx_m, "Result"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L1;}
  __pyx_4 = PyString_FromString(__pyx_k101); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->pages_pagein); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k102); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; goto __pyx_L1;}
  __pyx_5 = PyLong_FromLongLong(__pyx_v_s->pages_pageout); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("_statgrab.py_sg_get_page_stats_diff");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

static char (__pyx_k103[]) = "sg_get_process_stats() returned NULL";
static char (__pyx_k104[]) = "";
static char (__pyx_k105[]) = "";
static char (__pyx_k106[]) = "process_name";
static char (__pyx_k107[]) = "proctitle";
static char (__pyx_k108[]) = "pid";
static char (__pyx_k109[]) = "parent";
static char (__pyx_k110[]) = "pgid";
static char (__pyx_k111[]) = "uid";
static char (__pyx_k112[]) = "euid";
static char (__pyx_k113[]) = "gid";
static char (__pyx_k114[]) = "egid";
static char (__pyx_k115[]) = "proc_size";
static char (__pyx_k116[]) = "proc_resident";
static char (__pyx_k117[]) = "time_spent";
static char (__pyx_k118[]) = "cpu_percent";
static char (__pyx_k119[]) = "nice";
static char (__pyx_k120[]) = "state";

static PyObject *__pyx_f_9_statgrab_py_sg_get_process_stats(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9_statgrab_py_sg_get_process_stats(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  sg_process_stats (*__pyx_v_s);
  int __pyx_v_entries;
  PyObject *__pyx_v_list;
  PyObject *__pyx_v_i;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  long __pyx_4;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  __pyx_v_list = Py_None; Py_INCREF(__pyx_v_list);
  __pyx_v_i = Py_None; Py_INCREF(__pyx_v_i);

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":581 */
  __pyx_v_s = sg_get_process_stats((&__pyx_v_entries));

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":582 */
  __pyx_1 = (__pyx_v_s == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":583 */
    __pyx_2 = __Pyx_GetName(__pyx_m, "StatgrabException"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_k103); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":584 */
  __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; goto __pyx_L1;}
  Py_DECREF(__pyx_v_list);
  __pyx_v_list = __pyx_2;
  __pyx_2 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":585 */
  for (__pyx_4 = 0; __pyx_4 < __pyx_v_entries; ++__pyx_4) {
    __pyx_3 = PyInt_FromLong(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; goto __pyx_L1;}
    Py_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_3;
    __pyx_3 = 0;

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":586 */
    __pyx_1 = (__pyx_v_s->process_name == 0);
    if (__pyx_1) {

      /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":587 */
      __pyx_v_s->process_name = __pyx_k104;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":588 */
    __pyx_1 = (__pyx_v_s->proctitle == 0);
    if (__pyx_1) {

      /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":589 */
      __pyx_v_s->proctitle = __pyx_k105;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":590 */
    __pyx_2 = PyObject_GetAttrString(__pyx_v_list, "append"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; goto __pyx_L1;}
    __pyx_3 = __Pyx_GetName(__pyx_m, "Result"); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; goto __pyx_L1;}
    __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}
    __pyx_6 = PyString_FromString(__pyx_k106); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}
    __pyx_7 = PyString_FromString(__pyx_v_s->process_name); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k107); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;}
    __pyx_7 = PyString_FromString(__pyx_v_s->proctitle); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k108); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(__pyx_v_s->pid); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k109); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(__pyx_v_s->parent); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k110); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(__pyx_v_s->pgid); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k111); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(__pyx_v_s->uid); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k112); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(__pyx_v_s->euid); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k113); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(__pyx_v_s->gid); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k114); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(__pyx_v_s->egid); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k115); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}
    __pyx_7 = PyLong_FromUnsignedLongLong(__pyx_v_s->proc_size); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k116); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; goto __pyx_L1;}
    __pyx_7 = PyLong_FromUnsignedLongLong(__pyx_v_s->proc_resident); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k117); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(__pyx_v_s->time_spent); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k118); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; goto __pyx_L1;}
    __pyx_7 = PyFloat_FromDouble(__pyx_v_s->cpu_percent); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k119); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(__pyx_v_s->nice); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyString_FromString(__pyx_k120); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    __pyx_7 = PyInt_FromLong(__pyx_v_s->state); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_6, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_7 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_7);
    __pyx_7 = 0;
    __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":608 */
    __pyx_v_s = (__pyx_v_s + 1);
    __pyx_L3:;
  }
  __pyx_L4:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":609 */
  Py_INCREF(__pyx_v_list);
  __pyx_r = __pyx_v_list;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  __Pyx_AddTraceback("_statgrab.py_sg_get_process_stats");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_list);
  Py_DECREF(__pyx_v_i);
  return __pyx_r;
}

static char (__pyx_k121[]) = "sg_get_process_count() returned NULL";
static char (__pyx_k122[]) = "total";
static char (__pyx_k123[]) = "running";
static char (__pyx_k124[]) = "sleeping";
static char (__pyx_k125[]) = "stopped";
static char (__pyx_k126[]) = "zombie";

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":613 */
  __pyx_v_s = sg_get_process_count();

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":614 */
  __pyx_1 = (__pyx_v_s == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":615 */
    __pyx_2 = __Pyx_GetName(__pyx_m, "StatgrabException"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_k121); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_3, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":616 */
  __pyx_2 = __Pyx_GetName(__pyx_m, "Result"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;}
  __pyx_4 = PyString_FromString(__pyx_k122); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;}
  __pyx_5 = PyInt_FromLong(__pyx_v_s->total); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k123); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}
  __pyx_5 = PyInt_FromLong(__pyx_v_s->running); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k124); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; goto __pyx_L1;}
  __pyx_5 = PyInt_FromLong(__pyx_v_s->sleeping); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k125); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; goto __pyx_L1;}
  __pyx_5 = PyInt_FromLong(__pyx_v_s->stopped); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyString_FromString(__pyx_k126); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; goto __pyx_L1;}
  __pyx_5 = PyInt_FromLong(__pyx_v_s->zombie); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_4, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;

  __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_5);
  __Pyx_AddTraceback("_statgrab.py_sg_get_process_count");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

static struct PyMethodDef __pyx_methods[] = {
  {"py_sg_init", (PyCFunction)__pyx_f_9_statgrab_py_sg_init, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_drop_privileges", (PyCFunction)__pyx_f_9_statgrab_py_sg_drop_privileges, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_set_error", (PyCFunction)__pyx_f_9_statgrab_py_sg_set_error, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_set_error_with_errno", (PyCFunction)__pyx_f_9_statgrab_py_sg_set_error_with_errno, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_error", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_error, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_error_arg", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_error_arg, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_error_errno", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_error_errno, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_str_error", (PyCFunction)__pyx_f_9_statgrab_py_sg_str_error, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_host_info", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_host_info, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_cpu_stats", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_cpu_stats, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_cpu_stats_diff", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_cpu_stats_diff, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_cpu_percents", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_cpu_percents, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_mem_stats", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_mem_stats, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_load_stats", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_load_stats, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_user_stats", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_user_stats, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_swap_stats", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_swap_stats, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_fs_stats", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_fs_stats, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_disk_io_stats", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_disk_io_stats, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_disk_io_stats_diff", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_disk_io_stats_diff, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_network_io_stats", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_network_io_stats, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_network_io_stats_diff", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_network_io_stats_diff, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_network_iface_stats", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_network_iface_stats, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_page_stats", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_page_stats, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_page_stats_diff", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_page_stats_diff, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_process_stats", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_process_stats, METH_VARARGS|METH_KEYWORDS, 0},
  {"py_sg_get_process_count", (PyCFunction)__pyx_f_9_statgrab_py_sg_get_process_count, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":226 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_NONE); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_NONE", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":227 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_ASPRINTF); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_ASPRINTF", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":228 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_DEVSTAT_GETDEVS); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_DEVSTAT_GETDEVS", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":229 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_DEVSTAT_SELECTDEVS); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_DEVSTAT_SELECTDEVS", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":230 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_ENOENT); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_ENOENT", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":231 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_GETIFADDRS); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_GETIFADDRS", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":232 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_GETMNTINFO); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_GETMNTINFO", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":233 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_GETPAGESIZE); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_GETPAGESIZE", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":234 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_KSTAT_DATA_LOOKUP); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_KSTAT_DATA_LOOKUP", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":235 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_KSTAT_LOOKUP); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_KSTAT_LOOKUP", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":236 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_KSTAT_OPEN); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_KSTAT_OPEN", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":237 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_KSTAT_READ); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_KSTAT_READ", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":238 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_KVM_GETSWAPINFO); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_KVM_GETSWAPINFO", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":239 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_KVM_OPENFILES); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_KVM_OPENFILES", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":240 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_MALLOC); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_MALLOC", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":241 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_OPEN); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_OPEN", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":242 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_OPENDIR); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_OPENDIR", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":243 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_PARSE); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_PARSE", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":244 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_SETEGID); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_SETEGID", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":245 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_SETEUID); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_SETEUID", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":246 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_SETMNTENT); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_SETMNTENT", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":247 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_SOCKET); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_SOCKET", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":248 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_SWAPCTL); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_SWAPCTL", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":249 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_SYSCONF); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_SYSCONF", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":250 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_SYSCTL); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_SYSCTL", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":251 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_SYSCTLBYNAME); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_SYSCTLBYNAME", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":252 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_SYSCTLNAMETOMIB); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_SYSCTLNAMETOMIB", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":253 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_UNAME); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_UNAME", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":254 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_UNSUPPORTED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_UNSUPPORTED", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":255 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_XSW_VER_MISMATCH); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_ERROR_XSW_VER_MISMATCH", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":257 */
  __pyx_1 = PyInt_FromLong(SG_IFACE_DUPLEX_FULL); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_IFACE_DUPLEX_FULL", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":258 */
  __pyx_1 = PyInt_FromLong(SG_IFACE_DUPLEX_HALF); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_IFACE_DUPLEX_HALF", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":259 */
  __pyx_1 = PyInt_FromLong(SG_IFACE_DUPLEX_UNKNOWN); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_IFACE_DUPLEX_UNKNOWN", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":261 */
  __pyx_1 = PyInt_FromLong(SG_PROCESS_STATE_RUNNING); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_PROCESS_STATE_RUNNING", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":262 */
  __pyx_1 = PyInt_FromLong(SG_PROCESS_STATE_SLEEPING); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_PROCESS_STATE_SLEEPING", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":263 */
  __pyx_1 = PyInt_FromLong(SG_PROCESS_STATE_STOPPED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_PROCESS_STATE_STOPPED", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":264 */
  __pyx_1 = PyInt_FromLong(SG_PROCESS_STATE_ZOMBIE); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_PROCESS_STATE_ZOMBIE", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":265 */
  __pyx_1 = PyInt_FromLong(SG_PROCESS_STATE_UNKNOWN); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "py_SG_PROCESS_STATE_UNKNOWN", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":268 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; goto __pyx_L1;}
  __pyx_2 = PyString_FromString(__pyx_k1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; goto __pyx_L1;}
  __pyx_4 = PyClass_New(__pyx_3, __pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":269 */
  __pyx_2 = PyCFunction_New(&__pyx_mdef_9_statgrab_6Result___init__, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; goto __pyx_L1;}
  __pyx_3 = PyMethod_New(__pyx_2, 0, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (PyObject_SetAttrString(__pyx_4, "__init__", __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":273 */
  __pyx_2 = PyCFunction_New(&__pyx_mdef_9_statgrab_6Result___getitem__, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; goto __pyx_L1;}
  __pyx_3 = PyMethod_New(__pyx_2, 0, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (PyObject_SetAttrString(__pyx_4, "__getitem__", __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":275 */
  __pyx_2 = PyCFunction_New(&__pyx_mdef_9_statgrab_6Result___repr__, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;}
  __pyx_3 = PyMethod_New(__pyx_2, 0, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (PyObject_SetAttrString(__pyx_4, "__repr__", __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PyObject_SetAttrString(__pyx_m, "Result", __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":278 */
  __pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
  __pyx_3 = PyString_FromString(__pyx_k2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
  __pyx_1 = __Pyx_GetName(__pyx_b, "Exception"); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  __pyx_1 = 0;
  __pyx_1 = PyClass_New(__pyx_4, __pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":279 */
  __pyx_3 = PyCFunction_New(&__pyx_mdef_9_statgrab_17StatgrabException___init__, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;}
  __pyx_4 = PyMethod_New(__pyx_3, 0, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PyObject_SetAttrString(__pyx_1, "__init__", __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":281 */
  __pyx_3 = PyCFunction_New(&__pyx_mdef_9_statgrab_17StatgrabException___str__, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;}
  __pyx_4 = PyMethod_New(__pyx_3, 0, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PyObject_SetAttrString(__pyx_1, "__str__", __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  if (PyObject_SetAttrString(__pyx_m, "StatgrabException", __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":611 */
  return;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("_statgrab");
}

static char *__pyx_filenames[] = {
  "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx",
};
statichere char **__pyx_f = __pyx_filenames;

/* Runtime support code */

static PyObject *__Pyx_GetName(PyObject *dict, char *name) {
	PyObject *result;
	result = PyObject_GetAttrString(dict, name);
	if (!result)
		PyErr_SetString(PyExc_NameError, name);
	return result;
}

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
	Py_XINCREF(type);
	Py_XINCREF(value);
	Py_XINCREF(tb);
	/* First, check the traceback argument, replacing None with NULL. */
	if (tb == Py_None) {
		Py_DECREF(tb);
		tb = 0;
	}
	else if (tb != NULL && !PyTraceBack_Check(tb)) {
		PyErr_SetString(PyExc_TypeError,
			"raise: arg 3 must be a traceback or None");
		goto raise_error;
	}
	/* Next, replace a missing value with None */
	if (value == NULL) {
		value = Py_None;
		Py_INCREF(value);
	}
	/* Next, repeatedly, replace a tuple exception with its first item */
	while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {
		PyObject *tmp = type;
		type = PyTuple_GET_ITEM(type, 0);
		Py_INCREF(type);
		Py_DECREF(tmp);
	}
	if (PyString_Check(type))
		;
	else if (PyClass_Check(type))
		; /*PyErr_NormalizeException(&type, &value, &tb);*/
	else if (PyInstance_Check(type)) {
		/* Raising an instance.  The value should be a dummy. */
		if (value != Py_None) {
			PyErr_SetString(PyExc_TypeError,
			  "instance exception may not have a separate value");
			goto raise_error;
		}
		else {
			/* Normalize to raise <class>, <instance> */
			Py_DECREF(value);
			value = type;
			type = (PyObject*) ((PyInstanceObject*)type)->in_class;
			Py_INCREF(type);
		}
	}
	else {
		/* Not something you can raise.  You get an exception
		   anyway, just not what you specified :-) */
		PyErr_Format(PyExc_TypeError,
			     "exceptions must be strings, classes, or "
			     "instances, not %s", type->ob_type->tp_name);
		goto raise_error;
	}
	PyErr_Restore(type, value, tb);
	return;
raise_error:
	Py_XDECREF(value);
	Py_XDECREF(type);
	Py_XDECREF(tb);
	return;
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"

static void __Pyx_AddTraceback(char *funcname) {
	PyObject *py_srcfile = 0;
	PyObject *py_funcname = 0;
	PyObject *py_globals = 0;
	PyObject *empty_tuple = 0;
	PyObject *empty_string = 0;
	PyCodeObject *py_code = 0;
	PyFrameObject *py_frame = 0;
	
	py_srcfile = PyString_FromString(__pyx_filename);
	if (!py_srcfile) goto bad;
	py_funcname = PyString_FromString(funcname);
	if (!py_funcname) goto bad;
	py_globals = PyModule_GetDict(__pyx_m);
	if (!py_globals) goto bad;
	empty_tuple = PyTuple_New(0);
	if (!empty_tuple) goto bad;
	empty_string = PyString_FromString("");
	if (!empty_string) goto bad;
	py_code = PyCode_New(
		0,            /*int argcount,*/
		0,            /*int nlocals,*/
		0,            /*int stacksize,*/
		0,            /*int flags,*/
		empty_string, /*PyObject *code,*/
		empty_tuple,  /*PyObject *consts,*/
		empty_tuple,  /*PyObject *names,*/
		empty_tuple,  /*PyObject *varnames,*/
		empty_tuple,  /*PyObject *freevars,*/
		empty_tuple,  /*PyObject *cellvars,*/
		py_srcfile,   /*PyObject *filename,*/
		py_funcname,  /*PyObject *name,*/
		__pyx_lineno,   /*int firstlineno,*/
		empty_string  /*PyObject *lnotab*/
	);
	if (!py_code) goto bad;
	py_frame = PyFrame_New(
		PyThreadState_Get(), /*PyThreadState *tstate,*/
		py_code,             /*PyCodeObject *code,*/
		py_globals,          /*PyObject *globals,*/
		0                    /*PyObject *locals*/
	);
	if (!py_frame) goto bad;
	py_frame->f_lineno = __pyx_lineno;
	PyTraceBack_Here(py_frame);
bad:
	Py_XDECREF(py_srcfile);
	Py_XDECREF(py_funcname);
	Py_XDECREF(empty_tuple);
	Py_XDECREF(empty_string);
	Py_XDECREF(py_code);
	Py_XDECREF(py_frame);
}
