code: def mock_tree_shap_explainer(monkeypatch, request):
      """
      Instantiates a TreeShap explainer where both the `_explainer` and `model` atttributes
      are mocked
  
      Parameters
      ----------
      request:
          Tuple containing number of outputs and model_output string (see TreeShap constructor).
      """
  
      n_outs, model_output = request.param
      seed = 0
      predictor = MockPredictor(
          out_dim=n_outs, out_type=model_output, seed=seed
      )
      tree_explainer = MockTreeExplainer(predictor, seed=seed)
      monkeypatch.setattr(shap, "TreeExplainer", tree_explainer)
      explainer = TreeShap(predictor, model_output=model_output)
  
      return explainer
  
imports: import pytest
  import logging
  import shap
  import spacy
  import numpy
  from sklearn.linear_model import LogisticRegression, LinearRegression
  from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
  from alibi.explainers import ALE
  from alibi.explainers import AnchorTabular
  from alibi.explainers import KernelShap, TreeShap
  from alibi.explainers.tests.utils import predict_fcn, MockTreeExplainer
  from alibi.tests.utils import MockPredictor
  from alibi.utils.lang_model import BertBaseUncased, DistilbertBaseUncased, RobertaBase
  from alibi.utils.download import spacy_model
  import tensorflow
  import alibi_testing
  from alibi_testing.data import get_adult_data, get_iris_data, get_diabetes_data, get_mnist_data, get_movie_sentiment_data
label_desc: Use image node_id 16 for calling a global function with example usage: mock_tree_shap_explainer(monkeypatch, request) and returns: explainer