code: def rank(
      input: ragged_tensor.Ragged, name=None
  ):  # pylint: disable=redefined-builtin
      """Returns the rank of a RaggedTensor.
  
      Returns a 0-D `int32` `Tensor` representing the rank of `input`.
  
      #### Example:
  
      >>> # shape of tensor 't' is [2, None, None]
      >>> t = tf.ragged.constant([[[1], [2, 2]], [[3, 3, 3], [4, 4, 4, 4]]])
      >>> tf.rank(t).numpy()
      3
  
      Args:
        input: A `RaggedTensor`
        name: A name for the operation (optional).
  
      Returns:
        A `Tensor` of type `int32`.
      """
      with ops.name_scope(name, "RaggedRank", [input]) as name:
          if not ragged_tensor.is_ragged(input):
              return array_ops.rank(input, name)
  
          return input.ragged_rank + array_ops.rank(input.flat_values)
  
imports: from typing import Optional
  from typing import Union
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import array_ops_stack
  from tensorflow.python.ops import check_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import data_flow_ops
  from tensorflow.python.ops import gen_ragged_array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import sort_ops
  from tensorflow.python.ops.ragged import dynamic_ragged_shape
  from tensorflow.python.ops.ragged import ragged_functional_ops
  from tensorflow.python.ops.ragged import ragged_math_ops
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.ops.ragged import ragged_util
  from tensorflow.python.ops.ragged import segment_id_ops
  from tensorflow.python.types import core
  from tensorflow.python.util import dispatch
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 9 for calling a global function with example usage: rank(input, name) and returns: unknown, array_ops