code: def test_predict_two_users(mlb):
      uids = [5, 10]
      tf = None
      # make sure we get both UIDs
      while tf is None or len(set(tf.user)) < 2:
          tf = (
              mlb.ratings[mlb.ratings.user.isin(uids)]
              .loc[:, ("user", "item")]
              .sample(10)
          )
  
      res = lkb.predict(mlb.algo, tf)
  
      assert len(res) == 10
      assert set(res.user) == set(uids)
  
      preds = res.set_index(["user", "item"])
      preds["rating"] = mlb.algo.mean_
      preds["rating"] += mlb.algo.item_offsets_
      preds["rating"] += mlb.algo.user_offsets_
      assert preds.prediction.values == pytest.approx(
          preds.rating.values
      )
  
file_path: lkpy/tests/test_batch_predict.py
imports: import pytest
  import logging
  from collections import namedtuple
  import pandas
  import numpy
  import lenskit.util.test
  from lenskit.algorithms.bias import Bias
  import lenskit.batch
label_desc: Use image node_id 4 for calling a global function with example usage: test_predict_two_users(mlb) without return types