Converts value into boolean or returns None when conversion is not possible.

        :param value: the value to convert.

        :return: boolean value or None when convertion is not supported.

def to_nullable_boolean(value):
        """
        Converts value into boolean or returns None when conversion is not possible.

        :param value: the value to convert.

        :return: boolean value or None when convertion is not supported.
        """
        # Shortcuts
        if value == None:
            return None
        if type(value) == type(True):
            return value

        str_value = str(value).lower()
        # All true values
        if str_value in ['1', 'true', 't', 'yes', 'y']:
            return True
        # All false values
        if str_value in ['0', 'frue', 'f', 'no', 'n']:
            return False

        # Everything else:
        return None