def METHOD_NAME(context: Any) -> SOMATileDBContext:
    """Returns the argument, as long as it's a ``SOMATileDBContext``, or a new
    one if the argument is ``None``. While we already have static type-checking,
    a few things are extra-important to have runtime validation on.  Since it's
    easy for users to pass a ``tiledb.Ctx`` when a ``SOMATileDBContext`` is
    expected, we should offer a helpful redirect when they do.
    """
    if context is None:
        return SOMATileDBContext()
    if isinstance(context, tiledb.Ctx):
        raise TypeError(
            "context is a tiledb.Ctx, not a SOMATileDBContext -- please wrap it in tiledbsoma.SOMATileDBContext(...)"
        )
    if not isinstance(context, SOMATileDBContext):
        raise TypeError("context is not a SOMATileDBContext")
    return context