code: def test_get_normalized_scores(header):
      train = pd.DataFrame(
          {
              header["col_user"]: [1, 1, 1, 1, 2, 2, 2, 2],
              header["col_item"]: [1, 2, 3, 4, 1, 5, 6, 7],
              header["col_rating"]: [
                  3.0,
                  4.0,
                  5.0,
                  4.0,
                  3.0,
                  2.0,
                  1.0,
                  5.0,
              ],
              header["col_timestamp"]: [
                  1,
                  20,
                  30,
                  400,
                  50,
                  60,
                  70,
                  800,
              ],
          }
      )
      test = pd.DataFrame(
          {
              header["col_user"]: [1, 1, 1, 2, 2, 2],
              header["col_item"]: [5, 6, 7, 2, 3, 4],
              header["col_rating"]: [2.0, 1.0, 5.0, 3.0, 4.0, 5.0],
          }
      )
  
      model = SAR(**header, timedecay_formula=True, normalize=True)
      model.fit(train)
      actual = model.score(test, remove_seen=True)
      expected = np.array(
          [
              [
                  -np.inf,
                  -np.inf,
                  -np.inf,
                  -np.inf,
                  1.23512374,
                  1.23512374,
                  1.23512374,
              ],
              [
                  -np.inf,
                  1.23512374,
                  1.23512374,
                  1.23512374,
                  -np.inf,
                  -np.inf,
                  -np.inf,
              ],
          ]
      )
      assert actual.shape == (2, 7)
      assert isinstance(actual, np.ndarray)
      assert np.isclose(expected, np.asarray(actual)).all()
  
      actual = model.score(test)
      expected = np.array(
          [
              [
                  3.11754872,
                  4.29408577,
                  4.29408577,
                  4.29408577,
                  1.23512374,
                  1.23512374,
                  1.23512374,
              ],
              [
                  2.5293308,
                  1.23511758,
                  1.23511758,
                  1.23511758,
                  3.11767458,
                  3.11767458,
                  3.11767458,
              ],
          ]
      )
  
      assert actual.shape == (2, 7)
      assert isinstance(actual, np.ndarray)
      assert np.isclose(expected, np.asarray(actual)).all()
  
imports: import json
  import pytest
  import itertools
  import numpy
  import pandas
  from pandas.testing import assert_frame_equal
  from recommenders.utils.constants import DEFAULT_PREDICTION_COL
  from recommenders.models.sar import SAR
label_desc: Use image node_id 10 for calling a global function with example usage: test_get_normalized_scores(header) without return types