code: def test_triangular_basis_grid():
      grid_rad = 3
      n_channels = (grid_rad * 2 + 1) * (grid_rad * 2)
      bds = [-1, 1]
      s = InvertedEncoding2D(
          stim_xlim=bds, stim_ylim=bds, stimulus_resolution=10
      )
      _, centers = s.define_basis_functions_trigrid(grid_rad)
      assert centers.shape[0] == n_channels
      xspacing = np.round(np.diff(centers[:, 0]), 4)
      assert (
          xspacing[0]
          == xspacing[np.random.randint(n_channels)]
          == xspacing[-1]
      )
      ysp = xspacing[0] * np.sqrt(3) * 0.5
      yspacing = np.diff(centers[:, 1])
      yspace = yspacing[yspacing > 0.0]
      assert np.all((ysp - yspace) < 1e-5)
  
imports: import pytest
  import numpy
  import logging
  from brainiak.reconstruct.iem import InvertedEncoding1D, InvertedEncoding2D
  from brainiak.utils.fmrisim import generate_1d_gaussian_rfs, generate_1d_rf_responses
  from scipy.stats import circmean
label_desc: Use image node_id 13 for calling a global function with example usage: test_triangular_basis_grid() without return types