code: def _endog_gen(endog, partitions):
      """partitions endog data"""
  
      n_endog = endog.shape[0]
      n_part = np.ceil(n_endog / partitions)
  
      ii = 0
      while ii < n_endog:
          jj = int(min(ii + n_part, n_endog))
          yield endog[ii:jj]
          ii += int(n_part)
  
file_path: statsmodels/examples/python/distributed_estimation.py
imports: import numpy
  from scipy.stats.distributions import norm
  from statsmodels.base.distributed_estimation import DistributedModel
  from statsmodels.genmod.generalized_linear_model import GLM
  from statsmodels.genmod.families import Gaussian
  from statsmodels.base.distributed_estimation import _est_regularized_naive, _join_naive
  from statsmodels.base.distributed_estimation import _est_unregularized_naive, DistributedResults
label_desc: Use image node_id 2 for calling a global function with example usage: _endog_gen(endog, partitions) without return types