code: def _compute_samples(model, predictions, n_samples):
      """
      This function is drawn from Model._calculate_confidence_intervals() in tbats.
      We have to implement our own version here in order to compute the samples before
      the inverse boxcox transform.
      """
  
      # In the deterministic case we return the analytic mean
      if n_samples == 1:
          return np.expand_dims(predictions, axis=1)
  
      F = model.matrix.make_F_matrix()
      g = model.matrix.make_g_vector()
      w = model.matrix.make_w_vector()
  
      c = np.asarray([1.0] * len(predictions))
      f_running = np.identity(F.shape[1])
      for step in range(1, len(predictions)):
          c[step] = w @ f_running @ g
          f_running = f_running @ F
      variance_multiplier = np.cumsum(c * c)
  
      base_variance_boxcox = np.sum(
          model.resid_boxcox * model.resid_boxcox
      ) / len(model.y)
      variance_boxcox = base_variance_boxcox * variance_multiplier
      std_boxcox = np.sqrt(variance_boxcox)
  
      # get the samples before inverse boxcoxing
      samples = np.random.normal(
          loc=model._boxcox(predictions),
          scale=std_boxcox,
          size=(n_samples, len(predictions)),
      ).T
      samples = np.expand_dims(samples, axis=1)
  
      # apply inverse boxcox if needed
      boxcox_lambda = model.params.box_cox_lambda
      if boxcox_lambda is not None:
          samples = inv_boxcox(samples, boxcox_lambda)
  
      return samples
  
imports: from abc import ABC, abstractmethod
  from typing import List, Optional, Tuple, Union
  import numpy
  from scipy.special import inv_boxcox
  from tbats import BATS
  from tbats import TBATS
  from darts.logging import get_logger
  from darts.models.forecasting.forecasting_model import LocalForecastingModel
  from darts.timeseries import TimeSeries
label_desc: Use image node_id 2 for calling a global function with example usage: _compute_samples(model, predictions, n_samples) and returns: samples, np