code: def test_opytimizer_history_setter():
      space = search.SearchSpace(1, 1, 0, 1)
      func = function.Function(callable)
      optimizer = pso.PSO()
      hist = history.History()
  
      new_opytimizer = opytimizer.Opytimizer(space, optimizer, func)
  
      try:
          new_opytimizer.history = 1
      except:
          new_opytimizer.history = hist
  
      assert type(new_opytimizer.history).__name__ == "History"
  
imports: import opytimizer
  from opytimizer.core import function
  from opytimizer.optimizers.swarm import pso
  from opytimizer.spaces import search
  from opytimizer.utils import callback, history
label_desc: Use image node_id 8 for calling a global function with example usage: test_opytimizer_history_setter() without return types