code: def check_sample_mean(sm, v, n, popmean):
      # from stats.stats.ttest_1samp(a, popmean):
      # Calculates the t-obtained for the independent samples T-test on ONE group
      # of scores a, given a population mean.
      #
      # Returns: t-value, two-tailed prob
      df = n - 1
      svar = ((n - 1) * v) / float(df)  # looks redundant
      t = (sm - popmean) / np.sqrt(svar * (1.0 / n))
      prob = betainc(0.5 * df, 0.5, df / (df + t * t))
  
      # return t,prob
      npt.assert_(
          prob > 0.01,
          "mean fail, t,prob = %f, %f, m, sm=%f,%f"
          % (t, prob, popmean, sm),
      )
  
imports: import numpy
  import numpy.testing
  import pytest
  from pytest import raises
  from scipy.integrate import IntegrationWarning
  from scipy import stats
  from scipy.special import betainc
  from .common_tests import check_normalization, check_moment, check_mean_expect, check_var_expect, check_skew_expect, check_kurt_expect, check_entropy, check_private_entropy, check_entropy_vect_scale, check_edge_support, check_named_args, check_random_state_property, check_meth_dtype, check_ppf_dtype, check_cmplx_deriv, check_pickling, check_rvs_broadcast, check_freezing
  from scipy.stats._distr_params import distcont
label_desc: Use image node_id 16 for calling a global function with example usage: check_sample_mean(sm, v, n, popmean) without return types