code: def _gam_param(x, z):
      """Compute the parameters of a gamma density from data weighted points
  
      Parameters
      ----------
      x: array of shape(nbitem) the learning points
      z: array of shape(nbitem), their membership within the class
  
      Notes
      -----
      if no point is positive then the couple (1, 1) is returned
      """
      eps = 1.0e-5
      i = np.ravel(np.nonzero(x > 0))
      szi = np.sum(z[i])
      if szi > 0:
          shape = _compute_c(x[i], z[i], eps)
          scale = np.dot(x[i], z[i]) / (szi * shape)
      else:
          shape = 1
          scale = 1
      return shape, scale
  
imports: import numpy
  import scipy.special
  import scipy.stats
label_desc: Use image node_id 6 for calling a global function with example usage: _gam_param(x, z) and returns: shape,  scale