code: def test_rescale():
      x = pd.Series(range(10), dtype="float")
      res = x.rescale()
  
      assert res.iloc[0] == 0
      assert res.iloc[4] == (4.0 - 0.0) / (9.0 - 0.0)
      assert res.iloc[-1] == 1
  
      assert x.iloc[0] == 0
      assert x.iloc[4] == 4
      assert x.iloc[-1] == 9
  
      x = pd.DataFrame(
          {
              "a": pd.Series(range(10), dtype="float"),
              "b": pd.Series(range(10), dtype="float"),
          }
      )
      res = x.rescale(axis=0)
  
      assert res["a"].iloc[0] == 0
      assert res["a"].iloc[4] == (4.0 - 0.0) / (9.0 - 0.0)
      assert res["a"].iloc[-1] == 1
      assert res["b"].iloc[0] == 0
      assert res["b"].iloc[4] == (4.0 - 0.0) / (9.0 - 0.0)
      assert res["b"].iloc[-1] == 1
  
      assert x["a"].iloc[0] == 0
      assert x["a"].iloc[4] == 4
      assert x["a"].iloc[-1] == 9
      assert x["b"].iloc[0] == 0
      assert x["b"].iloc[4] == 4
      assert x["b"].iloc[-1] == 9
  
imports: import ffn
  import pandas
  import numpy
  from pytest import fixture
  from numpy.testing import assert_almost_equal
label_desc: Use image node_id 32 for calling a global function with example usage: test_rescale() without return types