code: def _analytical_solution(a, y0, t):
      """
      Analytical solution to the linear differential equations dy/dt = a*y.
  
      The solution is only valid if `a` is diagonalizable.
  
      Returns a 2-D array with shape (len(t), len(y0)).
      """
      lam, v = np.linalg.eig(a)
      c = np.linalg.solve(v, y0)
      e = c * np.exp(lam * t.reshape(-1, 1))
      sol = e.dot(v.T)
      return sol
  
file_path: scipy/scipy/integrate/tests/test_banded_ode_solvers.py
imports: import itertools
  import numpy
  from numpy.testing import assert_allclose
  from scipy.integrate import ode
label_desc: Use image node_id 6 for calling a global function with example usage: _analytical_solution(a, y0, t) and returns: sol