code: def gamma(shape, scale=1.0, size=None, dtype=float):
      """Gamma distribution.
  
      Returns an array of samples drawn from the gamma distribution. Its
      probability density function is defined as
  
      .. math::
         f(x) = \\frac{1}{\\Gamma(k)\\theta^k}x^{k-1}e^{-x/\\theta}.
  
      Args:
          shape (array): Parameter of the gamma distribution :math:`k`.
          scale (array): Parameter of the gamma distribution :math:`\\theta`
          size (int or tuple of ints): The shape of the array. If ``None``, a
              zero-dimensional array is generated.
          dtype: Data type specifier. Only :class:`numpy.float32` and
              :class:`numpy.float64` types are allowed.
  
      Returns:cupy.ndarray: Samples drawn from the gamma distribution.
  
      .. seealso::
          :func:`numpy.random.gamma`
      """
      rs = _generator.get_random_state()
      return rs.gamma(shape, scale, size, dtype)
  
imports: from cupy.random import _generator
  from cupy import _util
label_desc: Use image node_id 7 for calling a global function with example usage: gamma(shape, scale, size, dtype) and returns: rs