code: def get_baseline_value(
      value: Union[float, int, str, np.array],
      arr: np.ndarray,
      return_shape: Tuple,
      patch: Optional[np.ndarray] = None,
      **kwargs,
  ) -> np.array:
      """
      Get the baseline value to fill the array with, in the shape of return_shape.
  
      Parameters
      ----------
      value: float, int, str, np.ndarray
          Either the value (float, int) to fill the array with, a method (string) used to construct
          baseline array ("mean", "uniform", "black", "white", "neighbourhood_mean" or
          "neighbourhood_random_min_max"), or the array (np.array) to be returned.
      arr: np.ndarray
          CxWxH image array used to calculate baseline values, i.e. for "mean", "black" and "white" methods.
      return_shape: tuple
          CxWxH shape to be returned.
      patch: np.ndarray, optional
          CxWxH patch array to calculate baseline values.
          Necessary for "neighbourhood_mean" and "neighbourhood_random_min_max" methods.
      kwargs: optional
              Keyword arguments.
  
      Returns
      -------
      np.ndarray
          Baseline array in return_shape.
  
      """
  
      kwargs["return_shape"] = return_shape
      if isinstance(value, (float, int)):
          return np.full(return_shape, value)
      elif isinstance(value, np.ndarray):
          if value.ndim == 0:
              return np.full(return_shape, value)
          elif value.shape == return_shape:
              return value
          else:
              raise ValueError(
                  "Shape {} of argument 'value' cannot be fitted to required shape {} of return value".format(
                      value.shape, return_shape
                  )
              )
      elif isinstance(value, str):
          fill_dict = get_baseline_dict(arr, patch, **kwargs)
          if value.lower() == "random":
              raise ValueError(
                  "'random' as a choice for 'perturb_baseline' is deprecated and has been removed from "
                  "the current release. Please use 'uniform' instead and pass lower- and upper bounds to "
                  "kwargs as see fit (default values are set to 'uniform_low=0.0' and 'uniform_high=1.0' "
                  "which will replicate the results of 'random').\n"
              )
          if value.lower() not in fill_dict:
              raise ValueError(
                  f"Ensure that 'value'(string) is in {list(fill_dict.keys())}"
              )
          return np.full(return_shape, fill_dict[value.lower()])
      else:
          raise ValueError(
              "Specify 'value' as a np.array, string, integer or float."
          )
  
imports: import copy
  import re
  from importlib import util
  from typing import Any, Dict, Optional, Sequence, Tuple, Union, List, TypeVar
  import numpy
  from skimage.segmentation import slic, felzenszwalb
  from quantus.helpers import asserts
  from quantus.helpers.model.model_interface import ModelInterface
label_desc: Use image node_id 2 for calling a global function with example usage: get_baseline_value(value, arr, return_shape, patch) and returns: np, np, np, value