code: def _run_forward_from_layer(
      model: tf.keras.models.Model,
      layer: tf.keras.layers.Layer,
      orig_call: Callable,
      orig_dummy_input: Union[list, np.ndarray],
      x: tf.Tensor,
      target: Union[None, tf.Tensor, np.ndarray, list],
      forward_kwargs: Optional[dict] = None,
      run_from_layer_inputs: bool = False,
      select_target: bool = True,
  ) -> tf.Tensor:
      """
      Function currently unused.
      Executes a forward call from an internal layer of the model to the model output.
  
      Parameters
      ----------
      model
          `tensorflow` model.
      layer
          Starting layer for the forward call.
      orig_call
          Original `call` method of the layer.
      orig_dummy_input
          Dummy input needed to initiate the model forward call. The number of instances in the dummy input must
          be the same as the number of instances in `x`. The dummy input values play no role in the evaluation
          as the  layer's status is overwritten during the forward call.
      x
          Layer's inputs. The layer's status is overwritten with `x` during the forward call.
      target
          Target for the output position to be returned.
      forward_kwargs
          Input keyword args. It must be a dict with `numpy` arrays as values. If it's not ``None``,
          the first dimension of the arrays must correspond to the number of instances in `x` and orig_dummy_input.
      run_from_layer_inputs
          If ``True``, the forward pass starts from the layer's inputs, if ``False`` it starts from the layer's outputs.
      select_target
          Whether to return predictions for selected targets or return predictions for all targets.
  
      Returns
      -------
      Model's predictions for the given target.
  
      """
  
      def feed_layer(layer):
          """
          Overwrites the intermediate layer status with the precomputed values `x`.
  
          """
  
          def decorator(func):
              def wrapper(*args, **kwargs):
                  # Store the result and inputs of `layer.call` internally.
                  if run_from_layer_inputs:
                      layer.inp = x
                      layer.result = func(*x, **kwargs)
                  else:
                      layer.inp = args
                      layer.result = x
                  # Return the result to continue with the forward pass.
                  return layer.result
  
              return wrapper
  
          layer.call = decorator(layer.call)
  
      feed_layer(layer)
      if forward_kwargs is None:
          forward_kwargs = {}
      preds = model(orig_dummy_input, **forward_kwargs)
  
      delattr(layer, "inp")
      delattr(layer, "result")
      layer.call = orig_call
  
      if (
          select_target
          and len(model.output_shape) > 1
          and model.output_shape[-1] > 1
      ):
          preds = _select_target(preds, target)
  
      return preds
  
imports: import copy
  import logging
  import string
  import warnings
  from enum import Enum
  from typing import Callable, List, Optional, Tuple, Union, cast
  import numpy
  import tensorflow
  from alibi.api.defaults import DEFAULT_DATA_INTGRAD, DEFAULT_META_INTGRAD
  from alibi.api.interfaces import Explainer, Explanation
  from alibi.utils.approximation_methods import approximation_parameters
label_desc: Use image node_id 4 for calling a global function with example usage: _run_forward_from_layer(model, layer, orig_call, orig_dummy_input, x, target, forward_kwargs, run_from_layer_inputs, select_target) and returns: preds, wrapper, layer