code: def check_mean_expect(distfn, arg, m, msg):
      if np.isfinite(m):
          m1 = distfn.expect(lambda x: x, arg)
          npt.assert_almost_equal(
              m1, m, decimal=5, err_msg=msg + " - 1st moment (expect)"
          )
  
imports: import pickle
  import numpy
  import numpy.testing
  from numpy.testing import assert_allclose, assert_equal
  from pytest import raises
  import numpy.ma.testutils
  from scipy._lib._util import getfullargspec_no_self, np_long
  from scipy import stats
label_desc: Use image node_id 4 for calling a global function with example usage: check_mean_expect(distfn, arg, m, msg) without return types