def _cast_none(x):
    if isinstance(x, six.string_types) and x == NONE_MAGIC_VALUE:
        return None

    return x


# These types as they appear in json schema.
Cast function which serializes special magic string value which indicate "None" to None type.
dataset/ETHPy150Open StackStorm/st2/st2common/st2common/util/casts.py/_cast_none