code: def test_splits(self):
      try:
          StratifiedSplit(
              self.data,
              fmt="UIRT",
              chrono=True,
              test_size=0.1,
              val_size=0.1,
              verbose=True,
          )
      except ValueError:  # test_data and val_data are empty
          assert True
  
      eval_method = StratifiedSplit(
          self.data,
          fmt="UIRT",
          group_by="user",
          chrono=True,
          test_size=0.2,
          val_size=0.2,
          verbose=True,
      )
      self.assertTrue(isclose(0.2, eval_method.test_size))
      self.assertTrue(isclose(0.2, eval_method.val_size))
  
      eval_method = StratifiedSplit(
          self.data,
          fmt="UIRT",
          group_by="item",
          chrono=True,
          test_size=0.2,
          val_size=0.2,
          verbose=True,
      )
      self.assertTrue(isclose(0.2, eval_method.test_size))
      self.assertTrue(isclose(0.2, eval_method.val_size))
  
      eval_method = StratifiedSplit(
          self.data,
          fmt="UIR",
          group_by="user",
          chrono=False,
          test_size=0.2,
          val_size=0.2,
          verbose=True,
      )
      self.assertTrue(isclose(0.2, eval_method.test_size))
      self.assertTrue(isclose(0.2, eval_method.val_size))
  
      eval_method = StratifiedSplit(
          self.data,
          fmt="UIR",
          group_by="item",
          chrono=False,
          test_size=0.2,
          val_size=0.2,
          verbose=True,
      )
      self.assertTrue(isclose(0.2, eval_method.test_size))
      self.assertTrue(isclose(0.2, eval_method.val_size))
  
file_path: cornac/tests/cornac/eval_methods/test_stratified_split.py
imports: import unittest
  import itertools
  import random
  from math import isclose
  from cornac.eval_methods import StratifiedSplit
  from cornac.data import Reader
  from cornac.models import MF
  from cornac.metrics import MAE, Recall
label_desc: Use image node_id 4 for calling the TestStratifiedSplit obj's underlying member method code with example usage: obj.test_splits() without return types