code: def validate(self, document):
      if not self.schema:
          raise Exception(
              "Cannot validate locally the document, you need to pass a schema."
          )
      validation_errors = validate(self.schema, document)
      if validation_errors:
          raise validation_errors[0]
  
file_path: wandb/wandb/vendor/gql-0.2.0/wandb_gql/client.py
imports: import logging
  from wandb_graphql import parse, introspection_query, build_ast_schema, build_client_schema
  from wandb_graphql.validation import validate
  from .transport.local_schema import LocalSchemaTransport
label_desc: Use image node_id 2 for calling the Client obj's underlying member method code with example usage: obj.validate(document) without return types