code: def test_sax_scale():
      n, sz, d = 10, 10, 3
      rng = np.random.RandomState(0)
      X = rng.rand(n, sz, d)
      y = rng.choice([0, 1], size=n)
  
      sax = SymbolicAggregateApproximation(
          n_segments=3, alphabet_size_avg=2, scale=True
      )
      sax.fit(X)
      np.testing.assert_array_almost_equal(
          X, sax._unscale(sax._scale(X))
      )
  
      np.testing.assert_array_almost_equal(
          np.zeros((d,)), sax._scale(X).reshape((-1, d)).mean()
      )
      np.testing.assert_array_almost_equal(
          np.ones((d,)), sax._scale(X).reshape((-1, d)).std()
      )
  
      # Case of kNN-SAX
      knn_sax = KNeighborsTimeSeriesClassifier(
          n_neighbors=1, metric="sax", metric_params={"scale": True}
      )
      knn_sax.fit(X, y)
      X_scale_unscale = knn_sax._sax._unscale(knn_sax._sax._scale(X))
      np.testing.assert_array_almost_equal(X, X_scale_unscale)
  
      knn_sax.predict(X)
  
file_path: tslearn/tslearn/tests/test_piecewise.py
imports: import numpy
  from tslearn.piecewise import OneD_SymbolicAggregateApproximation, SymbolicAggregateApproximation, PiecewiseAggregateApproximation
  from tslearn.neighbors import KNeighborsTimeSeriesClassifier
  from sklearn.exceptions import NotFittedError
  from sklearn.base import clone
label_desc: Use image node_id 4 for calling a global function with example usage: test_sax_scale() without return types