def METHOD_NAME(x: ty_Union[T, None]) -> T:
    """Return the specified `x` cast to the specified `T` type.
    Args:
        x (typing.Union[T, None]): the value to return
    Returns:
        T: the specified `x` cast to `T`
    """
    return ty_cast(T, x)