code: def test_random_splitter(spark_dataset):
      """Test random splitter for Spark dataframes.
  
      NOTE: some split results may not match exactly with the ratios, which may
      be owing to the limited number of rows in the testing data. A approximate
      match with certain level of tolerance is therefore used instead for tests.
      """
  
      splits = spark_random_split(
          spark_dataset, ratio=RATIOS[0], seed=SEED
      )
  
      assert splits[0].count() / NUM_ROWS == pytest.approx(
          RATIOS[0], abs=TOL
      )
      assert splits[1].count() / NUM_ROWS == pytest.approx(
          1 - RATIOS[0], abs=TOL
      )
  
      splits = spark_random_split(
          spark_dataset, ratio=RATIOS, seed=SEED
      )
  
      assert splits[0].count() / NUM_ROWS == pytest.approx(
          RATIOS[0], abs=TOL
      )
      assert splits[1].count() / NUM_ROWS == pytest.approx(
          RATIOS[1], abs=TOL
      )
      assert splits[2].count() / NUM_ROWS == pytest.approx(
          RATIOS[2], abs=TOL
      )
  
file_path: recommenders/tests/unit/recommenders/datasets/test_spark_splitter.py
imports: import pytest
  import numpy
  import pandas
  from recommenders.utils.constants import DEFAULT_USER_COL, DEFAULT_ITEM_COL, DEFAULT_RATING_COL, DEFAULT_TIMESTAMP_COL
label_desc: Use image node_id 4 for calling a global function with example usage: test_random_splitter(spark_dataset) without return types