class_docstr: A History class is responsible for saving each iteration's output.
  
  Note that you can use dump() and parse() for whatever your needs. Our default
  is only for agents, best agent and best agent's index.
docstr: Dumps keyword pairs into self-class attributes.
docstr_tok: ["Dumps","keyword","pairs","into","self-class","attributes","."]
code: def dump(self, **kwargs) -> None:
      """Dumps keyword pairs into self-class attributes."""
  
      for key, value in kwargs.items():
          # If current `key` is `agents` and they should not be saved,
          # we skip this loop iteration
          if key == "agents" and not self.save_agents:
              continue
  
          # If current `key` has a specific parsing rule,
          # we need to parse it accordingly
          if key in ["agents", "best_agent", "local_position"]:
              output = self._parse(key, value)
          else:
              output = value
  
          # If class still does not have a `key` property,
          # we need to set its initial value as a list
          if not hasattr(self, key):
              setattr(self, key, [output])
          else:
              getattr(self, key).append(output)
  
file_path: opytimizer/opytimizer/utils/history.py
imports: from typing import Any, List, Optional, Tuple, Union
  import numpy
  import opytimizer.utils.exception
label_desc: Use image node_id 5 for calling the History obj's underlying member method code with example usage: obj.dump() without return types