code: def test_dtw_subseq():
      for be in backends:
          for array_type in array_types:
              path, dist = tslearn.metrics.dtw_subsequence_path(
                  cast([2, 3], array_type),
                  cast([1.0, 2.0, 2.0, 3.0, 4.0], array_type),
                  be=be,
              )
              np.testing.assert_allclose(path, [(0, 2), (1, 3)])
              np.testing.assert_allclose(dist, 0.0)
              backend = instantiate_backend(be, array_type)
              backend.belongs_to_backend(dist)
  
              path, dist = tslearn.metrics.dtw_subsequence_path(
                  cast([1, 4], array_type),
                  cast([1.0, 2.0, 2.0, 3.0, 4.0], array_type),
                  be=be,
              )
              np.testing.assert_allclose(path, [(0, 2), (1, 3)])
              np.testing.assert_allclose(dist, np.sqrt(2.0))
              assert backend.belongs_to_backend(dist)
  
imports: import platform
  import sys
  import numpy
  import pytest
  import tslearn.clustering
  import tslearn.metrics
  from scipy.spatial.distance import cdist
  from tslearn.backend.backend import Backend, cast, instantiate_backend
  from tslearn.metrics.dtw_variants import dtw_path
  from tslearn.utils import to_time_series
label_desc: Use image node_id 8 for calling a global function with example usage: test_dtw_subseq() without return types