def __init__(self, value, strip=True, *args, **kw):
        """Initialisation

        Check that the value is a bool

        In:
          - ``v`` -- value to validate
        """
        try:
            if isinstance(value, basestring):
                value = value.strip()

                if value.lower() in ('yes', 'on', 'true', '1'):
                    self.value = True
                elif value.lower() in ('no', 'off', 'false', '0'):
                    self.value = False
                else:
                    self.value = False
            else:
                self.value = bool(value)
        except (__HOLE__, TypeError):
            raise ValueError(i18n._(u'Must be a boolean'))
dataset/ETHPy150Open Net-ng/kansha/kansha/validator.py/BoolValidator.__init__