code: def random_gamma_with_runtime(
      shape,
      concentration,
      rate=None,
      log_rate=None,
      seed=None,
      log_space=False,
  ):
      """Returns both a sample and the id of the implementation-selected runtime."""
      # This method exists chiefly for testing purposes.
      dtype = dtype_util.common_dtype(
          [concentration, rate, log_rate], tf.float32
      )
      concentration = tf.convert_to_tensor(concentration, dtype=dtype)
      shape = ps.convert_to_shape_tensor(
          shape, dtype_hint=tf.int32, name="shape"
      )
  
      if rate is not None and log_rate is not None:
          raise ValueError(
              "At most one of `rate` and `log_rate` may be specified."
          )
      if rate is not None:
          rate = tf.convert_to_tensor(rate, dtype=dtype)
      if log_rate is not None:
          log_rate = tf.convert_to_tensor(log_rate, dtype=dtype)
      total_shape = ps.concat(
          [
              shape,
              ps.broadcast_shape(
                  ps.shape(concentration),
                  _shape_or_scalar(rate, log_rate),
              ),
          ],
          axis=0,
      )
      seed = samplers.sanitize_seed(seed, salt="random_gamma")
      return _random_gamma_gradient(
          total_shape, concentration, rate, log_rate, seed, log_space
      )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import batched_rejection_sampler
  from tensorflow_probability.python.internal import custom_gradient
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import implementation_selection
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math import generic
  from tensorflow_probability.python.math import special
  from tensorflow_probability.python.util.deferred_tensor import DeferredTensor
label_desc: Use image node_id 13 for calling a global function with example usage: random_gamma_with_runtime(shape, concentration, rate, log_rate, seed, log_space) and returns: _random_gamma_gradient