def validate_client(client: Any) -> None:
    """Validate client and import weaviate library."""
    try:
        import weaviate

        client = cast(weaviate.WeaviateClient, client)
    except ImportError:
        raise ImportError(
            "Weaviate is not installed. "
            "Please install it with `pip install weaviate-client`."
        )
    cast(weaviate.WeaviateClient, client)
Validate client and import weaviate library.
llama-index-integrations/vector_stores/llama-index-vector-stores-weaviate/llama_index/vector_stores/weaviate/utils.py