code: def _gam_dens(shape, scale, x):
      """evaluate the gamma density (shape,scale) at points x
  
      Notes
      -----
      Returns 0 on negative subspace
      """
      ng = np.zeros(np.size(x))
      cst = -shape * np.log(scale) - sp.gammaln(shape)
      i = np.ravel(np.nonzero(x > 0))
      if np.size(i) > 0:
          lz = cst + (shape - 1) * np.log(x[i]) - x[i] / scale
          ng[i] = np.exp(lz)
      return ng
  
imports: import numpy
  import scipy.special
  import scipy.stats
label_desc: Use image node_id 5 for calling a global function with example usage: _gam_dens(shape, scale, x) and returns: ng