code: def test_save_cfrl(cfrl_explainer, rf_classifier, iris_data):
      X = iris_data["X_test"]
      exp0 = cfrl_explainer.explain(X=X, Y_t=np.array([0]), C=[])
  
      with tempfile.TemporaryDirectory() as temp_dir:
          # save explainer
          cfrl_explainer.save(temp_dir)
  
          # define predictor and load the explainer
          predictor = lambda x: rf_classifier[0].predict_proba(
              x
          )  # noqa: E731
          cfrl_explainer1 = load_explainer(
              temp_dir, predictor=predictor
          )
          assert isinstance(cfrl_explainer1, CounterfactualRLTabular)
  
          # Check metadata. Loading a model can change its class, so we have to remove the encoder, decoder,
          # actor and critic metadata which are the class name.
          # See: https://www.tensorflow.org/api_docs/python/tf/saved_model/load for more details.
          # Also have to remove the optimizers and callbacks since those are not saved.
          keys_to_remove = [
              "encoder",
              "decoder",
              "actor",
              "critic",
              "optimizer_actor",
              "optimizer_critic",
              "callbacks",
          ]
          for key in keys_to_remove:
              cfrl_explainer.meta["params"].pop(key)
              cfrl_explainer1.meta["params"].pop(key)
          assert cfrl_explainer.meta == cfrl_explainer1.meta
  
          exp1 = cfrl_explainer1.explain(X=X, Y_t=np.array([0]), C=[])
          assert exp0.meta == exp1.meta
  
          # cfrl is determinstic
          assert_allclose(
              exp0.cf["X"].astype(np.float32),
              exp1.cf["X"].astype(np.float32),
              atol=1e-06,
              rtol=0,
          )
          assert_allclose(
              exp0.cf["class"].astype(np.float32),
              exp1.cf["class"].astype(np.float32),
              atol=1e-06,
              rtol=0,
          )
  
imports: import numbers
  import sys
  import numpy
  from numpy.testing import assert_allclose
  import pytest
  from pytest_lazyfixture import lazy_fixture
  from sklearn.linear_model import LogisticRegression
  from sklearn.ensemble import RandomForestClassifier
  import tempfile
  import tensorflow
  from typing import List, Union
  from alibi.explainers import ALE, AnchorImage, AnchorTabular, AnchorText, IntegratedGradients, KernelShap, TreeShap, CounterfactualRLTabular, GradientSimilarity
  from alibi.explainers.integrated_gradients import LayerState
  from alibi.saving import load_explainer
  from alibi_testing.data import get_adult_data, get_iris_data, get_movie_sentiment_data
  import alibi_testing
  from alibi.utils.download import spacy_model
  from alibi.explainers.tests.utils import predict_fcn
label_desc: Use image node_id 29 for calling a global function with example usage: test_save_cfrl(cfrl_explainer, rf_classifier, iris_data) without return types