code: def test_popscore_counts(rng):
      algo = basic.PopScore("count")
      algo.fit(lktu.ml_test.ratings)
  
      counts = lktu.ml_test.ratings.groupby("item").user.count()
  
      scores, counts = algo.item_scores_.align(counts)
      assert all(scores == counts)
  
      items = rng.choice(counts.index, 100)
      scores = algo.predict_for_user(20, items)
      assert all(scores == counts.loc[items])
  
file_path: lkpy/tests/test_popular.py
imports: from lenskit.algorithms import basic
  import pandas
  import numpy
  import pickle
  import lenskit.util.test
label_desc: Use image node_id 7 for calling a global function with example usage: test_popscore_counts(rng) without return types