code: def test_min_max_scaler1d(setup):
      X_list_1row = X_1row.to_numpy().tolist()
      X_list_1col = X_1col.to_numpy().tolist()
  
      # Test scaling of dataset along single axis
      for X in [X_1row, X_1col, X_list_1row, X_list_1col]:
          scaler = MinMaxScaler(copy=True)
          X_scaled = scaler.fit(X).transform(X)
  
          if isinstance(X, list):
              X = mt.array(X)  # cast only after scaling done
  
          if _check_dim_1axis(X) == 1:
              assert_array_almost_equal(
                  X_scaled.min(axis=0), mt.zeros(n_features)
              )
              assert_array_almost_equal(
                  X_scaled.max(axis=0), mt.zeros(n_features)
              )
          else:
              assert_array_almost_equal(X_scaled.min(axis=0), 0.0)
              assert_array_almost_equal(X_scaled.max(axis=0), 1.0)
          assert scaler.n_samples_seen_ == X.shape[0]
  
          # check inverse transform
          X_scaled_back = scaler.inverse_transform(X_scaled)
          assert_array_almost_equal(X_scaled_back, X)
  
      # Constant feature
      X = mt.ones((5, 1))
      scaler = MinMaxScaler()
      X_scaled = scaler.fit(X).transform(X)
      assert X_scaled.min().to_numpy() >= 0.0
      assert X_scaled.max().to_numpy() <= 1.0
      assert scaler.n_samples_seen_ == X.shape[0]
  
      # Function interface
      X_1d = X_1row.ravel()
      min_ = X_1d.min()
      max_ = X_1d.max()
      assert_array_almost_equal(
          (X_1d - min_) / (max_ - min_), minmax_scale(X_1d, copy=True)
      )
  
file_path: mars/mars/learn/preprocessing/tests/test_data.py
imports: import pytest
  from sklearn.datasets import load_iris
  from sklearn.utils import gen_batches
  from sklearn.utils._testing import assert_array_almost_equal, assert_allclose
  from ....None import tensor
  from ..None import MinMaxScaler, minmax_scale
label_desc: Use image node_id 7 for calling a global function with example usage: test_min_max_scaler1d(setup) without return types