code: def test_predict(rating_true):
      svd = surprise.SVD()
      train_set = surprise.Dataset.load_from_df(
          rating_true, reader=surprise.Reader()
      ).build_full_trainset()
      svd.fit(train_set)
  
      preds = predict(svd, rating_true)
      assert set(preds.columns) == {"userID", "itemID", "prediction"}
      assert preds["userID"].dtypes == rating_true["userID"].dtypes
      assert preds["itemID"].dtypes == rating_true["itemID"].dtypes
      user = rating_true.iloc[0]["userID"]
      item = rating_true.iloc[0]["itemID"]
      assert preds[
          (preds["userID"] == user) & (preds["itemID"] == item)
      ]["prediction"].values == pytest.approx(
          svd.predict(user, item).est, rel=TOL
      )
  
      preds = predict(
          svd,
          rating_true.rename(
              columns={"userID": "uid", "itemID": "iid"}
          ),
          usercol="uid",
          itemcol="iid",
          predcol="pred",
      )
      assert set(preds.columns) == {"uid", "iid", "pred"}
      assert preds["uid"].dtypes == rating_true["userID"].dtypes
      assert preds["iid"].dtypes == rating_true["itemID"].dtypes
      user = rating_true.iloc[1]["userID"]
      item = rating_true.iloc[1]["itemID"]
      assert preds[(preds["uid"] == user) & (preds["iid"] == item)][
          "pred"
      ].values == pytest.approx(svd.predict(user, item).est, rel=TOL)
  
file_path: recommenders/tests/unit/recommenders/models/test_surprise_utils.py
imports: import pytest
  import pandas
  import surprise
  from recommenders.utils.constants import DEFAULT_USER_COL, DEFAULT_ITEM_COL, DEFAULT_RATING_COL
  from recommenders.models.surprise.surprise_utils import predict, compute_ranking_predictions
label_desc: Use image node_id 2 for calling a global function with example usage: test_predict(rating_true) without return types