code: def _homogeneous_data_generator(
      n_samples, n_repetitions, axis, rng, paired=False, all_nans=True
  ):
      # generate random samples to check the response of hypothesis tests to
      # samples with different (but broadcastable) shapes and homogeneous
      # data (all nans or all finite)
      data = []
      for i in range(n_samples):
          n_obs = (
              20 if paired else 20 + i
          )  # observations per axis-slice
          shape = [n_repetitions] + [1] * n_samples + [n_obs]
          shape[1 + i] = 2
          x = np.ones(shape) * np.nan if all_nans else rng.random(shape)
          x = np.moveaxis(x, -1, axis)
          data.append(x)
      return data
  
imports: from itertools import product, combinations_with_replacement, permutations
  import re
  import pickle
  import pytest
  import numpy
  from numpy.testing import assert_allclose, assert_equal, suppress_warnings
  from scipy import stats
  from scipy.stats import norm
  from scipy.stats._axis_nan_policy import _masked_arrays_2_sentinel_arrays
  from scipy._lib._util import AxisError
label_desc: Use image node_id 4 for calling a global function with example usage: _homogeneous_data_generator(n_samples, n_repetitions, axis, rng, paired, all_nans) and returns: data