# Path: diffrax/custom_types.py
# def _item_to_str(item: Union[str, type, slice]) -> str:
# def _maybe_tuple_to_str(
#     item: Union[str, type, slice, Tuple[Union[str, type, slice], ...]]
# ) -> str:
#     def __class_getitem__(cls, item):
#     def __class_getitem__(cls, item):
#     def __class_getitem__(cls, item):
#     def __class_getitem__(cls, item):
# class _Array(Generic[_Annotation]):
# class _PyTree(Generic[_Annotation]):
# class Array:
#         class X:
# class PyTree:
#         class X:
# class Scalar:
# class Array:
# class PyTree:
# 
# Path: diffrax/misc/unvmap.py
# def unvmap_any(x):
#     return _unvmap_any_p.bind(x)


from typing import Callable, Sequence, Type, Union
from ..custom_types import Array, Int
from .unvmap import unvmap_any
import jax
import jax.experimental.host_callback as hcb
import jax.numpy as jnp
import numpy as np




_Bool = Union[bool, Array[..., bool]]


def error_if(
    pred: Union[_Bool, Callable[[], _Bool]],

# Path: diffrax/custom_types.py
# def _item_to_str(item: Union[str, type, slice]) -> str:
# def _maybe_tuple_to_str(
#     item: Union[str, type, slice, Tuple[Union[str, type, slice], ...]]
# ) -> str:
#     def __class_getitem__(cls, item):
#     def __class_getitem__(cls, item):
#     def __class_getitem__(cls, item):
#     def __class_getitem__(cls, item):
# class _Array(Generic[_Annotation]):
# class _PyTree(Generic[_Annotation]):
# class Array:
#         class X:
# class PyTree:
#         class X:
# class Scalar:
# class Array:
# class PyTree:
# 
# Path: diffrax/misc/unvmap.py
# def unvmap_any(x):
#     return _unvmap_any_p.bind(x)


# Path: diffrax/misc/errors.py
from typing import Callable, Sequence, Type, Union
from ..custom_types import Array, Int
from .unvmap import unvmap_any
import jax
import jax.experimental.host_callback as hcb
import jax.numpy as jnp
import numpy as np





_Bool = Union[bool, Array[..., bool]]


def error_if(
    pred: Union[_Bool, Callable[[], _Bool]],

    msg: str,