code: def test_user_frequencies(header):
      model = SAR(**header)
      train = pd.DataFrame(
          {
              header["col_user"]: [1, 1, 2, 2, 3, 3, 3, 3, 4, 4],
              header["col_item"]: [1, 2, 1, 3, 3, 4, 5, 6, 1, 2],
              header["col_rating"]: [
                  3.0,
                  4.0,
                  5.0,
                  4.0,
                  3.0,
                  2.0,
                  1.0,
                  5.0,
                  1.0,
                  1.0,
              ],
          }
      )
      model.fit(train)
      # run this method once so that user frequencies are calculated
      model.get_popularity_based_topk(items=False)
      assert model.user_frequencies[0] == 2
  
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 15 for calling a global function with example usage: test_user_frequencies(header) without return types