code: def test_get_flavor_configuration_throws_exception_when_requested_flavor_is_missing(
      model_path, sklearn_knn_model
  ):
      mlflow.sklearn.save_model(
          sk_model=sklearn_knn_model, path=model_path
      )
  
      # The saved model contains the "sklearn" flavor, so this call should succeed
      sklearn_flavor_config = (
          mlflow_model_utils._get_flavor_configuration(
              model_path=model_path,
              flavor_name=mlflow.sklearn.FLAVOR_NAME,
          )
      )
      assert sklearn_flavor_config is not None
  
      # The saved model does not contain the "mleap" flavor, so this call should fail
      with pytest.raises(
          MlflowException,
          match='Model does not have the "mleap" flavor',
      ) as exc:
          mlflow_model_utils._get_flavor_configuration(
              model_path=model_path, flavor_name=MLEAP_FLAVOR_NAME
          )
      assert exc.value.error_code == ErrorCode.Name(
          RESOURCE_DOES_NOT_EXIST
      )
  
file_path: mlflow/tests/utils/test_model_utils.py
imports: import os
  import sys
  import pytest
  import sklearn.neighbors
  from sklearn import datasets
  import mlflow.sklearn
  import mlflow.utils.model_utils
  from mlflow.exceptions import MlflowException
  from mlflow.mleap import FLAVOR_NAME
  from mlflow.models import Model
  from mlflow.protos.databricks_pb2 import RESOURCE_DOES_NOT_EXIST, ErrorCode
  from mlflow.utils.file_utils import TempDir
label_desc: Use image node_id 4 for calling a global function with example usage: test_get_flavor_configuration_throws_exception_when_requested_flavor_is_missing(model_path, sklearn_knn_model) without return types