code: def setup_error_analysis(rai_insights, add_ea=True, max_depth=3):
      if add_ea:
          if rai_insights.model is None:
              with pytest.raises(
                  UserConfigValidationException,
                  match="Model is required for error analysis",
              ):
                  rai_insights.error_analysis.add(max_depth=max_depth)
          else:
              rai_insights.error_analysis.add(max_depth=max_depth)
              with pytest.raises(DuplicateManagerConfigException):
                  rai_insights.error_analysis.add(max_depth=max_depth)
      rai_insights.error_analysis.compute()
  
file_path: responsible-ai-toolbox/responsibleai/tests/error_analysis_validator.py
imports: import pytest
  from erroranalysis._internal.matrix_filter import CATEGORY1, CATEGORY2, COUNT, FALSE_COUNT, MATRIX, VALUES
  from raiutils.exceptions import UserConfigValidationException
  from responsibleai._internal.constants import ErrorAnalysisManagerKeys
  from responsibleai.exceptions import DuplicateManagerConfigException
label_desc: Use image node_id 1 for calling a global function with example usage: setup_error_analysis(rai_insights, add_ea, max_depth) without return types