code: def run_error_analysis_adult_census(X, y, categorical_features):
      X, y = sklearn.utils.resample(
          X, y, n_samples=1000, random_state=7, stratify=y
      )
  
      X_train, X_test, y_train, y_test = train_test_split(
          X, y, test_size=0.2, random_state=7, stratify=y
      )
  
      knn = sklearn.neighbors.KNeighborsClassifier()
      knn.fit(X_train, y_train)
  
      model_task = ModelTask.Classification
      explainer = MimicExplainer(
          knn,
          X_train,
          LGBMExplainableModel,
          augment_data=True,
          max_num_of_augmentations=10,
          model_task=model_task,
      )
      global_explanation = explainer.explain_global(X_test)
  
      dashboard = ErrorAnalysisDashboard(
          global_explanation,
          knn,
          dataset=X_test,
          true_y=y_test,
          categorical_features=categorical_features,
      )
      metric = metric_to_display_name[Metrics.ERROR_RATE]
      result = dashboard.input.debug_ml(
          [
              global_explanation.features,
              [],
              [],
              DEFAULT_MAX_DEPTH,
              DEFAULT_NUM_LEAVES,
              DEFAULT_MIN_CHILD_SAMPLES,
              metric,
          ]
      )
      assert WidgetRequestResponseConstants.ERROR not in result
      matrix_features = global_explanation.features[0:1]
      result = dashboard.input.matrix(
          matrix_features, [], [], True, 8, metric
      )
      assert WidgetRequestResponseConstants.ERROR not in result
  
imports: import numpy
  import pandas
  import shap
  import sklearn
  from interpret.ext.blackbox import MimicExplainer
  from interpret.ext.glassbox import LGBMExplainableModel
  from interpret_community.common.constants import ModelTask
  from sklearn.datasets import load_iris, make_classification
  from sklearn.model_selection import train_test_split
  from erroranalysis._internal.constants import Metrics, metric_to_display_name
  from erroranalysis._internal.surrogate_error_tree import DEFAULT_MAX_DEPTH, DEFAULT_MIN_CHILD_SAMPLES, DEFAULT_NUM_LEAVES
  from raiwidgets import ErrorAnalysisDashboard
  from raiwidgets.explanation_constants import WidgetRequestResponseConstants
label_desc: Use image node_id 1 for calling a global function with example usage: run_error_analysis_adult_census(X, y, categorical_features) without return types