code: def validate_framework(framework: str, field: ModelField) -> str:
      if (
          (framework == Framework.TENSORFLOW and has_tensorflow)
          or (framework == Framework.PYTORCH and has_pytorch)
          or (framework == Framework.KEOPS and has_keops)
      ):
          return framework
      elif framework == Framework.SKLEARN:  # sklearn is a core dep
          return framework
      else:
          raise ImportError(
              f"`{field.name} = '{framework}'` not possible since {framework} is not installed."
          )
  
file_path: alibi-detect/alibi_detect/saving/validators.py
imports: import sys
  from typing import Any, Generic, Optional, Type, TypeVar, Union, List
  import numpy
  from numpy.lib import NumpyVersion
  from pydantic.fields import ModelField
  from alibi_detect.utils.frameworks import has_tensorflow, has_pytorch, has_keops, Framework
label_desc: Use image node_id 2 for calling a global function with example usage: validate_framework(framework, field) and returns: framework, framework