code: def test_space_has_desired_legth(self):
      for space_fn in [linspace, cosinespace]:
          space = list(space_fn(2, 1, 3))
          assert len(space) == 3
          with self.assertRaises(IndexError):
              space[4]
  
imports: import unittest
  from poutyne import OptimizerPolicy, Phase, cosinespace, linspace, one_cycle_phases, sgdr_phases
label_desc: Use image node_id 10 for calling the TestSpaces obj's underlying member method code with example usage: obj.test_space_has_desired_legth() without return types