code: def from_json(value, **kwargs):
          
          if isinstance(value, string_types):
              value = value.upper()
              if value in ('TRUE', 'Y', 'YES', 'ON'):
                  return True
              if value in ('FALSE', 'N', 'NO', 'OFF'):
                  return False
          if isinstance(value, int):
              return value
          raise ValueError('Could not load boolean from JSON: {}'.format(value))
docs: Coerces JSON string to boolean