code: def run_error_analyzer(
      model,
      X_test,
      y_test,
      feature_names,
      categorical_features,
      error_correlation_method,
  ):
      model_analyzer = ModelAnalyzer(
          model, X_test, y_test, feature_names, categorical_features
      )
      scores = model_analyzer.compute_importances(
          error_correlation_method
      )
      if model_analyzer.model_task == ModelTask.CLASSIFICATION:
          diff = (
              model.predict(model_analyzer.dataset)
              != model_analyzer.true_y
          )
      else:
          diff = (
              model.predict(model_analyzer.dataset)
              - model_analyzer.true_y
          )
      assert isinstance(scores, list)
      assert len(scores) == len(feature_names)
      # GBM methods seems to predict all zeros
      # (and sometimes otherwise) even if very few instances non-zero
      is_gbm = error_correlation_method == GBM_SHAP
      sum_diff = sum(diff)
      noisy_gbm = (
          sum_diff < GBM_ERROR_SAMPLES_TOL and sum_diff > 0 and is_gbm
      )
      # If model predicted perfectly, assert all scores are zeros
      if not any(diff):
          assert all(abs(score - 0) < TOL for score in scores)
      elif not noisy_gbm:
          assert any(score != 0 for score in scores)
  
imports: import time
  import numpy
  import pytest
  from common_utils import replicate_dataset
  from sklearn.base import BaseEstimator
  from erroranalysis._internal.constants import ErrorCorrelationMethods, ModelTask
  from erroranalysis._internal.error_analyzer import ModelAnalyzer
  from rai_test_utils.datasets.tabular import create_binary_classification_dataset, create_cancer_data, create_housing_data, create_iris_data, create_simple_titanic_data
  from rai_test_utils.models.lightgbm import create_lightgbm_classifier
  from rai_test_utils.models.model_utils import create_models_classification, create_models_regression
  from rai_test_utils.models.sklearn import create_sklearn_random_forest_classifier, create_sklearn_random_forest_regressor, create_titanic_pipeline
label_desc: Use image node_id 1 for calling a global function with example usage: run_error_analyzer(model, X_test, y_test, feature_names, categorical_features, error_correlation_method) without return types