def SetDebug(self, value):
    # checking boolean via an int is simpler
    try:
      value = int(value)
    except __HOLE__:
      raise DialogException('%s has no boolean equivalent.' % value)
    # but we want to keep it as a boolean.
    self._debug = bool(value)
dataset/ETHPy150Open google/macops/gmacpyutil/gmacpyutil/cocoadialog.py/Dialog.SetDebug