code: def test_dtw_global_supplied_distance_matrix():
      # Example taken from:
      # Meinard Mueller, Fundamentals of Music Processing
      X = np.array([[1, 3, 3, 8, 1]])
      Y = np.array([[2, 0, 0, 8, 7, 2]])
  
      # Precompute distance matrix.
      C = cdist(X.T, Y.T, metric="euclidean")
  
      gt_D = np.array(
          [
              [1.0, 2.0, 3.0, 10.0, 16.0, 17.0],
              [2.0, 4.0, 5.0, 8.0, 12.0, 13.0],
              [3.0, 5.0, 7.0, 10.0, 12.0, 13.0],
              [9.0, 11.0, 13.0, 7.0, 8.0, 14.0],
              [10, 10.0, 11.0, 14.0, 13.0, 9.0],
          ]
      )
  
      # Supply precomputed distance matrix and specify an invalid distance
      # metric to verify that it isn't used.
      mut_D, _ = librosa.sequence.dtw(C=C, metric="invalid")
  
      assert np.array_equal(gt_D, mut_D)
  
imports: import librosa
  import numpy
  from scipy.spatial.distance import cdist
  import pytest
  from test_core import srand
label_desc: Use image node_id 4 for calling a global function with example usage: test_dtw_global_supplied_distance_matrix() without return types