code: def test_sync_multi(aggregate, ndim: int, axis: int):
      data = np.ones([6] * ndim, dtype=float)
  
      # Make some slices that don't fill the entire dimension
      slices = [slice(1, 3), slice(3, 4)]
      dsync = librosa.util.sync(
          data, slices, aggregate=aggregate, axis=axis
      )
  
      # Check the axis shapes
      assert dsync.shape[axis] == len(slices)
  
      s_test = list(dsync.shape)
      del s_test[axis]
      s_orig = list(data.shape)
      del s_orig[axis]
      assert s_test == s_orig
  
      # The first slice will sum to 2 and have mean 1
      idx: List[Union[slice, int]] = [slice(None)] * ndim
      idx[axis] = 0
      if aggregate is np.sum:
          assert np.allclose(dsync[tuple(idx)], 2)
      else:
          assert np.allclose(dsync[tuple(idx)], 1)
  
      # The second slice will sum to 1 and have mean 1
      idx[axis] = 1
      assert np.allclose(dsync[tuple(idx)], 1)
  
imports: import os
  import librosa
  import glob
  import numpy
  import scipy.io
  import scipy.stats
  import pytest
  import warnings
  from unittest import mock
  from typing import List, Union
  from contextlib import nullcontext
  from test_core import srand
label_desc: Use image node_id 4 for calling a global function with example usage: test_sync_multi(aggregate, ndim, axis) without return types