code: def von_mises_cdf(x, concentration):
      """Computes the cumulative density function (CDF) of von Mises distribution.
  
      Denote the density of vonMises(loc=0, concentration=concentration) by p(t).
      Note that p(t) is periodic, p(t) = p(t + 2 pi).
      The CDF at the point x is defined as int_{-pi}^x p(t) dt.
      Thus, when x in [-pi, pi], the CDF is in [0, 1]; when x is in [pi, 3pi], the
      CDF is in [1, 2], etc.
  
      The CDF is not available in closed form. Instead, we use the method [1]
      which uses either a series expansion or a Normal approximation, depending on
      the value of concentration.
  
      We also compute the derivative of the CDF w.r.t. both x and concentration.
      The derivative w.r.t. x is p(x), while the derivative w.r.t. concentration is
      computed
      using automatic differentiation. We use forward mode for the series case
      (which allows to save memory) and backward mode for the Normal approximation.
  
      Args:
        x: The point at which to evaluate the CDF.
        concentration: The concentration parameter of the von Mises distribution.
  
      Returns:
        The value of the CDF computed elementwise.
  
      References:
        [1] G. Hill "Algorithm 518: Incomplete Bessel Function I_0. The Von Mises
        Distribution." ACM Transactions on Mathematical Software, 1977
      """
      x = tf.convert_to_tensor(x)
      concentration = tf.convert_to_tensor(concentration)
      dtype = x.dtype
  
      # Map x to [-pi, pi].
      num_periods = tf.round(x / (2.0 * np.pi))
      x = x - (2.0 * np.pi) * num_periods
  
      # We take the hyperparameters from Table I of [1], the row for D=8
      # decimal digits of accuracy. ck is the cut-off for concentration:
      # if concentration < ck,  the series expansion is used;
      # otherwise, the Normal approximation is used.
      ck = 10.5
      # The number of terms in the series expansion. [1] chooses it as a function
      # of concentration, n(concentration). This is hard to implement in TF.
      # Instead, we upper bound it over concentrations:
      #   num_terms = ceil ( max_{concentration <= ck} n(concentration) ).
      # The maximum is achieved for concentration = ck.
      num_terms = 20
  
      cdf_series, dcdf_dconcentration_series = _von_mises_cdf_series(
          x, concentration, num_terms, dtype
      )
      cdf_normal, dcdf_dconcentration_normal = _von_mises_cdf_normal(
          x, concentration, dtype
      )
  
      use_series = concentration < ck
      cdf = tf.where(use_series, cdf_series, cdf_normal)
      cdf = cdf + num_periods
      dcdf_dconcentration = tf.where(
          use_series,
          dcdf_dconcentration_series,
          dcdf_dconcentration_normal,
      )
  
      def grad(dy):
          prob = tf.exp(concentration * cosxm1(x)) / (
              (2.0 * np.pi) * tf.math.bessel_i0e(concentration)
          )
          return dy * prob, dy * dcdf_dconcentration
  
      return cdf, grad
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import sigmoid
  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.distributions import normal
  from tensorflow_probability.python.internal import assert_util
  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 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.gradient import value_and_gradient
label_desc: Use image node_id 3 for calling a global function with example usage: von_mises_cdf(x, concentration) and returns: cdf,  grad, unknown,  unknown