code: def run_error_analyzer(
      model,
      X_test,
      y_test,
      feature_names,
      categorical_features,
      expect_user_warnings=False,
      filter_features=None,
  ):
      if expect_user_warnings and pd.__version__[0] == "0":
          with pytest.warns(
              UserWarning, match="which has issues with pandas version"
          ):
              model_analyzer = ModelAnalyzer(
                  model,
                  X_test,
                  y_test,
                  feature_names,
                  categorical_features,
              )
      else:
          model_analyzer = ModelAnalyzer(
              model, X_test, y_test, feature_names, categorical_features
          )
      report1 = model_analyzer.create_error_report(
          filter_features,
          max_depth=3,
          num_leaves=None,
          compute_importances=True,
      )
      report2 = model_analyzer.create_error_report()
      assert report1.id != report2.id
  
      # validate uuids in correct format
      assert is_valid_uuid(report1.id)
      assert is_valid_uuid(report2.id)
  
      json_str1 = report1.to_json()
      json_str2 = report2.to_json()
      assert json_str1 != json_str2
  
      # validate deserialized error report json
      ea_deserialized = ErrorReport.from_json(json_str1)
      assert ea_deserialized.id == report1.id
      assert ea_deserialized.matrix == report1.matrix
      assert ea_deserialized.tree == report1.tree
      assert ea_deserialized.tree_features == report1.tree_features
      assert ea_deserialized.matrix_features == report1.matrix_features
      assert ea_deserialized.importances == report1.importances
      assert ea_deserialized.root_stats == report1.root_stats
  
      if not filter_features:
          assert ea_deserialized.matrix is None
      else:
          assert ea_deserialized.matrix is not None
  
      # validate error report does not modify original dataset in ModelAnalyzer
      if isinstance(X_test, pd.DataFrame):
          assert X_test.equals(model_analyzer.dataset)
      else:
          assert np.array_equal(X_test, model_analyzer.dataset)
  
file_path: responsible-ai-toolbox/erroranalysis/tests/test_error_report.py
imports: import numpy
  import pandas
  import pytest
  from erroranalysis._internal.error_analyzer import ModelAnalyzer
  from erroranalysis._internal.error_report import ErrorReport
  from rai_test_utils.datasets.tabular import create_cancer_data, create_housing_data, create_iris_data, create_simple_titanic_data
  from rai_test_utils.models.model_utils import create_models_classification, create_models_regression
  from rai_test_utils.models.sklearn import create_complex_classification_pipeline
  from rai_test_utils.utilities import is_valid_uuid
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, expect_user_warnings, filter_features) without return types