class_docstr: User-facing API for accessing the NASBench dataset.
docstr: Checks that the model spec is within the dataset.
docstr_tok: ["Checks","that","the","model","spec","is","within","the","dataset","."]
code: def _check_spec(self, model_spec):
      """Checks that the model spec is within the dataset."""
      if not model_spec.valid_spec:
          raise OutOfDomainError(
              "invalid spec, provided graph is disconnected."
          )
  
      num_vertices = len(model_spec.ops)
      num_edges = np.sum(model_spec.matrix)
  
      if num_vertices > self.config["module_vertices"]:
          raise OutOfDomainError(
              "too many vertices, got %d (max vertices = %d)"
              % (num_vertices, config["module_vertices"])
          )
  
      if num_edges > self.config["max_edges"]:
          raise OutOfDomainError(
              "too many edges, got %d (max edges = %d)"
              % (num_edges, self.config["max_edges"])
          )
  
      if model_spec.ops[0] != "input":
          raise OutOfDomainError("first operation should be 'input'")
      if model_spec.ops[-1] != "output":
          raise OutOfDomainError("last operation should be 'output'")
      for op in model_spec.ops[1:-1]:
          if op not in self.config["available_ops"]:
              raise OutOfDomainError(
                  "unsupported op %s (available ops = %s)"
                  % (op, self.config["available_ops"])
              )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import random
  import time
  import shelve
  import hashlib
  import _pickle
  import numpy
label_desc: Use image node_id 9 for calling the NASBench obj's underlying member method code with example usage: obj._check_spec(model_spec) without return types