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: Parses incoming values with specified formats.
  
  Args:
      key: Key.
      value: Value.
  
  Returns:
      (Union[List[Any], Tuple[List[Any], float]]): Parsed value according to the specified format.
docstr_tok: ["Parses","incoming","values","with","specified","formats",".","Args",":","key",":","Key",".","value",":","Value",".","Returns",":","(","Union","[","List","[","Any","]",",","Tuple","[","List","[","Any","]",",","float","]","]",")",":","Parsed","value","according","to","the","specified","format","."]
code: def _parse(
      self, key: str, value: Any
  ) -> Union[List[Any], Tuple[List[Any], float]]:
      """Parses incoming values with specified formats.
  
      Args:
          key: Key.
          value: Value.
  
      Returns:
          (Union[List[Any], Tuple[List[Any], float]]): Parsed value according to the specified format.
  
      """
  
      if key == "agents":
          # Returns a list of tuples (position, fit)
          return [(v.position.tolist(), v.fit) for v in value]
  
      if key == "best_agent":
          # Returns a tuple (position, fit)
          return (value.position.tolist(), value.fit)
  
      if key == "local_position":
          # Returns a list of local positions
          return [v.tolist() for v in value]
  
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 4 for calling the History obj's underlying member method code with example usage: obj._parse(key, value) and returns: unknown, value,  value, unknown