code: def test_merge_series(batch_size, n_obs, n_sub, dtype):
      """Test the helper that merges a divided batch based on division maps
      that track the sub-batch and position of each member
      """
      # Generate an id tracker and compute id_to_sub and id_to_pos
      tracker_np = np.array_split(
          np.random.permutation(batch_size), n_sub
      )
      id_to_sub_np, id_to_pos_np = _build_division_map_ref(
          tracker_np, batch_size, n_sub
      )
      id_to_sub, *_ = input_to_cuml_array(
          id_to_sub_np, convert_to_dtype=np.int32
      )
      id_to_pos, *_ = input_to_cuml_array(
          id_to_pos_np, convert_to_dtype=np.int32
      )
  
      # Generate the final dataset (expected result)
      data_np = (
          (np.random.uniform(-1.0, 1.0, (batch_size, n_obs)))
          .astype(dtype)
          .transpose()
      )
  
      # Divide the dataset according to the id tracker
      data_div = []
      for i in range(n_sub):
          data_piece = np.zeros(
              (n_obs, len(tracker_np[i])), dtype=dtype, order="F"
          )
          for j in range(len(tracker_np[i])):
              data_piece[:, j] = data_np[:, tracker_np[i][j]]
          data_div.append(input_to_cuml_array(data_piece)[0])
  
      # Call the tested function
      data = auto_arima._merge_series(
          data_div, id_to_sub, id_to_pos, batch_size
      )
  
      # Compare the results
      np.testing.assert_allclose(data.to_output("numpy"), data_np)
  
file_path: cuml/python/cuml/tests/test_auto_arima.py
imports: from cuml.internals.input_utils import input_to_cuml_array
  from cuml.tsa import auto_arima
  import pytest
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 5 for calling a global function with example usage: test_merge_series(batch_size, n_obs, n_sub, dtype) without return types