code: def test_if_variables_are_initialized_correctly(self):
      stratifier = IterativeStratification(n_splits=2, order=1)
      y = np.matrix([[0, 0], [1, 0], [0, 1], [1, 1]])
  
      (
          rows,
          rows_used,
          all_combinations,
          per_row_combinations,
          samples_with_combination,
          folds,
      ) = stratifier._prepare_stratification(y)
  
      self.assertEqual(stratifier.n_samples, 4)
      self.assertEqual(stratifier.n_labels, 2)
      self.assertEqual(len(rows), 4)
      self.assertEqual(len(rows_used), 4)
      self.assertEqual(len(stratifier.percentage_per_fold), 2)
      self.assertEqual(len(stratifier.desired_samples_per_fold), 2)
      self.assertEqual(len(folds), 2)
      self.assertTrue(not any(rows_used.values()))
      self.assertFalse(any(rows_used.values()))
      self.assertEqual(stratifier.order, 1)
  
      for d in stratifier.percentage_per_fold:
          self.assertEqual(d, 1 / 2.0)
  
      for d in stratifier.desired_samples_per_fold:
          self.assertEqual(d, y.shape[0] / 2.0)
  
      self.assertEqual(len(all_combinations), 2)
      self.assertEqual(len(per_row_combinations[0]), 0)
      self.assertEqual(len(per_row_combinations[1]), 1)
      self.assertEqual(len(per_row_combinations[2]), 1)
      self.assertEqual(len(per_row_combinations[3]), 2)
  
      self.assertEqual(len(samples_with_combination), 2)
      self.assertEqual(
          len(stratifier.desired_samples_per_combination_per_fold), 2
      )
      for combination, samples in samples_with_combination.items():
          self.assertEqual(len(set(combination)), 1)
          self.assertEqual(len(samples), 2)
  
      for (
          combination,
          desirability,
      ) in stratifier.desired_samples_per_combination_per_fold.items():
          self.assertEqual(len(set(combination)), 1)
          self.assertEqual(len(desirability), 2)
          for desire in desirability:
              self.assertEqual(desire, 1.0)
  
file_path: scikit-multilearn/skmultilearn/model_selection/tests/test_iterative_stratification.py
imports: import unittest
  import numpy
  from skmultilearn.model_selection import IterativeStratification
label_desc: Use image node_id 1 for calling the IterativeStratificationTest obj's underlying member method code with example usage: obj.test_if_variables_are_initialized_correctly() without return types