code: def test_fit_twice(mocked_warn):
      """Tests that a warning msg should be printed."""
      col_a = [-1, 0, 1]
      col_b = [1, 3, 5]
      col_c = [1, 1, None]
      in_df = pd.DataFrame.from_dict(
          {"A": col_a, "B": col_b, "C": col_c}
      )
      ds = ray.data.from_pandas(in_df)
  
      scaler = MinMaxScaler(["B", "C"])
  
      # Fit data.
      scaler.fit(ds)
      assert scaler.stats_ == {
          "min(B)": 1,
          "max(B)": 5,
          "min(C)": 1,
          "max(C)": 1,
      }
  
      ds = ds.map_batches(lambda x: {k: v * 2 for k, v in x.items()})
      # Fit again
      scaler.fit(ds)
      # Assert that the fitted state is corresponding to the second ds.
      assert scaler.stats_ == {
          "min(B)": 2,
          "max(B)": 10,
          "min(C)": 2,
          "max(C)": 2,
      }
      msg = (
          "`fit` has already been called on the preprocessor (or at least one "
          "contained preprocessors if this is a chain). "
          "All previously fitted state will be overwritten!"
      )
      mocked_warn.assert_called_once_with(msg)
  
imports: import re
  import warnings
  from typing import Dict, Union
  from unittest.mock import patch
  import numpy
  import pandas
  import pyarrow
  import pytest
  import ray
  from ray.air.constants import MAX_REPR_LENGTH
  from ray.air.util.data_batch_conversion import BatchFormat
  from ray.data.preprocessor import Preprocessor
  from ray.data.preprocessors import BatchMapper, Categorizer, Chain, Concatenator, CountVectorizer, FeatureHasher, HashingVectorizer, LabelEncoder, MaxAbsScaler, MinMaxScaler, MultiHotEncoder, Normalizer, OneHotEncoder, OrdinalEncoder, PowerTransformer, RobustScaler, SimpleImputer, StandardScaler, Tokenizer
label_desc: Use image node_id 5 for calling a global function with example usage: test_fit_twice(mocked_warn) without return types