code: def test_pvalues_and_critvals(spa_data):
      spa = SPA(
          spa_data.benchmark, spa_data.models, reps=100, seed=23456
      )
      spa.compute()
      simulated_vals = spa._simulated_vals
      max_stats = np.max(simulated_vals, 0)
      max_loss_diff = np.max(spa._loss_diff.mean(0), 0)
      pvalues = np.mean(max_loss_diff <= max_stats, 0)
      pvalues = pd.Series(
          pvalues, index=["lower", "consistent", "upper"]
      )
      assert_series_equal(pvalues, spa.pvalues)
  
      crit_vals = np.percentile(max_stats, 90.0, axis=0)
      crit_vals = pd.Series(
          crit_vals, index=["lower", "consistent", "upper"]
      )
      assert_series_equal(spa.critical_values(0.10), crit_vals)
  
imports: from typing import NamedTuple
  import numpy
  from numpy import linspace
  from numpy.random import RandomState
  from numpy.testing import assert_allclose, assert_equal
  import pandas
  from pandas.testing import assert_frame_equal, assert_series_equal
  import pytest
  import scipy.stats
  from arch.bootstrap import CircularBlockBootstrap, MovingBlockBootstrap, StationaryBootstrap
  from arch.bootstrap.multiple_comparison import MCS, SPA, StepM
label_desc: Use image node_id 4 for calling a global function with example usage: test_pvalues_and_critvals(spa_data) without return types