code: def test_rescale(scores):
      expected = np.array(
          [
              [0, 0.25, 0.5, 0.75, 1],
              [1, 0.75, 0.5, 0.25, 0],
              [0, 1, 0.5, 0.75, 0.25],
          ]
      )
      assert np.allclose(expected, rescale(scores, 0, 1))
  
      expected = np.array(
          [[3, 5, 7, 9, 11.0], [11, 9, 7, 5, 3], [3, 11, 7, 9, 5]]
      )
      assert np.allclose(expected, rescale(scores, 1, 11, 0, 5))
  
      expected = np.array(
          [
              [0, 0.2, 0.4, 0.6, 0.8],
              [0.625, 0.5, 0.375, 0.25, 0.125],
              [0, 1, 0.5, 0.75, 0.25],
          ]
      )
      data_min = np.tile(
          np.array([1, 0, 1])[:, np.newaxis], scores.shape[1]
      )
      data_max = np.tile(
          np.array([6, 8, 5])[:, np.newaxis], scores.shape[1]
      )
      assert np.allclose(
          expected, rescale(scores, 0, 1, data_min, data_max)
      )
  
file_path: recommenders/tests/unit/recommenders/utils/test_python_utils.py
imports: import pytest
  import numpy
  from recommenders.utils.python_utils import exponential_decay, jaccard, lift, get_top_k_scored_items, binarize, rescale
label_desc: Use image node_id 10 for calling a global function with example usage: test_rescale(scores) without return types