/* Generated by Pyrex 0.9.3 on Sat Jul 30 19:17:41 2005 */

#include "Python.h"
#include "structmember.h"
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#include "statgrab.h"


typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
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 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_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*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 PyObject *__pyx_n_py_SG_ERROR_NONE;
static PyObject *__pyx_n_py_SG_ERROR_ASPRINTF;
static PyObject *__pyx_n_py_SG_ERROR_DEVSTAT_GETDEVS;
static PyObject *__pyx_n_py_SG_ERROR_DEVSTAT_SELECTDEVS;
static PyObject *__pyx_n_py_SG_ERROR_ENOENT;
static PyObject *__pyx_n_py_SG_ERROR_GETIFADDRS;
static PyObject *__pyx_n_py_SG_ERROR_GETMNTINFO;
static PyObject *__pyx_n_py_SG_ERROR_GETPAGESIZE;
static PyObject *__pyx_n_py_SG_ERROR_KSTAT_DATA_LOOKUP;
static PyObject *__pyx_n_py_SG_ERROR_KSTAT_LOOKUP;
static PyObject *__pyx_n_py_SG_ERROR_KSTAT_OPEN;
static PyObject *__pyx_n_py_SG_ERROR_KSTAT_READ;
static PyObject *__pyx_n_py_SG_ERROR_KVM_GETSWAPINFO;
static PyObject *__pyx_n_py_SG_ERROR_KVM_OPENFILES;
static PyObject *__pyx_n_py_SG_ERROR_MALLOC;
static PyObject *__pyx_n_py_SG_ERROR_OPEN;
static PyObject *__pyx_n_py_SG_ERROR_OPENDIR;
static PyObject *__pyx_n_py_SG_ERROR_PARSE;
static PyObject *__pyx_n_py_SG_ERROR_SETEGID;
static PyObject *__pyx_n_py_SG_ERROR_SETEUID;
static PyObject *__pyx_n_py_SG_ERROR_SETMNTENT;
static PyObject *__pyx_n_py_SG_ERROR_SOCKET;
static PyObject *__pyx_n_py_SG_ERROR_SWAPCTL;
static PyObject *__pyx_n_py_SG_ERROR_SYSCONF;
static PyObject *__pyx_n_py_SG_ERROR_SYSCTL;
static PyObject *__pyx_n_py_SG_ERROR_SYSCTLBYNAME;
static PyObject *__pyx_n_py_SG_ERROR_SYSCTLNAMETOMIB;
static PyObject *__pyx_n_py_SG_ERROR_UNAME;
static PyObject *__pyx_n_py_SG_ERROR_UNSUPPORTED;
static PyObject *__pyx_n_py_SG_ERROR_XSW_VER_MISMATCH;
static PyObject *__pyx_n_py_SG_IFACE_DUPLEX_FULL;
static PyObject *__pyx_n_py_SG_IFACE_DUPLEX_HALF;
static PyObject *__pyx_n_py_SG_IFACE_DUPLEX_UNKNOWN;
static PyObject *__pyx_n_py_SG_PROCESS_STATE_RUNNING;
static PyObject *__pyx_n_py_SG_PROCESS_STATE_SLEEPING;
static PyObject *__pyx_n_py_SG_PROCESS_STATE_STOPPED;
static PyObject *__pyx_n_py_SG_PROCESS_STATE_ZOMBIE;
static PyObject *__pyx_n_py_SG_PROCESS_STATE_UNKNOWN;
static PyObject *__pyx_n_Result;
static PyObject *__pyx_n_StatgrabException;
static PyObject *__pyx_n_py_sg_init;
static PyObject *__pyx_n_py_sg_drop_privileges;
static PyObject *__pyx_n_py_sg_set_error;
static PyObject *__pyx_n_py_sg_set_error_with_errno;
static PyObject *__pyx_n_py_sg_get_error;
static PyObject *__pyx_n_py_sg_get_error_arg;
static PyObject *__pyx_n_py_sg_get_error_errno;
static PyObject *__pyx_n_py_sg_str_error;
static PyObject *__pyx_n_py_sg_get_host_info;
static PyObject *__pyx_n_py_sg_get_cpu_stats;
static PyObject *__pyx_n_py_sg_get_cpu_stats_diff;
static PyObject *__pyx_n_py_sg_get_cpu_percents;
static PyObject *__pyx_n_py_sg_get_mem_stats;
static PyObject *__pyx_n_py_sg_get_load_stats;
static PyObject *__pyx_n_py_sg_get_user_stats;
static PyObject *__pyx_n_py_sg_get_swap_stats;
static PyObject *__pyx_n_py_sg_get_fs_stats;
static PyObject *__pyx_n_py_sg_get_disk_io_stats;
static PyObject *__pyx_n_py_sg_get_disk_io_stats_diff;
static PyObject *__pyx_n_py_sg_get_network_io_stats;
static PyObject *__pyx_n_py_sg_get_network_io_stats_diff;
static PyObject *__pyx_n_py_sg_get_network_iface_stats;
static PyObject *__pyx_n_py_sg_get_page_stats;
static PyObject *__pyx_n_py_sg_get_page_stats_diff;
static PyObject *__pyx_n_py_sg_get_process_stats;
static PyObject *__pyx_n_py_sg_get_process_count;
static PyObject *__pyx_n___init__;
static PyObject *__pyx_n___getitem__;
static PyObject *__pyx_n___repr__;
static PyObject *__pyx_n_Exception;
static PyObject *__pyx_n___str__;

static PyObject *__pyx_n_attrs;
static PyObject *__pyx_n_setattr;

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":277 */
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_attrs, __pyx_v_attrs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; goto __pyx_L1;}

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":278 */
  __pyx_1 = PyObject_GetIter(__pyx_v_attrs); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; 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 = 278; 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":279 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_setattr); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;}
    __pyx_3 = PyObject_GetItem(__pyx_v_attrs, __pyx_v_attr); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; 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 = 279; 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_n_getattr;

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":281 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_getattr); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; 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 = 281; 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_n_str;

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":283 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_attrs); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; 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 = 283; 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_n_value;

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":287 */
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_value, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; 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_n_repr;

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":289 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_repr); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_value); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; 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 = 289; 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_n_True;
static PyObject *__pyx_n_False;

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":293 */
  __pyx_1 = (sg_init() == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":294 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; 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":296 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; 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":299 */
  __pyx_1 = (sg_drop_privileges() == 0);
  if (__pyx_1) {

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":300 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; 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":302 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; 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":305 */
  __pyx_1 = PyInt_AsLong(__pyx_v_code); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; goto __pyx_L1;}
  __pyx_2 = PyString_AsString(__pyx_v_arg); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; 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":308 */
  __pyx_1 = PyInt_AsLong(__pyx_v_code); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;}
  __pyx_2 = PyString_AsString(__pyx_v_arg); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; 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":312 */
  __pyx_v_s = sg_get_error();

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":313 */
  __pyx_1 = PyInt_FromLong(__pyx_v_s); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; 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":316 */
  __pyx_1 = PyString_FromString(sg_get_error_arg()); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; goto __pyx_L1;}
  Py_DECREF(__pyx_v_s);
  __pyx_v_s = __pyx_1;
  __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":317 */
  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":320 */
  __pyx_1 = PyInt_FromLong(sg_get_error_errno()); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;}
  Py_DECREF(__pyx_v_s);
  __pyx_v_s = __pyx_1;
  __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":321 */
  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":324 */
  __pyx_1 = PyInt_AsLong(__pyx_v_code); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}
  __pyx_2 = PyString_FromString(sg_str_error(__pyx_1)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}
  Py_DECREF(__pyx_v_s);
  __pyx_v_s = __pyx_2;
  __pyx_2 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":325 */
  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 PyObject *__pyx_n_os_name;
static PyObject *__pyx_n_os_release;
static PyObject *__pyx_n_os_version;
static PyObject *__pyx_n_platform;
static PyObject *__pyx_n_hostname;
static PyObject *__pyx_n_uptime;

static PyObject *__pyx_k3p;

static char (__pyx_k3[]) = "sg_get_host_info() returned NULL";

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;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;

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

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

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":332 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_Result); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}
  __pyx_4 = PyString_FromString(__pyx_v_s->os_name); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_os_name, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyString_FromString(__pyx_v_s->os_release); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_os_release, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyString_FromString(__pyx_v_s->os_version); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_os_version, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyString_FromString(__pyx_v_s->platform); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_platform, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyString_FromString(__pyx_v_s->hostname); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_hostname, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyInt_FromLong(__pyx_v_s->uptime); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_uptime, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

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

static PyObject *__pyx_n_user;
static PyObject *__pyx_n_kernel;
static PyObject *__pyx_n_idle;
static PyObject *__pyx_n_iowait;
static PyObject *__pyx_n_swap;
static PyObject *__pyx_n_nice;
static PyObject *__pyx_n_total;
static PyObject *__pyx_n_systime;

static PyObject *__pyx_k10p;

static char (__pyx_k10[]) = "sg_get_cpu_stats() returned NULL";

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;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;

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

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

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":347 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_Result); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;}
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->user); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_user, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->kernel); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_kernel, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->idle); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_idle, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->iowait); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_iowait, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->swap); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_swap, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->nice); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_nice, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->total); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_total, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyInt_FromLong(__pyx_v_s->systime); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_systime, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

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

static PyObject *__pyx_k19p;

static char (__pyx_k19[]) = "sg_get_cpu_stats_diff() returned NULL";

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;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;

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

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

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":364 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_Result); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;}
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->user); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_user, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->kernel); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_kernel, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->idle); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_idle, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->iowait); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_iowait, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->swap); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_swap, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->nice); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_nice, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->total); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_total, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyInt_FromLong(__pyx_v_s->systime); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_systime, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

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

static PyObject *__pyx_n_time_taken;

static PyObject *__pyx_k28p;

static char (__pyx_k28[]) = "sg_get_cpu_percents() returned NULL";

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;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;

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

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

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":381 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_Result); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble(__pyx_v_s->user); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_user, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyFloat_FromDouble(__pyx_v_s->kernel); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_kernel, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyFloat_FromDouble(__pyx_v_s->idle); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_idle, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyFloat_FromDouble(__pyx_v_s->iowait); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_iowait, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyFloat_FromDouble(__pyx_v_s->swap); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_swap, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyFloat_FromDouble(__pyx_v_s->nice); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_nice, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyInt_FromLong(__pyx_v_s->time_taken); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_time_taken, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

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

static PyObject *__pyx_n_used;
static PyObject *__pyx_n_free;
static PyObject *__pyx_n_cache;

static PyObject *__pyx_k36p;

static char (__pyx_k36[]) = "sg_get_mem_stats() returned NULL";

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;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;

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

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

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":397 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_Result); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->total); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_total, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->used); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_used, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->free); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_free, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->cache); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_cache, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

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

static PyObject *__pyx_n_min1;
static PyObject *__pyx_n_min5;
static PyObject *__pyx_n_min15;

static PyObject *__pyx_k41p;

static char (__pyx_k41[]) = "sg_get_load_stats() returned NULL";

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;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;

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

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

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":410 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_Result); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; goto __pyx_L1;}
  __pyx_4 = PyFloat_FromDouble(__pyx_v_s->min1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_min1, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyFloat_FromDouble(__pyx_v_s->min5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_min5, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyFloat_FromDouble(__pyx_v_s->min15); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_min15, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

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

static PyObject *__pyx_n_name_list;
static PyObject *__pyx_n_num_entries;

static PyObject *__pyx_k45p;

static char (__pyx_k45[]) = "sg_get_user_stats() returned NULL";

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;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;

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

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

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

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

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

static PyObject *__pyx_k48p;

static char (__pyx_k48[]) = "sg_get_swap_stats() returned NULL";

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;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;

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

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

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":433 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_Result); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; goto __pyx_L1;}
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->total); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_total, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->used); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_used, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->free); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_free, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

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

static PyObject *__pyx_n_append;
static PyObject *__pyx_n_device_name;
static PyObject *__pyx_n_fs_type;
static PyObject *__pyx_n_mnt_point;
static PyObject *__pyx_n_size;
static PyObject *__pyx_n_avail;
static PyObject *__pyx_n_total_inodes;
static PyObject *__pyx_n_used_inodes;
static PyObject *__pyx_n_free_inodes;
static PyObject *__pyx_n_avail_inodes;
static PyObject *__pyx_n_io_size;
static PyObject *__pyx_n_block_size;
static PyObject *__pyx_n_total_blocks;
static PyObject *__pyx_n_free_blocks;
static PyObject *__pyx_n_used_blocks;
static PyObject *__pyx_n_avail_blocks;

static PyObject *__pyx_k52p;

static char (__pyx_k52[]) = "sg_get_fs_stats() returned NULL";

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;
  long __pyx_3;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 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":443 */
  __pyx_v_s = sg_get_fs_stats((&__pyx_v_entries));

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

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

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

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

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":448 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_list, __pyx_n_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; goto __pyx_L1;}
    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_Result); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; goto __pyx_L1;}
    __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    __pyx_6 = PyString_FromString(__pyx_v_s->device_name); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_device_name, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyString_FromString(__pyx_v_s->fs_type); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_fs_type, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyString_FromString(__pyx_v_s->mnt_point); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_mnt_point, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->size); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_size, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->used); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_used, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->avail); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_avail, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->total_inodes); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_total_inodes, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->used_inodes); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_used_inodes, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->free_inodes); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_free_inodes, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->avail_inodes); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_avail_inodes, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->io_size); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_io_size, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->block_size); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_block_size, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->total_blocks); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_total_blocks, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->free_blocks); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_free_blocks, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->used_blocks); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_used_blocks, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->avail_blocks); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_avail_blocks, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_6); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_6 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":468 */
  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_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  __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 PyObject *__pyx_n_disk_name;
static PyObject *__pyx_n_read_bytes;
static PyObject *__pyx_n_write_bytes;

static PyObject *__pyx_k69p;

static char (__pyx_k69[]) = "sg_get_disk_io_stats() returned NULL";

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;
  long __pyx_3;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 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":473 */
  __pyx_v_s = sg_get_disk_io_stats((&__pyx_v_entries));

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

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

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

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

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":478 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_list, __pyx_n_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; goto __pyx_L1;}
    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_Result); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; goto __pyx_L1;}
    __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}
    __pyx_6 = PyString_FromString(__pyx_v_s->disk_name); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_disk_name, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->read_bytes); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_read_bytes, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->write_bytes); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_write_bytes, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyInt_FromLong(__pyx_v_s->systime); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_systime, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_6); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_6 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":486 */
  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_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  __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 PyObject *__pyx_k74p;

static char (__pyx_k74[]) = "sg_get_disk_io_stats_diff() returned NULL";

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;
  long __pyx_3;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 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":491 */
  __pyx_v_s = sg_get_disk_io_stats_diff((&__pyx_v_entries));

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

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

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

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

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":496 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_list, __pyx_n_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; goto __pyx_L1;}
    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_Result); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; goto __pyx_L1;}
    __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; goto __pyx_L1;}
    __pyx_6 = PyString_FromString(__pyx_v_s->disk_name); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_disk_name, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->read_bytes); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_read_bytes, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->write_bytes); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_write_bytes, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyInt_FromLong(__pyx_v_s->systime); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_systime, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_6); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_6 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":504 */
  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_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  __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 PyObject *__pyx_n_interface_name;
static PyObject *__pyx_n_tx;
static PyObject *__pyx_n_rx;
static PyObject *__pyx_n_ipackets;
static PyObject *__pyx_n_opackets;
static PyObject *__pyx_n_ierrors;
static PyObject *__pyx_n_oerrors;
static PyObject *__pyx_n_collisions;

static PyObject *__pyx_k79p;

static char (__pyx_k79[]) = "sg_get_network_io_stats() returned NULL";

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;
  long __pyx_3;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 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":509 */
  __pyx_v_s = sg_get_network_io_stats((&__pyx_v_entries));

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

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

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

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

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":514 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_list, __pyx_n_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;}
    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_Result); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;}
    __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}
    __pyx_6 = PyString_FromString(__pyx_v_s->interface_name); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_interface_name, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->tx); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_tx, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->rx); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_rx, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->ipackets); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_ipackets, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->opackets); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_opackets, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->ierrors); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_ierrors, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->oerrors); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_oerrors, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->collisions); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_collisions, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyInt_FromLong(__pyx_v_s->systime); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_systime, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_6); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_6 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":527 */
  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_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  __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 PyObject *__pyx_k89p;

static char (__pyx_k89[]) = "sg_get_network_io_stats_diff() returned NULL";

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;
  long __pyx_3;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 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":532 */
  __pyx_v_s = sg_get_network_io_stats_diff((&__pyx_v_entries));

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

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

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

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

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":537 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_list, __pyx_n_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}
    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_Result); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}
    __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; goto __pyx_L1;}
    __pyx_6 = PyString_FromString(__pyx_v_s->interface_name); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_interface_name, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->tx); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_tx, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->rx); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_rx, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->ipackets); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_ipackets, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->opackets); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_opackets, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->ierrors); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_ierrors, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->oerrors); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_oerrors, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromLongLong(__pyx_v_s->collisions); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_collisions, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyInt_FromLong(__pyx_v_s->systime); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_systime, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_6); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_6 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":550 */
  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_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  __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 PyObject *__pyx_n_speed;
static PyObject *__pyx_n_duplex;
static PyObject *__pyx_n_up;

static PyObject *__pyx_k99p;

static char (__pyx_k99[]) = "sg_get_network_iface_stats() returned NULL";

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;
  long __pyx_3;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 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":555 */
  __pyx_v_s = sg_get_network_iface_stats((&__pyx_v_entries));

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

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

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

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

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":560 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_list, __pyx_n_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}
    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_Result); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}
    __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; goto __pyx_L1;}
    __pyx_6 = PyString_FromString(__pyx_v_s->interface_name); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_interface_name, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyInt_FromLong(__pyx_v_s->speed); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_speed, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyInt_FromLong(__pyx_v_s->duplex); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_duplex, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyInt_FromLong(__pyx_v_s->up); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_up, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_6); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_6 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":568 */
  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_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  __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 PyObject *__pyx_n_pages_pagein;
static PyObject *__pyx_n_pages_pageout;

static PyObject *__pyx_k104p;

static char (__pyx_k104[]) = "sg_get_page_stats() returned NULL";

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;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;

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

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

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":575 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_Result); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; goto __pyx_L1;}
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->pages_pagein); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_pages_pagein, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->pages_pageout); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_pages_pageout, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

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

static PyObject *__pyx_k107p;

static char (__pyx_k107[]) = "sg_get_page_stats_diff() returned NULL";

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;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;

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

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

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":586 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_Result); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->pages_pagein); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_pages_pagein, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyLong_FromLongLong(__pyx_v_s->pages_pageout); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_pages_pageout, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

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

static PyObject *__pyx_n_process_name;
static PyObject *__pyx_n_proctitle;
static PyObject *__pyx_n_pid;
static PyObject *__pyx_n_parent;
static PyObject *__pyx_n_pgid;
static PyObject *__pyx_n_uid;
static PyObject *__pyx_n_euid;
static PyObject *__pyx_n_gid;
static PyObject *__pyx_n_egid;
static PyObject *__pyx_n_proc_size;
static PyObject *__pyx_n_proc_resident;
static PyObject *__pyx_n_time_spent;
static PyObject *__pyx_n_cpu_percent;
static PyObject *__pyx_n_state;

static PyObject *__pyx_k110p;

static char (__pyx_k110[]) = "sg_get_process_stats() returned NULL";
static char (__pyx_k111[]) = "";
static char (__pyx_k112[]) = "";

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;
  long __pyx_3;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 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":595 */
  __pyx_v_s = sg_get_process_stats((&__pyx_v_entries));

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

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

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

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

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

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

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

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

    /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":604 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_list, __pyx_n_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; goto __pyx_L1;}
    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_Result); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; goto __pyx_L1;}
    __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    __pyx_6 = PyString_FromString(__pyx_v_s->process_name); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_process_name, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyString_FromString(__pyx_v_s->proctitle); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_proctitle, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyInt_FromLong(__pyx_v_s->pid); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_pid, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyInt_FromLong(__pyx_v_s->parent); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_parent, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyInt_FromLong(__pyx_v_s->pgid); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_pgid, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyInt_FromLong(__pyx_v_s->uid); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_uid, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyInt_FromLong(__pyx_v_s->euid); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_euid, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyInt_FromLong(__pyx_v_s->gid); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_gid, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyInt_FromLong(__pyx_v_s->egid); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_egid, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromUnsignedLongLong(__pyx_v_s->proc_size); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_proc_size, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyLong_FromUnsignedLongLong(__pyx_v_s->proc_resident); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_proc_resident, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyInt_FromLong(__pyx_v_s->time_spent); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_time_spent, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyFloat_FromDouble(__pyx_v_s->cpu_percent); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_cpu_percent, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyInt_FromLong(__pyx_v_s->nice); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_nice, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyInt_FromLong(__pyx_v_s->state); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; goto __pyx_L1;}
    if (PyDict_SetItem(__pyx_5, __pyx_n_state, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_6); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
    __pyx_5 = 0;
    __pyx_6 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":623 */
  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_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  __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 PyObject *__pyx_n_running;
static PyObject *__pyx_n_sleeping;
static PyObject *__pyx_n_stopped;
static PyObject *__pyx_n_zombie;

static PyObject *__pyx_k128p;

static char (__pyx_k128[]) = "sg_get_process_count() returned NULL";

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;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;

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

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

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":630 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_Result); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; goto __pyx_L1;}
  __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; goto __pyx_L1;}
  __pyx_4 = PyInt_FromLong(__pyx_v_s->total); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_total, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyInt_FromLong(__pyx_v_s->running); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_running, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyInt_FromLong(__pyx_v_s->sleeping); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_sleeping, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyInt_FromLong(__pyx_v_s->stopped); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_stopped, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyInt_FromLong(__pyx_v_s->zombie); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_zombie, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;

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

static __Pyx_InternTabEntry __pyx_intern_tab[] = {
  {&__pyx_n_Exception, "Exception"},
  {&__pyx_n_False, "False"},
  {&__pyx_n_Result, "Result"},
  {&__pyx_n_StatgrabException, "StatgrabException"},
  {&__pyx_n_True, "True"},
  {&__pyx_n___getitem__, "__getitem__"},
  {&__pyx_n___init__, "__init__"},
  {&__pyx_n___repr__, "__repr__"},
  {&__pyx_n___str__, "__str__"},
  {&__pyx_n_append, "append"},
  {&__pyx_n_attrs, "attrs"},
  {&__pyx_n_avail, "avail"},
  {&__pyx_n_avail_blocks, "avail_blocks"},
  {&__pyx_n_avail_inodes, "avail_inodes"},
  {&__pyx_n_block_size, "block_size"},
  {&__pyx_n_cache, "cache"},
  {&__pyx_n_collisions, "collisions"},
  {&__pyx_n_cpu_percent, "cpu_percent"},
  {&__pyx_n_device_name, "device_name"},
  {&__pyx_n_disk_name, "disk_name"},
  {&__pyx_n_duplex, "duplex"},
  {&__pyx_n_egid, "egid"},
  {&__pyx_n_euid, "euid"},
  {&__pyx_n_free, "free"},
  {&__pyx_n_free_blocks, "free_blocks"},
  {&__pyx_n_free_inodes, "free_inodes"},
  {&__pyx_n_fs_type, "fs_type"},
  {&__pyx_n_getattr, "getattr"},
  {&__pyx_n_gid, "gid"},
  {&__pyx_n_hostname, "hostname"},
  {&__pyx_n_idle, "idle"},
  {&__pyx_n_ierrors, "ierrors"},
  {&__pyx_n_interface_name, "interface_name"},
  {&__pyx_n_io_size, "io_size"},
  {&__pyx_n_iowait, "iowait"},
  {&__pyx_n_ipackets, "ipackets"},
  {&__pyx_n_kernel, "kernel"},
  {&__pyx_n_min1, "min1"},
  {&__pyx_n_min15, "min15"},
  {&__pyx_n_min5, "min5"},
  {&__pyx_n_mnt_point, "mnt_point"},
  {&__pyx_n_name_list, "name_list"},
  {&__pyx_n_nice, "nice"},
  {&__pyx_n_num_entries, "num_entries"},
  {&__pyx_n_oerrors, "oerrors"},
  {&__pyx_n_opackets, "opackets"},
  {&__pyx_n_os_name, "os_name"},
  {&__pyx_n_os_release, "os_release"},
  {&__pyx_n_os_version, "os_version"},
  {&__pyx_n_pages_pagein, "pages_pagein"},
  {&__pyx_n_pages_pageout, "pages_pageout"},
  {&__pyx_n_parent, "parent"},
  {&__pyx_n_pgid, "pgid"},
  {&__pyx_n_pid, "pid"},
  {&__pyx_n_platform, "platform"},
  {&__pyx_n_proc_resident, "proc_resident"},
  {&__pyx_n_proc_size, "proc_size"},
  {&__pyx_n_process_name, "process_name"},
  {&__pyx_n_proctitle, "proctitle"},
  {&__pyx_n_py_SG_ERROR_ASPRINTF, "py_SG_ERROR_ASPRINTF"},
  {&__pyx_n_py_SG_ERROR_DEVSTAT_GETDEVS, "py_SG_ERROR_DEVSTAT_GETDEVS"},
  {&__pyx_n_py_SG_ERROR_DEVSTAT_SELECTDEVS, "py_SG_ERROR_DEVSTAT_SELECTDEVS"},
  {&__pyx_n_py_SG_ERROR_ENOENT, "py_SG_ERROR_ENOENT"},
  {&__pyx_n_py_SG_ERROR_GETIFADDRS, "py_SG_ERROR_GETIFADDRS"},
  {&__pyx_n_py_SG_ERROR_GETMNTINFO, "py_SG_ERROR_GETMNTINFO"},
  {&__pyx_n_py_SG_ERROR_GETPAGESIZE, "py_SG_ERROR_GETPAGESIZE"},
  {&__pyx_n_py_SG_ERROR_KSTAT_DATA_LOOKUP, "py_SG_ERROR_KSTAT_DATA_LOOKUP"},
  {&__pyx_n_py_SG_ERROR_KSTAT_LOOKUP, "py_SG_ERROR_KSTAT_LOOKUP"},
  {&__pyx_n_py_SG_ERROR_KSTAT_OPEN, "py_SG_ERROR_KSTAT_OPEN"},
  {&__pyx_n_py_SG_ERROR_KSTAT_READ, "py_SG_ERROR_KSTAT_READ"},
  {&__pyx_n_py_SG_ERROR_KVM_GETSWAPINFO, "py_SG_ERROR_KVM_GETSWAPINFO"},
  {&__pyx_n_py_SG_ERROR_KVM_OPENFILES, "py_SG_ERROR_KVM_OPENFILES"},
  {&__pyx_n_py_SG_ERROR_MALLOC, "py_SG_ERROR_MALLOC"},
  {&__pyx_n_py_SG_ERROR_NONE, "py_SG_ERROR_NONE"},
  {&__pyx_n_py_SG_ERROR_OPEN, "py_SG_ERROR_OPEN"},
  {&__pyx_n_py_SG_ERROR_OPENDIR, "py_SG_ERROR_OPENDIR"},
  {&__pyx_n_py_SG_ERROR_PARSE, "py_SG_ERROR_PARSE"},
  {&__pyx_n_py_SG_ERROR_SETEGID, "py_SG_ERROR_SETEGID"},
  {&__pyx_n_py_SG_ERROR_SETEUID, "py_SG_ERROR_SETEUID"},
  {&__pyx_n_py_SG_ERROR_SETMNTENT, "py_SG_ERROR_SETMNTENT"},
  {&__pyx_n_py_SG_ERROR_SOCKET, "py_SG_ERROR_SOCKET"},
  {&__pyx_n_py_SG_ERROR_SWAPCTL, "py_SG_ERROR_SWAPCTL"},
  {&__pyx_n_py_SG_ERROR_SYSCONF, "py_SG_ERROR_SYSCONF"},
  {&__pyx_n_py_SG_ERROR_SYSCTL, "py_SG_ERROR_SYSCTL"},
  {&__pyx_n_py_SG_ERROR_SYSCTLBYNAME, "py_SG_ERROR_SYSCTLBYNAME"},
  {&__pyx_n_py_SG_ERROR_SYSCTLNAMETOMIB, "py_SG_ERROR_SYSCTLNAMETOMIB"},
  {&__pyx_n_py_SG_ERROR_UNAME, "py_SG_ERROR_UNAME"},
  {&__pyx_n_py_SG_ERROR_UNSUPPORTED, "py_SG_ERROR_UNSUPPORTED"},
  {&__pyx_n_py_SG_ERROR_XSW_VER_MISMATCH, "py_SG_ERROR_XSW_VER_MISMATCH"},
  {&__pyx_n_py_SG_IFACE_DUPLEX_FULL, "py_SG_IFACE_DUPLEX_FULL"},
  {&__pyx_n_py_SG_IFACE_DUPLEX_HALF, "py_SG_IFACE_DUPLEX_HALF"},
  {&__pyx_n_py_SG_IFACE_DUPLEX_UNKNOWN, "py_SG_IFACE_DUPLEX_UNKNOWN"},
  {&__pyx_n_py_SG_PROCESS_STATE_RUNNING, "py_SG_PROCESS_STATE_RUNNING"},
  {&__pyx_n_py_SG_PROCESS_STATE_SLEEPING, "py_SG_PROCESS_STATE_SLEEPING"},
  {&__pyx_n_py_SG_PROCESS_STATE_STOPPED, "py_SG_PROCESS_STATE_STOPPED"},
  {&__pyx_n_py_SG_PROCESS_STATE_UNKNOWN, "py_SG_PROCESS_STATE_UNKNOWN"},
  {&__pyx_n_py_SG_PROCESS_STATE_ZOMBIE, "py_SG_PROCESS_STATE_ZOMBIE"},
  {&__pyx_n_py_sg_drop_privileges, "py_sg_drop_privileges"},
  {&__pyx_n_py_sg_get_cpu_percents, "py_sg_get_cpu_percents"},
  {&__pyx_n_py_sg_get_cpu_stats, "py_sg_get_cpu_stats"},
  {&__pyx_n_py_sg_get_cpu_stats_diff, "py_sg_get_cpu_stats_diff"},
  {&__pyx_n_py_sg_get_disk_io_stats, "py_sg_get_disk_io_stats"},
  {&__pyx_n_py_sg_get_disk_io_stats_diff, "py_sg_get_disk_io_stats_diff"},
  {&__pyx_n_py_sg_get_error, "py_sg_get_error"},
  {&__pyx_n_py_sg_get_error_arg, "py_sg_get_error_arg"},
  {&__pyx_n_py_sg_get_error_errno, "py_sg_get_error_errno"},
  {&__pyx_n_py_sg_get_fs_stats, "py_sg_get_fs_stats"},
  {&__pyx_n_py_sg_get_host_info, "py_sg_get_host_info"},
  {&__pyx_n_py_sg_get_load_stats, "py_sg_get_load_stats"},
  {&__pyx_n_py_sg_get_mem_stats, "py_sg_get_mem_stats"},
  {&__pyx_n_py_sg_get_network_iface_stats, "py_sg_get_network_iface_stats"},
  {&__pyx_n_py_sg_get_network_io_stats, "py_sg_get_network_io_stats"},
  {&__pyx_n_py_sg_get_network_io_stats_diff, "py_sg_get_network_io_stats_diff"},
  {&__pyx_n_py_sg_get_page_stats, "py_sg_get_page_stats"},
  {&__pyx_n_py_sg_get_page_stats_diff, "py_sg_get_page_stats_diff"},
  {&__pyx_n_py_sg_get_process_count, "py_sg_get_process_count"},
  {&__pyx_n_py_sg_get_process_stats, "py_sg_get_process_stats"},
  {&__pyx_n_py_sg_get_swap_stats, "py_sg_get_swap_stats"},
  {&__pyx_n_py_sg_get_user_stats, "py_sg_get_user_stats"},
  {&__pyx_n_py_sg_init, "py_sg_init"},
  {&__pyx_n_py_sg_set_error, "py_sg_set_error"},
  {&__pyx_n_py_sg_set_error_with_errno, "py_sg_set_error_with_errno"},
  {&__pyx_n_py_sg_str_error, "py_sg_str_error"},
  {&__pyx_n_read_bytes, "read_bytes"},
  {&__pyx_n_repr, "repr"},
  {&__pyx_n_running, "running"},
  {&__pyx_n_rx, "rx"},
  {&__pyx_n_setattr, "setattr"},
  {&__pyx_n_size, "size"},
  {&__pyx_n_sleeping, "sleeping"},
  {&__pyx_n_speed, "speed"},
  {&__pyx_n_state, "state"},
  {&__pyx_n_stopped, "stopped"},
  {&__pyx_n_str, "str"},
  {&__pyx_n_swap, "swap"},
  {&__pyx_n_systime, "systime"},
  {&__pyx_n_time_spent, "time_spent"},
  {&__pyx_n_time_taken, "time_taken"},
  {&__pyx_n_total, "total"},
  {&__pyx_n_total_blocks, "total_blocks"},
  {&__pyx_n_total_inodes, "total_inodes"},
  {&__pyx_n_tx, "tx"},
  {&__pyx_n_uid, "uid"},
  {&__pyx_n_up, "up"},
  {&__pyx_n_uptime, "uptime"},
  {&__pyx_n_used, "used"},
  {&__pyx_n_used_blocks, "used_blocks"},
  {&__pyx_n_used_inodes, "used_inodes"},
  {&__pyx_n_user, "user"},
  {&__pyx_n_value, "value"},
  {&__pyx_n_write_bytes, "write_bytes"},
  {&__pyx_n_zombie, "zombie"},
  {0, 0}
};

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_k3p, __pyx_k3, sizeof(__pyx_k3)},
  {&__pyx_k10p, __pyx_k10, sizeof(__pyx_k10)},
  {&__pyx_k19p, __pyx_k19, sizeof(__pyx_k19)},
  {&__pyx_k28p, __pyx_k28, sizeof(__pyx_k28)},
  {&__pyx_k36p, __pyx_k36, sizeof(__pyx_k36)},
  {&__pyx_k41p, __pyx_k41, sizeof(__pyx_k41)},
  {&__pyx_k45p, __pyx_k45, sizeof(__pyx_k45)},
  {&__pyx_k48p, __pyx_k48, sizeof(__pyx_k48)},
  {&__pyx_k52p, __pyx_k52, sizeof(__pyx_k52)},
  {&__pyx_k69p, __pyx_k69, sizeof(__pyx_k69)},
  {&__pyx_k74p, __pyx_k74, sizeof(__pyx_k74)},
  {&__pyx_k79p, __pyx_k79, sizeof(__pyx_k79)},
  {&__pyx_k89p, __pyx_k89, sizeof(__pyx_k89)},
  {&__pyx_k99p, __pyx_k99, sizeof(__pyx_k99)},
  {&__pyx_k104p, __pyx_k104, sizeof(__pyx_k104)},
  {&__pyx_k107p, __pyx_k107, sizeof(__pyx_k107)},
  {&__pyx_k110p, __pyx_k110, sizeof(__pyx_k110)},
  {&__pyx_k128p, __pyx_k128, sizeof(__pyx_k128)},
  {0, 0, 0}
};

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);
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;};
  __pyx_b = PyImport_AddModule("__builtin__");
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;};
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;};
  if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;};
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;};

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":233 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_NONE); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_NONE, __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_ASPRINTF); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_ASPRINTF, __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_DEVSTAT_GETDEVS); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_DEVSTAT_GETDEVS, __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_DEVSTAT_SELECTDEVS); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_DEVSTAT_SELECTDEVS, __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_ENOENT); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_ENOENT, __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_GETIFADDRS); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_GETIFADDRS, __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_GETMNTINFO); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_GETMNTINFO, __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_GETPAGESIZE); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_GETPAGESIZE, __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_KSTAT_DATA_LOOKUP); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_KSTAT_DATA_LOOKUP, __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_KSTAT_LOOKUP); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_KSTAT_LOOKUP, __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_KSTAT_OPEN); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_KSTAT_OPEN, __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_KSTAT_READ); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_KSTAT_READ, __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_KVM_GETSWAPINFO); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_KVM_GETSWAPINFO, __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_KVM_OPENFILES); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_KVM_OPENFILES, __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_MALLOC); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_MALLOC, __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_OPEN); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_OPEN, __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_OPENDIR); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_OPENDIR, __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_PARSE); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_PARSE, __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_SETEGID); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_SETEGID, __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_SETEUID); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_SETEUID, __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_SETMNTENT); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_SETMNTENT, __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_SOCKET); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_SOCKET, __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_SWAPCTL); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_SWAPCTL, __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":256 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_SYSCONF); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_SYSCONF, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":257 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_SYSCTL); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_SYSCTL, __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_ERROR_SYSCTLBYNAME); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_SYSCTLBYNAME, __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_ERROR_SYSCTLNAMETOMIB); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_SYSCTLNAMETOMIB, __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":260 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_UNAME); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_UNAME, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":261 */
  __pyx_1 = PyInt_FromLong(SG_ERROR_UNSUPPORTED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_UNSUPPORTED, __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_ERROR_XSW_VER_MISMATCH); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_ERROR_XSW_VER_MISMATCH, __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":264 */
  __pyx_1 = PyInt_FromLong(SG_IFACE_DUPLEX_FULL); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_IFACE_DUPLEX_FULL, __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_IFACE_DUPLEX_HALF); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_IFACE_DUPLEX_HALF, __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":266 */
  __pyx_1 = PyInt_FromLong(SG_IFACE_DUPLEX_UNKNOWN); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_py_SG_IFACE_DUPLEX_UNKNOWN, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

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

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

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

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

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

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

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

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

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

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

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

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

  /* "/u1/i-scream/staging/projects/pystatgrab/_statgrab.pyx":625 */
  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[] = {
  "_statgrab.pyx",
};
statichere char **__pyx_f = __pyx_filenames;

/* Runtime support code */

static PyObject *__Pyx_CreateClass(
    PyObject *bases, PyObject *dict, PyObject *name, char *modname)
{
    PyObject *py_modname;
    PyObject *result = 0;
    
    py_modname = PyString_FromString(modname);
    if (!py_modname)
        goto bad;
    if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
        goto bad;
    result = PyClass_New(bases, dict, name);
bad:
    Py_XDECREF(py_modname);
    return result;
}

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result)
        PyErr_SetObject(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;
}

static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
    while (t->p) {
        *t->p = PyString_InternFromString(t->s);
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

#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);
}
