code: def test_altprotocol():
      block, bT, bF = protocol(
          descriptions["block"], "block", *delay.spectral
      )
      event, eT, eF = protocol(
          descriptions["event"], "event", *delay.spectral
      )
  
      blocka, baT, baF = altprotocol(
          altdescr["block"], "block", *delay.spectral
      )
      eventa, eaT, eaF = altprotocol(
          altdescr["event"], "event", *delay.spectral
      )
  
      for c in bT:
          baf = baT[c]
          if not isinstance(baf, formulae.Formula):
              baf = formulae.Formula([baf])
  
          bf = bT[c]
          if not isinstance(bf, formulae.Formula):
              bf = formulae.Formula([bf])
  
      X = baf.design(t, return_float=True)
      Y = bf.design(t, return_float=True)
      if X.ndim == 1:
          X.shape = (X.shape[0], 1)
      m = OLSModel(X)
      r = m.fit(Y)
      remaining = (r.resid**2).sum() / (Y**2).sum()
      assert_almost_equal(remaining, 0)
  
      for c in bF:
          baf = baF[c]
          if not isinstance(baf, formulae.Formula):
              baf = formulae.Formula([baf])
  
          bf = bF[c]
          if not isinstance(bf, formulae.Formula):
              bf = formulae.Formula([bf])
  
      X = baf.design(t, return_float=True)
      Y = bf.design(t, return_float=True)
      if X.ndim == 1:
          X.shape = (X.shape[0], 1)
      m = OLSModel(X)
      r = m.fit(Y)
      remaining = (r.resid**2).sum() / (Y**2).sum()
      assert_almost_equal(remaining, 0)
  
file_path: nipy/nipy/modalities/fmri/fmristat/tests/test_FIAC.py
imports: import numpy
  from nipy.algorithms.statistics.formula import formulae
  from nipy.algorithms.statistics.models.regression import OLSModel
  from nipy.testing import assert_almost_equal
  from ...None import design, hrf, utils
  from ..None import hrf
  from .FIACdesigns import N_ROWS, altdescr, descriptions, fmristat, time_vector
label_desc: Use image node_id 5 for calling a global function with example usage: test_altprotocol() without return types