def _cast_none(x):
    """
    Cast function which serializes special magic string value which indicate "None" to None type.
    """
    if isinstance(x, six.string_types) and x == data.NONE_MAGIC_VALUE:
        return None

    return x

    Cast function which serializes special magic string value which indicate "None" to None type.
    
st2common/st2common/util/casts.py