code: def _helper_load_CounterfactualRL(
      path: Union[str, os.PathLike], predictor: Callable, explainer
  ):
      # define extension
      from alibi.utils.frameworks import Framework
  
      ext = (
          ".tf"
          if explainer.params["backend"] == Framework.TENSORFLOW
          else ".pth"
      )
  
      # load the encoder and decoder (autoencoder components)
      explainer.params["encoder"] = explainer.backend.load_model(
          Path(path, "encoder" + ext)
      )
      explainer.params["decoder"] = explainer.backend.load_model(
          Path(path, "decoder" + ext)
      )
  
      # load the actor and critic
      explainer.params["actor"] = explainer.backend.load_model(
          Path(path, "actor" + ext)
      )
      explainer.params["critic"] = explainer.backend.load_model(
          Path(path, "critic" + ext)
      )
  
      # reset predictor
      explainer.reset_predictor(predictor)
      return explainer
  
imports: import copy
  import json
  import numbers
  import os
  from pathlib import Path
  import sys
  from typing import Callable, TYPE_CHECKING, Union
  import warnings
  import dill
  import numpy
  from alibi.version import __version__
label_desc: Use image node_id 15 for calling a global function with example usage: _helper_load_CounterfactualRL(path, predictor, explainer) and returns: explainer