code: def test_1dsax():
      unfitted_1dsax = OneD_SymbolicAggregateApproximation(
          n_segments=3, alphabet_size_avg=2, alphabet_size_slope=2
      )
      data = [
          [-1.0, 2.0, 0.1, -1.0, 1.0, -1.0],
          [1.0, 3.2, -1.0, -3.0, 1.0, -1.0],
      ]
      np.testing.assert_raises(
          NotFittedError, unfitted_1dsax.distance, data[0], data[1]
      )
  
      sax1d_est_no_scale = unfitted_1dsax
      sax1d_est_scale = clone(sax1d_est_no_scale)
      sax1d_est_scale.set_params(scale=True)
      n, sz, d = 2, 10, 3
      rng = np.random.RandomState(0)
      X = rng.randn(n, sz, d)
      for sax1d_est in [sax1d_est_no_scale, sax1d_est_scale]:
          sax1d = sax1d_est.fit_transform(X)
          np.testing.assert_allclose(
              sax1d_est.distance(X[0], X[1]),
              sax1d_est.distance_1d_sax(sax1d[0], sax1d[1]),
          )
  
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 3 for calling a global function with example usage: test_1dsax() without return types