code: def _multiscale_region(x, y, dist, resolution=2, radius=0):
      n_timestamps_1 = len(x)
      n_timestamps_2 = len(y)
      if not isinstance(resolution, (int, np.integer)):
          raise TypeError("'resolution' must be an integer.")
      if resolution < 1:
          raise ValueError("'resolution' must be a positive integer.")
      if not isinstance(radius, (int, np.integer)):
          raise TypeError("'radius' must be an integer.")
      if radius < 0:
          raise ValueError("'radius' must be a non-negative integer.")
  
      if resolution == 1:
          region = None
      else:
          remainder_1 = n_timestamps_1 % resolution
          remainder_2 = n_timestamps_2 % resolution
  
          if remainder_1 != 0:
              x_padded = np.append(
                  x, np.repeat(x[-1], resolution - remainder_1)
              )
              x_padded = x_padded.reshape(-1, resolution).mean(axis=1)
          else:
              x_padded = x.reshape(-1, resolution).mean(axis=1)
          if remainder_2 != 0:
              y_padded = np.append(
                  y, np.repeat(y[-1], resolution - remainder_2)
              )
              y_padded = y_padded.reshape(-1, resolution).mean(axis=1)
          else:
              y_padded = y.reshape(-1, resolution).mean(axis=1)
          cost_mat_res = cost_matrix(
              x_padded, y_padded, dist=dist, region=None
          )
          acc_cost_mat_res = accumulated_cost_matrix(
              cost_mat_res, region=None
          )
          path_res = _return_path(acc_cost_mat_res)
          region = _blurred_path_region(
              n_timestamps_1,
              n_timestamps_2,
              resolution,
              x_padded.size,
              y_padded.size,
              path_res,
              radius,
          )
      return region
  
imports: import numpy
  from math import ceil, log2, sqrt
  from numba import njit, prange
  from sklearn.utils import check_array
label_desc: Use image node_id 24 for calling a global function with example usage: _multiscale_region(x, y, dist, resolution, radius) and returns: region