docstr: Populate all history lists
  
  The :code:`cost_history`, :code:`mean_pbest_history`, and
  :code:`neighborhood_best` is expected to have a shape of
  :code:`(iters,)`,on the other hand, the :code:`pos_history`
  and :code:`velocity_history` are expected to have a shape of
  :code:`(iters, n_particles, dimensions)`
  
  Parameters
  ----------
  hist : collections.namedtuple
      Must be of the same type as self.ToHistory
code: def _populate_history(self, hist):
      """Populate all history lists
  
      The :code:`cost_history`, :code:`mean_pbest_history`, and
      :code:`neighborhood_best` is expected to have a shape of
      :code:`(iters,)`,on the other hand, the :code:`pos_history`
      and :code:`velocity_history` are expected to have a shape of
      :code:`(iters, n_particles, dimensions)`
  
      Parameters
      ----------
      hist : collections.namedtuple
          Must be of the same type as self.ToHistory
      """
      self.cost_history.append(hist.best_cost)
      self.mean_pbest_history.append(hist.mean_pbest_cost)
      self.mean_neighbor_history.append(hist.mean_neighbor_cost)
      self.pos_history.append(hist.position)
      self.velocity_history.append(hist.velocity)
  
file_path: pyswarms/pyswarms/base/base_discrete.py
imports: import abc
  from collections import namedtuple
  import numpy
  from ..backend import create_swarm
label_desc: Use image node_id 2 for calling the DiscreteSwarmOptimizer obj's underlying member method code with example usage: obj._populate_history(hist) without return types