def ensure_iterable_type(typ_: type) -> t.Callable[[t.MutableSequence[t.Any]], bool]:
    """Ensure that given mutable sequence has all elements of given types."""

    def v(value: t.MutableSequence[t.Any]) -> bool:
        return all(isinstance(i, typ_) for i in value)

    return v
Ensure that given mutable sequence has all elements of given types.
src/bentoml/_internal/configuration/helpers.py