code: def get_arrows(theta_history, perturbation_interval):
      theta_history = theta_history[1:, :]
      arrow_start = theta_history[
          np.arange(
              perturbation_interval - 1,
              len(theta_history),
              perturbation_interval,
          )
      ]
      arrow_end = theta_history[
          np.arange(
              perturbation_interval,
              len(theta_history),
              perturbation_interval,
          )
      ]
      if len(arrow_end) > len(arrow_start):
          arrow_end = arrow_end[: len(arrow_start)]
      else:
          arrow_start = arrow_start[: len(arrow_end)]
      deltas = arrow_end - arrow_start
      return arrow_start, deltas
  
file_path: ray/doc/source/tune/examples/pbt_visualization/pbt_visualization_utils.py
imports: import matplotlib.pyplot
  from matplotlib.animation import FuncAnimation, PillowWriter
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: get_arrows(theta_history, perturbation_interval) and returns: arrow_start,  deltas