code: def setup_explainer(rai_insights, add_explainer=True):
      if add_explainer:
          if rai_insights.model is None:
              with pytest.raises(
                  UserConfigValidationException,
                  match="Model is required for model explanations",
              ):
                  rai_insights.explainer.add()
              return
          else:
              rai_insights.explainer.add()
          # Validate calling add multiple times prints a warning
          with pytest.warns(
              UserWarning,
              match="DUPLICATE-EXPLAINER-CONFIG: Ignoring. "
              "Explanation has already been added, "
              "currently limited to one explainer type.",
          ):
              rai_insights.explainer.add()
      rai_insights.explainer.compute()
  
imports: import pytest
  from raiutils.exceptions import UserConfigValidationException
  from raiutils.models import ModelTask
  from responsibleai._internal.constants import ListProperties, ManagerNames
label_desc: Use image node_id 1 for calling a global function with example usage: setup_explainer(rai_insights, add_explainer) without return types