code: def evaluate_legendre_polynomial(
      degree_l: TensorLike, order_m: TensorLike, x: TensorLike
  ) -> TensorLike:
      """Evaluates the Legendre polynomial of degree l and order m at x.
  
      Note:
        This function is implementing the algorithm described in p. 10 of `Spherical
        Harmonic Lighting: The Gritty Details`.
  
      Note:
        In the following, A1 to An are optional batch dimensions.
  
      Args:
        degree_l: An integer tensor of shape `[A1, ..., An]` corresponding to the
          degree of the associated Legendre polynomial. Note that `degree_l` must be
          non-negative.
        order_m: An integer tensor of shape `[A1, ..., An]` corresponding to the
          order of the associated Legendre polynomial. Note that `order_m` must
          satisfy `0 <= order_m <= l`.
        x: A tensor of shape `[A1, ..., An]` with values in [-1,1].
  
      Returns:
        A tensor of shape `[A1, ..., An]` containing the evaluation of the legendre
        polynomial.
      """
      degree_l = tf.convert_to_tensor(value=degree_l)
      order_m = tf.convert_to_tensor(value=order_m)
      x = tf.convert_to_tensor(value=x)
  
      if not degree_l.dtype.is_integer:
          raise ValueError("`degree_l` must be of an integer type.")
      if not order_m.dtype.is_integer:
          raise ValueError("`order_m` must be of an integer type.")
      shape.compare_batch_dimensions(
          tensors=(degree_l, order_m, x),
          last_axes=-1,
          tensor_names=("degree_l", "order_m", "x"),
          broadcast_compatible=True,
      )
      degree_l = asserts.assert_all_above(degree_l, 0)
      order_m = asserts.assert_all_in_range(order_m, 0, degree_l)
      x = asserts.assert_all_in_range(x, -1.0, 1.0)
  
      pmm = _evaluate_legendre_polynomial_pmm_eval(order_m, x)
      return tf.where(
          tf.equal(degree_l, order_m),
          pmm,
          _evaluate_legendre_polynomial_branch(
              degree_l, order_m, x, pmm
          ),
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Tuple
  import numpy
  from six.moves import range
  import tensorflow
  from tensorflow_graphics.math import math_helpers
  from tensorflow_graphics.math import vector
  from tensorflow_graphics.util import asserts
  from tensorflow_graphics.util import export_api
  from tensorflow_graphics.util import shape
  from tensorflow_graphics.util.type_alias import TensorLike
label_desc: Use image node_id 9 for calling a global function with example usage: evaluate_legendre_polynomial(degree_l, order_m, x) and returns: tf