code: def test_learn_many_with_learn_during_predict():
      pipeline = compose.Pipeline(
          ("scale", preprocessing.StandardScaler()),
          ("log_reg", linear_model.LogisticRegression()),
      )
  
      dataset = [(dict(a=x, b=x), x) for x in range(100)]
  
      for i in range(0, len(dataset), 5):
          X = pd.DataFrame([x for x, _ in dataset][i : i + 5])
          y = pd.Series([bool(y % 2) for _, y in dataset][i : i + 5])
  
          counts_pre = dict(pipeline["scale"].counts)
          with compose.learn_during_predict():
              pipeline.learn_many(X, y)
          counts_no_learn = dict(pipeline["scale"].counts)
          pipeline.learn_many(X, y)
          counts_post = dict(pipeline["scale"].counts)
  
          assert counts_pre != counts_post
          assert counts_pre == counts_no_learn
  
file_path: river/river/compose/test_.py
imports: from __future__ import annotations
  import pandas
  from river import compose, linear_model, preprocessing
label_desc: Use image node_id 5 for calling a global function with example usage: test_learn_many_with_learn_during_predict() without return types