code: def test_stratified_splitter(test_specs, python_dataset):
      splits = python_stratified_split(
          python_dataset,
          ratio=test_specs["ratio"],
          min_rating=10,
          filter_by="user",
      )
  
      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)
  
      # Test if both contains the same user list. This is because stratified split is stratified.
      users_train = splits[0][DEFAULT_USER_COL].unique()
      users_test = splits[1][DEFAULT_USER_COL].unique()
  
      assert set(users_train) == set(users_test)
  
      splits = python_stratified_split(
          python_dataset,
          ratio=test_specs["ratios"],
          min_rating=10,
          filter_by="user",
      )
  
      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)
  
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 9 for calling a global function with example usage: test_stratified_splitter(test_specs, python_dataset) without return types