code: def test_symmetric_cdist():
      for be in backends:
          for array_type in array_types:
              backend = instantiate_backend(be, array_type)
              rng = np.random.RandomState(0)
              dataset = rng.randn(5, 10, 2)
              dataset = cast(dataset, array_type)
              c_dist_dtw = tslearn.metrics.cdist_dtw(dataset, be=be)
              np.testing.assert_allclose(
                  c_dist_dtw,
                  tslearn.metrics.cdist_dtw(dataset, dataset, be=be),
              )
              assert backend.belongs_to_backend(c_dist_dtw)
              c_dist_gak = tslearn.metrics.cdist_gak(dataset, be=be)
              np.testing.assert_allclose(
                  c_dist_gak,
                  tslearn.metrics.cdist_gak(dataset, dataset, be=be),
                  atol=1e-5,
              )
              assert backend.belongs_to_backend(c_dist_gak)
              c_dist_soft_dtw = tslearn.metrics.cdist_soft_dtw(
                  dataset, be=be
              )
              np.testing.assert_allclose(
                  c_dist_soft_dtw,
                  tslearn.metrics.cdist_soft_dtw(
                      dataset, dataset, be=be
                  ),
              )
              assert backend.belongs_to_backend(c_dist_soft_dtw)
              c_dist_soft_dtw_normalized = (
                  tslearn.metrics.cdist_soft_dtw_normalized(
                      dataset, be=be
                  )
              )
              np.testing.assert_allclose(
                  c_dist_soft_dtw_normalized,
                  tslearn.metrics.cdist_soft_dtw_normalized(
                      dataset, dataset, be=be
                  ),
              )
              assert backend.belongs_to_backend(
                  c_dist_soft_dtw_normalized
              )
  
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 13 for calling a global function with example usage: test_symmetric_cdist() without return types