code: def test_e2e(spark, pandas_dummy_dataset, header):
      sar = SARPlus(spark, **header, cache_path="tests/test_e2e_cache")
  
      df = spark.createDataFrame(pandas_dummy_dataset)
      sar.fit(df)
  
      test_df = spark.createDataFrame(
          pd.DataFrame(
              {header["col_user"]: [3], header["col_item"]: [2]}
          )
      )
  
      r1 = (
          sar.recommend_k_items(test_df, top_k=3, remove_seen=False)
          .toPandas()
          .sort_values([header["col_user"], header["col_item"]])
          .reset_index(drop=True)
      )
  
      r2 = (
          sar.recommend_k_items(
              test_df,
              top_k=3,
              n_user_prediction_partitions=2,
              remove_seen=False,
              use_cache=True,
          )
          .toPandas()
          .sort_values([header["col_user"], header["col_item"]])
          .reset_index(drop=True)
      )
  
      assert (r1.iloc[:, :2] == r2.iloc[:, :2]).all().all()
      assert np.allclose(r1.score.values, r2.score.values, 1e-3)
  
imports: import math
  from pathlib import Path
  import numpy
  import pandas
  from pyspark.sql import SparkSession
  import pytest
  from pandas.testing import assert_frame_equal
  from pysarplus import SARPlus, SARModel
label_desc: Use image node_id 10 for calling a global function with example usage: test_e2e(spark, pandas_dummy_dataset, header) without return types