code: def _next_legen_der(n, x, p0, p01, p0d, p0dd):
      """Compute the next Legendre polynomial and its derivatives."""
      # only good for n > 1 !
      old_p0 = p0
      old_p0d = p0d
      p0 = ((2 * n - 1) * x * old_p0 - (n - 1) * p01) / n
      p0d = n * old_p0 + x * old_p0d
      p0dd = (n + 1) * old_p0d + x * p0dd
      return p0, p0d, p0dd
  
file_path: mne-python/mne/forward/_lead_dots.py
imports: import os
  import os.path
  import numpy
  from numpy.polynomial import legendre
  from ..parallel import parallel_func
  from ..utils import _get_extra_data_path, fill_doc, logger, verbose
label_desc: Use image node_id 1 for calling a global function with example usage: _next_legen_der(n, x, p0, p01, p0d, p0dd) and returns: p0,  p0d,  p0dd