code: def load_tf_llr(
      filepath: Union[str, os.PathLike],
      dist_s: Union[Distribution, PixelCNN] = None,
      dist_b: Union[Distribution, PixelCNN] = None,
      input_shape: tuple = None,
  ):
      """
      Load LLR TensorFlow models or distributions.
  
      Parameters
      ----------
      detector
          Likelihood ratio detector.
      filepath
          Saved model directory.
      dist_s
          TensorFlow distribution for semantic model.
      dist_b
          TensorFlow distribution for background model.
      input_shape
          Input shape of the model.
  
      Returns
      -------
      Detector with loaded models.
      """
      model_dir = Path(filepath).joinpath("model")
      h5files = [f.name for f in model_dir.glob("[!.]*.h5")]
      if "model_s.h5" in h5files and "model_b.h5" in h5files:
          model_s, dist_s = build_model(
              dist_s,
              input_shape,
              str(model_dir.joinpath("model_s.h5").resolve()),
          )
          model_b, dist_b = build_model(
              dist_b,
              input_shape,
              str(model_dir.joinpath("model_b.h5").resolve()),
          )
          return dist_s, dist_b, model_s, model_b
      else:
          dist_s = tf.keras.models.load_model(
              model_dir.joinpath("model.h5"), compile=False
          )
          if "model_background.h5" in h5files:
              dist_b = tf.keras.models.load_model(
                  model_dir.joinpath("model_background.h5"),
                  compile=False,
              )
          else:
              dist_b = None
          return dist_s, dist_b, None, None
  
imports: import logging
  import os
  from importlib import import_module
  import warnings
  from functools import partial
  from pathlib import Path
  from typing import Callable, Dict, List, Optional, Tuple, Union, Type
  import dill
  import tensorflow
  from tensorflow_probability.python.distributions.distribution import Distribution
  from transformers import AutoTokenizer
  from alibi_detect.ad import AdversarialAE, ModelDistillation
  from alibi_detect.ad.adversarialae import DenseHidden
  from alibi_detect.cd import ChiSquareDrift, ClassifierDrift, KSDrift, MMDDrift, TabularDrift
  from alibi_detect.cd.tensorflow import UAE, HiddenOutput
  from alibi_detect.cd.tensorflow.preprocess import _Encoder
  from alibi_detect.models.tensorflow import PixelCNN, TransformerEmbedding
  from alibi_detect.models.tensorflow.autoencoder import AE, AEGMM, VAE, VAEGMM, DecoderLSTM, EncoderLSTM, Seq2Seq
  from alibi_detect.od import LLR, IForest, Mahalanobis, OutlierAE, OutlierAEGMM, OutlierProphet, OutlierSeq2Seq, OutlierVAE, OutlierVAEGMM, SpectralResidual
  from alibi_detect.od.llr import build_model
  from alibi_detect.utils.tensorflow.kernels import DeepKernel
  from alibi_detect.utils.frameworks import Framework
  from alibi_detect.version import __version__
  from alibi_detect.base import Detector
  from alibi_detect.saving._typing import VALID_DETECTORS
label_desc: Use image node_id 13 for calling a global function with example usage: load_tf_llr(filepath, dist_s, dist_b, input_shape) and returns: dist_s,  dist_b,  model_s,  model_b, dist_s,  dist_b,  None,  None