code: def test_memorized_batch_keep_index():
      algo = basic.Memorized(simple_df)
  
      query = pd.DataFrame(
          {"user": [10, 10, 12], "item": [1, 2, 1]},
          index=np.random.choice(np.arange(10), 3, False),
      )
      preds = algo.predict(query)
      assert all(preds.index == query.index)
      assert all(preds == [4.0, 5.0, 3.0])
  
file_path: lkpy/tests/test_util_algos.py
imports: from lenskit.algorithms import basic
  import pandas
  import numpy
  import lenskit.util.test
label_desc: Use image node_id 5 for calling a global function with example usage: test_memorized_batch_keep_index() without return types