code: def _down_sample(high_res: np.ndarray):
      needs_padding = len(high_res) & 1
      if needs_padding:
          high_res = np.append(high_res, high_res[-1])
  
      low_res = np.reshape(high_res, (-1, 2))
      low_res = np.mean(low_res, axis=1)
  
      return low_res
  
imports: import copy
  from typing import Callable, Optional, Union
  import numpy
  import pandas
  import xarray
  from darts import TimeSeries
  from darts.logging import get_logger, raise_if, raise_if_not
  from darts.timeseries import DIMS
  from .cost_matrix import CostMatrix
  from .window import CRWindow, NoWindow, Window
label_desc: Use image node_id 3 for calling a global function with example usage: _down_sample(high_res) and returns: low_res