code: def test_tree_space_n_terminals_setter():
      try:
          new_tree_space = tree.TreeSpace(1, 1, 0, 1, n_terminals=0.0)
      except:
          new_tree_space = tree.TreeSpace(1, 1, 0, 1, n_terminals=1)
  
      try:
          new_tree_space = tree.TreeSpace(1, 1, 0, 1, n_terminals=0)
      except:
          new_tree_space = tree.TreeSpace(1, 1, 0, 1, n_terminals=1)
  
      assert new_tree_space.n_terminals == 1
  
imports: from opytimizer.core import node
  from opytimizer.spaces import tree
label_desc: Use image node_id 2 for calling a global function with example usage: test_tree_space_n_terminals_setter() without return types