code: def pythonize(self, val):
          
          __boolean_states__ = {'1': True, 'yes': True, 'true': True, 'on': True,
                                '0': False, 'no': False, 'false': False, 'off': False}
  
          if isinstance(val, bool):
              return val
          val = unique_value(val).lower()
          if val in list(__boolean_states__.keys()):
              return __boolean_states__[val]
  
          raise PythonizeError("Cannot convert '%s' to a boolean value" % val)
docs: Convert value into a boolean
  
          :param val: value to convert
          :type val: bool, int, str
          :return: boolean corresponding to value ::
  
          {'1': True, 'yes': True, 'true': True, 'on': True,
           '0': False, 'no': False, 'false': False, 'off': False}
  
          :rtype: bool