code: def test_standard_scaler_one_many_consistent():
      """Checks that using learn_one or learn_many produces the same result."""
  
      for with_std in (False, True):
          X = pd.read_csv(datasets.TrumpApproval().path)
  
          one = preprocessing.StandardScaler(with_std=with_std)
          for x, _ in stream.iter_pandas(X):
              one.learn_one(x)
  
          many = preprocessing.StandardScaler(with_std=with_std)
          for xb in np.array_split(X, 10):
              many.learn_many(xb)
  
          for i in X:
              assert math.isclose(one.counts[i], many.counts[i])
              assert math.isclose(one.means[i], many.means[i])
              assert math.isclose(one.vars[i], many.vars[i])
  
file_path: river/river/preprocessing/test_scale.py
imports: from __future__ import annotations
  import math
  import numpy
  import pandas
  from river import datasets, preprocessing, stream
label_desc: Use image node_id 1 for calling a global function with example usage: test_standard_scaler_one_many_consistent() without return types