code: def _bdtr(k, n, p):
      """The binomial cumulative distribution function.
  
      Args:
        k: floating point `Tensor`.
        n: floating point `Tensor`.
        p: floating point `Tensor`.
  
      Returns:
        `sum_{j=0}^k p^j (1 - p)^(n - j)`.
      """
      # Trick for getting safe backprop/gradients into n, k when
      #   betainc(a = 0, ..) = nan
      # Write:
      #   where(unsafe, safe_output, betainc(where(unsafe, safe_input, input)))
      ones = tf.ones_like(n - k)
      safe_dn = tf.where(tf.logical_or(k < 0, k >= n), ones, n - k)
      dk = special.betainc(a=safe_dn, b=k + 1, x=1 - p)
      return distribution_util.extend_cdf_outside_support(
          k, dk, low=0, high=n
      )
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import sigmoid
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import batched_rejection_sampler
  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 special
label_desc: Use image node_id 1 for calling a global function with example usage: _bdtr(k, n, p) and returns: distribution_util