code: def naive_forecaster(
      ts, prediction_length, num_samples=100, target_dim=0
  ):
      """
      :param ts: pandas.Series
      :param prediction_length:
      :param num_samples: number of sample paths
      :param target_dim: number of axes of target (0: scalar, 1: array, ...)
      :return: np.array with dimension (num_samples, prediction_length)
      """
  
      # naive prediction: last observed value
      naive_pred = ts.values[-prediction_length - 1]
      assert len(naive_pred.shape) == target_dim
      return np.tile(
          naive_pred,
          (num_samples, prediction_length)
          + tuple(1 for _ in range(target_dim)),
      )
  
file_path: gluonts/test/evaluation/test_evaluator.py
imports: import numpy
  import pandas
  import pytest
  from gluonts.evaluation import Evaluator, MultivariateEvaluator, aggregate_valid
  from gluonts.model.forecast import QuantileForecast, SampleForecast
label_desc: Use image node_id 3 for calling a global function with example usage: naive_forecaster(ts, prediction_length, num_samples, target_dim) and returns: np