code: def test_median_filter(shape):
      x = torch.randn(*shape)
  
      for filter_width in [3, 5, 7, 13]:
          filtered = median_filter(x, filter_width)
  
          # using np.pad to reflect-pad, because Scipy's behavior is different near the edges.
          pad_width = filter_width // 2
          padded_x = np.pad(
              x,
              [(0, 0)] * (x.ndim - 1) + [(pad_width, pad_width)],
              mode="reflect",
          )
          scipy_filtered = scipy.ndimage.median_filter(
              padded_x, [1] * (x.ndim - 1) + [filter_width]
          )
          scipy_filtered = scipy_filtered[..., pad_width:-pad_width]
  
          assert np.allclose(filtered, scipy_filtered)
  
file_path: whisper/tests/test_timing.py
imports: import numpy
  import pytest
  import scipy.ndimage
  import torch
  from whisper.timing import dtw_cpu, dtw_cuda, median_filter
label_desc: Use image node_id 3 for calling a global function with example usage: test_median_filter(shape) without return types