code: def generate_random_barycentric_coordinates(
      sample_shape: type_alias.TensorLike,
      dtype: tf.DType = tf.dtypes.float32,
      seed: Optional[type_alias.TensorLike] = None,
      stateless: bool = False,
      name: str = "generate_random_barycentric_coordinates",
  ) -> type_alias.TensorLike:
      """Generate uniformly sampled random barycentric coordinates.
  
      Note:
        In the following, A1 to An are optional batch dimensions.
  
      Args:
        sample_shape: An `int` tensor with shape `[n+1,]` and values `(A1, ..., An,
          num_samples)` denoting total number of random samples drawn, where `n` is
          number of batch dimensions, and `num_samples` is the number of samples
          drawn for each mesh.
        dtype: Optional type of generated barycentric coordinates, defaults to
          float32.
        seed: An optional random seed.
        stateless: Optional flag to use stateless random sampler. If stateless=True,
          then `seed` must be provided as shape `[2]` int tensor. Stateless random
          sampling is useful for testing to generate the same reproducible sequence
          across calls. If stateless=False, then a stateful random number generator
          is used (default behavior).
        name: Name for op. Defaults to "generate_random_barycentric_coordinates".
  
      Returns:
        A `dtype` tensor of shape [A1, ..., An, num_samples, 3],
          where the last dimension contains the sampled barycentric coordinates.
  
  
      """
      with tf.name_scope(name):
          sample_shape = tf.convert_to_tensor(value=sample_shape)
          shape.check_static(
              tensor=sample_shape,
              tensor_name="sample_shape",
              has_rank=1,
          )
          sample_shape = tf.concat((sample_shape, (2,)), axis=0)
  
          if stateless:
              seed = tf.convert_to_tensor(value=seed)
              shape.check_static(
                  tensor=seed,
                  tensor_name="seed",
                  has_dim_equals=(-1, 2),
              )
              sample_fn = tf.random.stateless_uniform
          else:
              sample_fn = tf.random.uniform
          random_uniform = sample_fn(
              shape=sample_shape,
              minval=0.0,
              maxval=1.0,
              dtype=dtype,
              seed=seed,
          )
          random1 = tf.sqrt(random_uniform[..., 0])
          random2 = random_uniform[..., 1]
          barycentric = tf.stack(
              (1 - random1, random1 * (1 - random2), random1 * random2),
              axis=-1,
          )
          return barycentric
  
file_path: graphics/tensorflow_graphics/geometry/representation/mesh/sampler.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Optional, Tuple
  import tensorflow
  from tensorflow_graphics.geometry.representation import triangle
  from tensorflow_graphics.geometry.representation.mesh import normals
  from tensorflow_graphics.util import asserts
  from tensorflow_graphics.util import export_api
  from tensorflow_graphics.util import shape
  from tensorflow_graphics.util import type_alias
label_desc: Use image node_id 4 for calling a global function with example usage: generate_random_barycentric_coordinates(sample_shape, dtype, seed, stateless, name) and returns: barycentric