code: def _get_values_or_raise(
      series_a: TimeSeries,
      series_b: TimeSeries,
      intersect: bool,
      stochastic_quantile: Optional[float] = 0.5,
      remove_nan_union: bool = False,
  ) -> Tuple[np.ndarray, np.ndarray]:
      """Returns the processed numpy values of two time series. Processing can be customized with arguments
      `intersect, stochastic_quantile, remove_nan_union`.
  
      Raises a ValueError if the two time series (or their intersection) do not have the same time index.
  
      Parameters
      ----------
      series_a
          A univariate deterministic ``TimeSeries`` instance (the actual series).
      series_b
          A univariate (deterministic or stochastic) ``TimeSeries`` instance (the predicted series).
      intersect
          A boolean for whether to only consider the time intersection between `series_a` and `series_b`
      stochastic_quantile
          Optionally, for stochastic predicted series, return either all sample values with (`stochastic_quantile=None`)
          or any deterministic quantile sample values by setting `stochastic_quantile=quantile` {>=0,<=1}.
      remove_nan_union
          By setting `remove_non_union` to True, remove all indices from `series_a` and `series_b` which have a NaN value
          in either of the two input series.
      """
  
      raise_if_not(
          series_a.width == series_b.width,
          "The two time series must have the same number of components",
          logger,
      )
  
      raise_if_not(
          isinstance(intersect, bool),
          "The intersect parameter must be a bool",
      )
  
      series_a_common = (
          series_a.slice_intersect(series_b) if intersect else series_a
      )
      series_b_common = (
          series_b.slice_intersect(series_a) if intersect else series_b
      )
  
      raise_if_not(
          series_a_common.has_same_time_as(series_b_common),
          "The two time series (or their intersection) "
          "must have the same time index."
          "\nFirst series: {}\nSecond series: {}".format(
              series_a.time_index, series_b.time_index
          ),
          logger,
      )
  
      series_a_det = _get_values(
          series_a_common, stochastic_quantile=stochastic_quantile
      )
      series_b_det = _get_values(
          series_b_common, stochastic_quantile=stochastic_quantile
      )
  
      if not remove_nan_union:
          return series_a_det, series_b_det
  
      b_is_deterministic = bool(len(series_b_det.shape) == 1)
      if b_is_deterministic:
          isnan_mask = np.logical_or(
              np.isnan(series_a_det), np.isnan(series_b_det)
          )
      else:
          isnan_mask = np.logical_or(
              np.isnan(series_a_det),
              np.isnan(series_b_det).any(axis=2).flatten(),
          )
      return np.delete(series_a_det, isnan_mask), np.delete(
          series_b_det, isnan_mask, axis=0
      )
  
imports: from functools import wraps
  from inspect import signature
  from typing import Callable, Optional, Sequence, Tuple, Union
  from warnings import warn
  import numpy
  from darts import TimeSeries
  from darts.dataprocessing import dtw
  from darts.logging import get_logger, raise_if_not, raise_log
  from darts.utils import _build_tqdm_iterator, _parallel_apply
  from darts.utils.statistics import check_seasonality
label_desc: Use image node_id 4 for calling a global function with example usage: _get_values_or_raise(series_a, series_b, intersect, stochastic_quantile, remove_nan_union) and returns: np,  np, series_a_det,  series_b_det