code: def test_random_splitter(test_specs, python_dataset):
      """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 = python_random_split(
          python_dataset,
          ratio=test_specs["ratio"],
          seed=test_specs["seed"],
      )
      assert len(splits[0]) / test_specs[
          "number_of_rows"
      ] == pytest.approx(test_specs["ratio"], test_specs["tolerance"])
      assert len(splits[1]) / test_specs[
          "number_of_rows"
      ] == pytest.approx(
          1 - test_specs["ratio"], test_specs["tolerance"]
      )
  
      for split in splits:
          assert set(split.columns) == set(python_dataset.columns)
  
      splits = python_random_split(
          python_dataset,
          ratio=test_specs["ratios"],
          seed=test_specs["seed"],
      )
  
      assert len(splits) == 3
      assert len(splits[0]) / test_specs[
          "number_of_rows"
      ] == pytest.approx(
          test_specs["ratios"][0], test_specs["tolerance"]
      )
      assert len(splits[1]) / test_specs[
          "number_of_rows"
      ] == pytest.approx(
          test_specs["ratios"][1], test_specs["tolerance"]
      )
      assert len(splits[2]) / test_specs[
          "number_of_rows"
      ] == pytest.approx(
          test_specs["ratios"][2], test_specs["tolerance"]
      )
  
      for split in splits:
          assert set(split.columns) == set(python_dataset.columns)
  
      splits = python_random_split(
          python_dataset,
          ratio=test_specs["split_numbers"],
          seed=test_specs["seed"],
      )
  
      assert len(splits) == 3
      assert len(splits[0]) / test_specs[
          "number_of_rows"
      ] == pytest.approx(
          test_specs["ratios"][0], test_specs["tolerance"]
      )
      assert len(splits[1]) / test_specs[
          "number_of_rows"
      ] == pytest.approx(
          test_specs["ratios"][1], test_specs["tolerance"]
      )
      assert len(splits[2]) / test_specs[
          "number_of_rows"
      ] == pytest.approx(
          test_specs["ratios"][2], test_specs["tolerance"]
      )
  
      for split in splits:
          assert set(split.columns) == set(python_dataset.columns)
  
      # check values sum to 1
      splits = python_random_split(
          python_dataset, ratio=[0.7, 0.2, 0.1], seed=test_specs["seed"]
      )
  
      assert (len(splits)) == 3
  
file_path: recommenders/tests/unit/recommenders/datasets/test_python_splitter.py
imports: import pytest
  import pandas
  import numpy
  from recommenders.utils.constants import DEFAULT_USER_COL, DEFAULT_ITEM_COL, DEFAULT_RATING_COL, DEFAULT_TIMESTAMP_COL
  from recommenders.datasets.split_utils import min_rating_filter_pandas, split_pandas_data_with_ratios
  from recommenders.datasets.python_splitters import python_chrono_split, python_random_split, python_stratified_split, numpy_stratified_split
label_desc: Use image node_id 7 for calling a global function with example usage: test_random_splitter(test_specs, python_dataset) without return types