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: Gets the convergence list of a specified key.
  
  Args:
      key: Key to be retrieved.
      index: Index to be retrieved.
  
  Returns:
      (np.ndarray): Values based on key and index.
docstr_tok: ["Gets","the","convergence","list","of","a","specified","key",".","Args",":","key",":","Key","to","be","retrieved",".","index",":","Index","to","be","retrieved",".","Returns",":","(","np.ndarray",")",":","Values","based","on","key","and","index","."]
code: def get_convergence(
      self, key: str, index: Optional[Tuple[int, ...]] = 0
  ) -> np.ndarray:
      """Gets the convergence list of a specified key.
  
      Args:
          key: Key to be retrieved.
          index: Index to be retrieved.
  
      Returns:
          (np.ndarray): Values based on key and index.
  
      """
  
      attr = np.asarray(getattr(self, key), dtype=list)
  
      if key in ["agents"]:
          attr_pos = np.hstack(attr[(slice(None), index, 0)])
          attr_fit = np.hstack(attr[(slice(None), index, 1)])
  
          return attr_pos, attr_fit
  
      if key in ["best_agent"]:
          attr_pos = np.hstack(attr[(slice(None), 0)])
          attr_fit = np.hstack(attr[(slice(None), 1)])
  
          return attr_pos, attr_fit
  
      if key in ["local_position"]:
          attr_pos = np.hstack(attr[(slice(None), index)])
  
          return attr_pos
  
      attr = np.hstack(attr[(slice(None))])
  
      return attr
  
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 6 for calling the History obj's underlying member method code with example usage: obj.get_convergence(key, index) and returns: attr, attr_pos,  attr_fit, attr_pos,  attr_fit, attr_pos