docstr: Checks for required sets of backend options.
  
  Takes a dictionary of backends plus extra dependencies and generates correct error messages if they are unmet.
  
  Parameters
  ----------
  backend_options
      Dictionary from backend to list of dependencies that must be satisfied. The keys are the available options
      for the user and the values should be a list of dependencies that are checked via the `HAS_BACKEND` map
      defined in this module. An example of `backend_options` would be `{'tensorflow': ['tensorflow'], 'pytorch':
      ['pytorch'], None: []}`.This would mean `'tensorflow'`, `'pytorch'` or `None` are available backend options.
      If the user passes a different backend they will receive and error listing the correct backends. In
      addition, if one of the dependencies in the `backend_option` values is missing for the specified backend
      the validator will issue an error message telling the user what dependency bucket to install.
  construct_name
      Name of the object that has a set of backends we need to verify.
docstr_tok: ["Checks","for","required","sets","of","backend","options",".","Takes","a","dictionary","of","backends","plus","extra","dependencies","and","generates","correct","error","messages","if","they","are","unmet",".","Parameters","--","--","--","--","--","backend_options","Dictionary","from","backend","to","list","of","dependencies","that","must","be","satisfied",".","The","keys","are","the","available","options","for","the","user","and","the","values","should","be","a","list","of","dependencies","that","are","checked","via","the","`","HAS_BACKEND","`","map","defined","in","this","module",".","An","example","of","`","backend_options","`","would","be","`","{","'tensorflow","'",":","[","'tensorflow","'","]",",","'pytorch","'",":","[","'pytorch","'","]",",","None",":","[","]","}","`",".This","would","mean","`","'tensorflow","'","`",",","`","'pytorch","'","`","or","`","None","`","are","available","backend","options",".","If","the","user","passes","a","different","backend","they","will","receive","and","error","listing","the","correct","backends",".","In","addition",",","if","one","of","the","dependencies","in","the","`","backend_option","`","values","is","missing","for","the","specified","backend","the","validator","will","issue","an","error","message","telling","the","user","what","dependency","bucket","to","install",".","construct_name","Name","of","the","object","that","has","a","set","of","backends","we","need","to","verify","."]
code: def __init__(
      self,
      backend_options: Dict[Optional[str], List[str]],
      construct_name: str,
  ):
      """Checks for required sets of backend options.
  
      Takes a dictionary of backends plus extra dependencies and generates correct error messages if they are unmet.
  
      Parameters
      ----------
      backend_options
          Dictionary from backend to list of dependencies that must be satisfied. The keys are the available options
          for the user and the values should be a list of dependencies that are checked via the `HAS_BACKEND` map
          defined in this module. An example of `backend_options` would be `{'tensorflow': ['tensorflow'], 'pytorch':
          ['pytorch'], None: []}`.This would mean `'tensorflow'`, `'pytorch'` or `None` are available backend options.
          If the user passes a different backend they will receive and error listing the correct backends. In
          addition, if one of the dependencies in the `backend_option` values is missing for the specified backend
          the validator will issue an error message telling the user what dependency bucket to install.
      construct_name
          Name of the object that has a set of backends we need to verify.
      """
      self.backend_options = backend_options
      self.construct_name = construct_name
  
file_path: alibi-detect/alibi_detect/utils/frameworks.py
imports: from .missing_optional_dependency import ERROR_TYPES
  from typing import Optional, List, Dict, Iterable
  from enum import Enum
label_desc: Use image node_id 1 to create a new BackendValidator object  with example: obj = BackendValidator(backend_options, construct_name)