def _check(return_val):
    """Checks the return code of the C calls"""
    if isinstance(return_val, int) and return_val == 1:
      return
    if isinstance(return_val, bool) and return_val == True:
      return

    raise Exception((str(type(return_val)), str(return_val)) % "Cipher exception: Unknown type %s or value %s")
dataset/ETHPy150Open gdanezis/petlib/petlib/cipher.py/_check/swapped operands of `%`