code: def test_legendre_table():
      """Test Legendre table calculation."""
      # double-check our table generation
      n = 10
      for ch_type in ["eeg", "meg"]:
          lut1, n_fact1 = _get_legen_table(
              ch_type, n_coeff=25, force_calc=True
          )
          lut1 = lut1[:, : n - 1].copy()
          n_fact1 = n_fact1[: n - 1].copy()
          lut2, n_fact2 = _get_legen_table(
              ch_type, n_coeff=n, force_calc=True
          )
          assert_allclose(lut1, lut2)
          assert_allclose(n_fact1, n_fact2)
  
imports: from os import path
  from pathlib import Path
  import numpy
  import pytest
  from numpy.polynomial import legendre
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal
  from scipy.interpolate import interp1d
  import mne
  from mne import Epochs, make_fixed_length_events, pick_types, read_evokeds
  from mne.datasets import testing
  from mne.forward import _make_surface_mapping, make_field_map
  from mne.forward._field_interpolation import _setup_dots
  from mne.forward._lead_dots import _comp_sum_eeg, _comp_sums_meg, _do_cross_dots, _get_legen_table
  from mne.forward._make_forward import _create_meg_coils
  from mne.io import read_raw_fif
  from mne.surface import get_head_surf, get_meg_helmet_surf
label_desc: Use image node_id 3 for calling a global function with example usage: test_legendre_table() without return types