def getAllExceptions ( self, key, resolution ):
    """Load all exceptions for this cube"""

    # get the block from the database
    cursor = self.getCursor()
    sql = "SELECT id, exlist FROM %s where zindex=%s" % ( 'exc'+str(resolution), key )
    try:
      cursor.execute ( sql )
      excrows = cursor.fetchall()
    except MySQLdb.Error, e:
      logger.error ( "Error reading exceptions %d: %s. sql=%s" % (e.args[0], e.args[1], sql))
      raise
    finally:
      self.closeCursor ( cursor )

    # Parse and unzip all of the exceptions    
    excs = []
    if excrows == None:
      return []
    else:
      for excstr in excrows:
        excs.append ((np.uint32(excstr[0]), np.load(cStringIO.StringIO(zlib.decompress(excstr[1])))))
      return excs
dataset/ETHPy150Open neurodata/ndstore/ocpca/ocpcadb.py/OCPCADB.getAllExceptions/original